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: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
This commit is contained in:

committed by
Darrick J. Wong

parent
6818caa4cd
commit
274e0a1f47
@@ -204,6 +204,16 @@ static inline kgid_t xfs_gid_to_kgid(uint32_t 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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user