Hi all, This series hoists inode creation, renaming, and deletion operations to libxfs in anticipation of the metadata inode directory feature, which maintains a directory tree of metadata inodes. This will be necessary for further enhancements to the realtime feature, subvolume support. There aren't supposed to be any functional changes in this intense refactoring -- we just split the functions into pieces that are generic and pieces that are specific to libxfs clients. As a bonus, we can remove various open-coded pieces of mkfs.xfs and xfs_repair when this series gets to xfsprogs. If you're going to start using this code, I strongly recommend pulling from my git trees, which are linked below. This has been running on the djcloud for months with no problems. Enjoy! Comments and questions are, as always, welcome. --D kernel git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=inode-refactor xfsprogs git tree: https://git.kernel.org/cgit/linux/kernel/git/djwong/xfsprogs-dev.git/log/?h=inode-refactor --- Commits in this patchset: * xfs: use consistent uid/gid when grabbing dquots for inodes * xfs: move inode copy-on-write predicates to xfs_inode.[ch] * xfs: hoist extent size helpers to libxfs * xfs: hoist inode flag conversion functions to libxfs * xfs: hoist project id get/set functions to libxfs * xfs: pack icreate initialization parameters into a separate structure * xfs: implement atime updates in xfs_trans_ichgtime * xfs: use xfs_trans_ichgtime to set times when allocating inode * xfs: split new inode creation into two pieces * xfs: hoist new inode initialization functions to libxfs * xfs: push xfs_icreate_args creation out of xfs_create* * xfs: wrap inode creation dqalloc calls * xfs: hoist xfs_iunlink to libxfs * xfs: hoist xfs_{bump,drop}link to libxfs * xfs: separate the icreate logic around INIT_XATTRS * xfs: create libxfs helper to link a new inode into a directory * xfs: create libxfs helper to link an existing inode into a directory * xfs: hoist inode free function to libxfs * xfs: create libxfs helper to remove an existing inode/name from a directory * xfs: create libxfs helper to exchange two directory entries * xfs: create libxfs helper to rename two directory entries * xfs: move dirent update hooks to xfs_dir2.c * xfs: get rid of trivial rename helpers * xfs: don't use the incore struct xfs_sb for offsets into struct xfs_dsb --- fs/xfs/Makefile | 1 fs/xfs/libxfs/xfs_bmap.c | 43 + fs/xfs/libxfs/xfs_bmap.h | 3 fs/xfs/libxfs/xfs_dir2.c | 661 +++++++++++++++++ fs/xfs/libxfs/xfs_dir2.h | 49 + fs/xfs/libxfs/xfs_format.h | 9 fs/xfs/libxfs/xfs_ialloc.c | 15 fs/xfs/libxfs/xfs_inode_util.c | 749 ++++++++++++++++++++ fs/xfs/libxfs/xfs_inode_util.h | 62 ++ fs/xfs/libxfs/xfs_ondisk.h | 1 fs/xfs/libxfs/xfs_shared.h | 7 fs/xfs/libxfs/xfs_trans_inode.c | 2 fs/xfs/scrub/common.c | 1 fs/xfs/scrub/tempfile.c | 21 - fs/xfs/xfs_inode.c | 1487 ++++----------------------------------- fs/xfs/xfs_inode.h | 70 -- fs/xfs/xfs_ioctl.c | 60 -- fs/xfs/xfs_iops.c | 51 + fs/xfs/xfs_linux.h | 2 fs/xfs/xfs_qm.c | 7 fs/xfs/xfs_reflink.h | 10 fs/xfs/xfs_symlink.c | 70 +- fs/xfs/xfs_trans.h | 1 23 files changed, 1837 insertions(+), 1545 deletions(-) create mode 100644 fs/xfs/libxfs/xfs_inode_util.c create mode 100644 fs/xfs/libxfs/xfs_inode_util.h