diff options
| -rw-r--r-- | fs/xfs/libxfs/xfs_inode_fork.c | 8 | ||||
| -rw-r--r-- | fs/xfs/xfs_linux.h | 10 |
2 files changed, 12 insertions, 6 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_fork.c b/fs/xfs/libxfs/xfs_inode_fork.c index 1c90ec41e9df..c79a1616b79d 100644 --- a/fs/xfs/libxfs/xfs_inode_fork.c +++ b/fs/xfs/libxfs/xfs_inode_fork.c | |||
| @@ -42,11 +42,6 @@ STATIC int xfs_iformat_local(xfs_inode_t *, xfs_dinode_t *, int, int); | |||
| 42 | STATIC int xfs_iformat_extents(xfs_inode_t *, xfs_dinode_t *, int); | 42 | STATIC int xfs_iformat_extents(xfs_inode_t *, xfs_dinode_t *, int); |
| 43 | STATIC int xfs_iformat_btree(xfs_inode_t *, xfs_dinode_t *, int); | 43 | STATIC int xfs_iformat_btree(xfs_inode_t *, xfs_dinode_t *, int); |
| 44 | 44 | ||
| 45 | static inline dev_t xfs_to_linux_dev_t(xfs_dev_t dev) | ||
| 46 | { | ||
| 47 | return MKDEV(sysv_major(dev) & 0x1ff, sysv_minor(dev)); | ||
| 48 | } | ||
| 49 | |||
| 50 | /* | 45 | /* |
| 51 | * Copy inode type and data and attr format specific information from the | 46 | * Copy inode type and data and attr format specific information from the |
| 52 | * on-disk inode to the in-core inode and fork structures. For fifos, devices, | 47 | * on-disk inode to the in-core inode and fork structures. For fifos, devices, |
| @@ -792,7 +787,8 @@ xfs_iflush_fork( | |||
| 792 | case XFS_DINODE_FMT_DEV: | 787 | case XFS_DINODE_FMT_DEV: |
| 793 | if (iip->ili_fields & XFS_ILOG_DEV) { | 788 | if (iip->ili_fields & XFS_ILOG_DEV) { |
| 794 | ASSERT(whichfork == XFS_DATA_FORK); | 789 | ASSERT(whichfork == XFS_DATA_FORK); |
| 795 | xfs_dinode_put_rdev(dip, sysv_encode_dev(VFS_I(ip)->i_rdev)); | 790 | xfs_dinode_put_rdev(dip, |
| 791 | linux_to_xfs_dev_t(VFS_I(ip)->i_rdev)); | ||
| 796 | } | 792 | } |
| 797 | break; | 793 | break; |
| 798 | 794 | ||
diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h index 6282bfc1afa9..99562ec0de56 100644 --- a/fs/xfs/xfs_linux.h +++ b/fs/xfs/xfs_linux.h | |||
| @@ -204,6 +204,16 @@ static inline kgid_t xfs_gid_to_kgid(uint32_t gid) | |||
| 204 | return make_kgid(&init_user_ns, gid); | 204 | return make_kgid(&init_user_ns, gid); |
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | static inline dev_t xfs_to_linux_dev_t(xfs_dev_t dev) | ||
| 208 | { | ||
| 209 | return MKDEV(sysv_major(dev) & 0x1ff, sysv_minor(dev)); | ||
| 210 | } | ||
| 211 | |||
| 212 | static inline xfs_dev_t linux_to_xfs_dev_t(dev_t dev) | ||
| 213 | { | ||
| 214 | return sysv_encode_dev(dev); | ||
| 215 | } | ||
| 216 | |||
| 207 | /* | 217 | /* |
| 208 | * Various platform dependent calls that don't fit anywhere else | 218 | * Various platform dependent calls that don't fit anywhere else |
| 209 | */ | 219 | */ |
