Skip to content

RFC xfs: directory/attribute geometry abstraction

Dave Chinner linux-xfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest18 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18xfs: remove redundant checks from xfs_da_read_buffs/xfs/xfs_da_btree.c+0 -410 replies
2/18xfs: introduce directory geometry structurefs/xfs/xfs_attr.c fs/xfs/xfs_attr_leaf.c fs/xfs/xfs_attr_list.c +5 more+79 -210 replies
3/18xfs: move directory block translatiosn to xfs_da_btree.hfs/xfs/xfs_da_btree.h fs/xfs/xfs_da_format.c fs/xfs/xfs_da_format.h+138 -1380 replies
4/18xfs: kill XFS_DIR2...FIRSTDB macrosfs/xfs/xfs_da_format.c fs/xfs/xfs_da_format.h fs/xfs/xfs_dir2.c +2 more+17 -170 replies
5/18xfs: convert dir byte/off conversion to xfs_da_geometryfs/xfs/xfs_da_btree.h fs/xfs/xfs_dir2.c fs/xfs/xfs_dir2_readdir.c+14 -130 replies
6/18xfs: convert directory dablk conversion to xfs_da_geometryfs/xfs/xfs_da_btree.h fs/xfs/xfs_dir2.c fs/xfs/xfs_dir2_data.c +3 more+48 -430 replies
7/18xfs: convert directory db conversion to xfs_da_geometryfs/xfs/xfs_da_btree.h fs/xfs/xfs_da_format.c fs/xfs/xfs_dir2.c +6 more+93 -700 replies
8/18xfs: convert directory segment limits to xfs_da_geometryfs/xfs/xfs_da_btree.c fs/xfs/xfs_dir2.c fs/xfs/xfs_dir2_block.c +5 more+37 -390 replies
9/18xfs: convert m_dirblkfsbs to xfs_da_geometryfs/xfs/xfs_bmap.c fs/xfs/xfs_da_btree.c fs/xfs/xfs_dir2.c +6 more+27 -320 replies
10/18xfs: convert m_dirblksize to xfs_da_geometryfs/xfs/xfs_da_btree.c fs/xfs/xfs_da_btree.h fs/xfs/xfs_da_format.c +11 more+116 -1060 replies
11/18xfs: convert dir/attr btree threshold to xfs_da_geometryfs/xfs/xfs_attr_leaf.c fs/xfs/xfs_dir2_node.c fs/xfs/xfs_mount.h+2 -40 replies
12/18xfs: reduce direct usage of mp->m_dir_geofs/xfs/xfs_dir2.c fs/xfs/xfs_dir2.h fs/xfs/xfs_dir2_readdir.c+74 -850 replies
13/18xfs: remove mp->m_dir_geo from directory loggingfs/xfs/xfs_dir2.h fs/xfs/xfs_dir2_block.c fs/xfs/xfs_dir2_data.c +3 more+137 -1480 replies
14/18xfs: move node entry counts to xfs_da_geometryfs/xfs/xfs_attr.c fs/xfs/xfs_da_btree.c fs/xfs/xfs_dir2_node.c +1 more+11 -130 replies
15/18xfs: use xfs_da_geometry for block size in attr codefs/xfs/xfs_attr.c fs/xfs/xfs_attr_leaf.c fs/xfs/xfs_log_rlimit.c+15 -170 replies
16/18xfs: pass xfs_da_args to xfs_attr_leaf_newentsizefs/xfs/xfs_attr.c fs/xfs/xfs_attr_leaf.c fs/xfs/xfs_attr_leaf.h+19 -350 replies
17/18xfs: repalce attr LBSIZE with xfs_da_geometryfs/xfs/xfs_attr.c fs/xfs/xfs_attr_leaf.c fs/xfs/xfs_attr_remote.c +1 more+89 -920 replies
18/18xfs: add xfs_da_geometry to inode forksfs/xfs/xfs_attr.c fs/xfs/xfs_attr_leaf.c fs/xfs/xfs_attr_list.c +12 more+29 -222 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 00/18] xfs: directory/attribute geometry abstraction

Hi folks,

As I mentioned in the in-kernel libxfs reowrk thread, there's a problem with the libxfs code being dependent on the struct xfs_mount, which is defined externally to libxfs.

The series stemmed from that as a way of working out the issues with untangling the circular dependency mess. Essentially all the da code is dependent on the struct xfs-mount for directory and attribute tree configuration - block sizes, merge thresholds, etc. These all need to be defined and managed by the libxfs code itself, and the external code should just manage it.

So, this patchset removes one of the dependencies from the da code by adding a geometry structure to the xfs_da_args that contains all the necessary information from the struct xfs_mount. In doing this abstraction, I realised that this is exactly the abstraction needed to do per-inode directory block size configuration rather than have it be fixed for the entire filesystem by the superblock. So the patch set also sets the ground work for that.

It also opens some other interesting avenues - the directory geometry is really just a specialised data fork allocation policy structure. I'll leave the reader to follow that to it's logical conclusion....

Now, this patchset is currently only compile tested - if you try to run it, it will eat all your Precious' and then ask "Please, Sir, can I have some more?". There are things that I've noticed in later patches that need fixing in earlier patches and I've just left them with an XXX in place, so there's no need to tell me that work needs to be done to fix this ;)

I am posting it, however, to demonstrate the process which I think we need to take to properly abstract the core XFS code from both the kernel glue layer and the userspace layer. I'm looking for early feedback for this in the context of the libxfs-in-kernel branch I posted a couple of days ago. I don't want to get 90% into a restructure and then have people say "No, this is wrong!".

Eventually, I'd like to have the libxfs code be completely indepenent of the struct xfs_mount, and the external struct xfs_mount just hold a bunch of structures it passes to the libxfs code. It'll take quite a bit of work to get there, but if I'm going to be using libxfs as the core infrastructure of a smart block device, I don't want to carry an xfs_mount around at all....

So, flames, comments, deep thoughts, ponderings, straight jackets, and so on are all welcome! just don't try to run the code ;)

Cheers,

Dave.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs