Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'xfs-4.15-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fixes from Darrick Wong:

- Fix a memory leak in the new in-core extent map

- Refactor the xfs_dev_t conversions for easier xfsprogs porting

* tag 'xfs-4.15-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: abstract out dev_t conversions
xfs: fix memory leak in xfs_iext_free_last_leaf

+13 -7
+1 -1
fs/xfs/libxfs/xfs_iext_tree.c
··· 850 850 xfs_iext_free_last_leaf( 851 851 struct xfs_ifork *ifp) 852 852 { 853 - ifp->if_u1.if_root = NULL; 854 853 ifp->if_height--; 855 854 kmem_free(ifp->if_u1.if_root); 855 + ifp->if_u1.if_root = NULL; 856 856 } 857 857 858 858 void
+2 -6
fs/xfs/libxfs/xfs_inode_fork.c
··· 42 42 STATIC int xfs_iformat_extents(xfs_inode_t *, xfs_dinode_t *, int); 43 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 46 * Copy inode type and data and attr format specific information from the 52 47 * on-disk inode to the in-core inode and fork structures. For fifos, devices, ··· 787 792 case XFS_DINODE_FMT_DEV: 788 793 if (iip->ili_fields & XFS_ILOG_DEV) { 789 794 ASSERT(whichfork == XFS_DATA_FORK); 790 - xfs_dinode_put_rdev(dip, sysv_encode_dev(VFS_I(ip)->i_rdev)); 795 + xfs_dinode_put_rdev(dip, 796 + linux_to_xfs_dev_t(VFS_I(ip)->i_rdev)); 791 797 } 792 798 break; 793 799
+10
fs/xfs/xfs_linux.h
··· 204 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 218 * Various platform dependent calls that don't fit anywhere else 209 219 */