Commit 274e0a1f authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: abstract out dev_t conversions

And move them to xfs_linux.h so that xfsprogs can stub them out more
easily.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 6818caa4
...@@ -42,11 +42,6 @@ STATIC int xfs_iformat_local(xfs_inode_t *, xfs_dinode_t *, int, int); ...@@ -42,11 +42,6 @@ STATIC int xfs_iformat_local(xfs_inode_t *, xfs_dinode_t *, int, int);
STATIC int xfs_iformat_extents(xfs_inode_t *, xfs_dinode_t *, int); STATIC int xfs_iformat_extents(xfs_inode_t *, xfs_dinode_t *, int);
STATIC int xfs_iformat_btree(xfs_inode_t *, xfs_dinode_t *, int); STATIC int xfs_iformat_btree(xfs_inode_t *, xfs_dinode_t *, int);
static inline dev_t xfs_to_linux_dev_t(xfs_dev_t dev)
{
return MKDEV(sysv_major(dev) & 0x1ff, sysv_minor(dev));
}
/* /*
* Copy inode type and data and attr format specific information from the * Copy inode type and data and attr format specific information from the
* on-disk inode to the in-core inode and fork structures. For fifos, devices, * on-disk inode to the in-core inode and fork structures. For fifos, devices,
...@@ -792,7 +787,8 @@ xfs_iflush_fork( ...@@ -792,7 +787,8 @@ xfs_iflush_fork(
case XFS_DINODE_FMT_DEV: case XFS_DINODE_FMT_DEV:
if (iip->ili_fields & XFS_ILOG_DEV) { if (iip->ili_fields & XFS_ILOG_DEV) {
ASSERT(whichfork == XFS_DATA_FORK); ASSERT(whichfork == XFS_DATA_FORK);
xfs_dinode_put_rdev(dip, sysv_encode_dev(VFS_I(ip)->i_rdev)); xfs_dinode_put_rdev(dip,
linux_to_xfs_dev_t(VFS_I(ip)->i_rdev));
} }
break; break;
......
...@@ -204,6 +204,16 @@ static inline kgid_t xfs_gid_to_kgid(uint32_t gid) ...@@ -204,6 +204,16 @@ static inline kgid_t xfs_gid_to_kgid(uint32_t gid)
return make_kgid(&init_user_ns, gid); return make_kgid(&init_user_ns, gid);
} }
static inline dev_t xfs_to_linux_dev_t(xfs_dev_t dev)
{
return MKDEV(sysv_major(dev) & 0x1ff, sysv_minor(dev));
}
static inline xfs_dev_t linux_to_xfs_dev_t(dev_t dev)
{
return sysv_encode_dev(dev);
}
/* /*
* Various platform dependent calls that don't fit anywhere else * Various platform dependent calls that don't fit anywhere else
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment