RFC ovl: optimize dir iteration
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest4 patches 4 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | vfs: add RENAME_VFS_DTYPE vfs_rename() flaginclude/ include/ | +34 | 1 reply | |
| 2/4 | xfs: support RENAME_VFS_DTYPE flagfs/ fs/ | +9 | 3 replies | |
| 3/4 | ovl: use RENAME_DT_UNKNOWN to optimize stable d_inodefs/ fs/ | +12 | 0 replies | |
| 4/4 | ovl: use RENAME_DT_WHT to optimize ovl_dir_read_merged()fs/ fs/ | +10 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC][PATCH 0/4] ovl: optimize dir iteration
Miklos,
This patch series implements dir iteration optimizations using fs support for setting file types on rename.
Implementing support for xfs was very easy, although this is just a demo patch, because proper support would require a new feature flag and relaxing xfs_repair file type checks.
The xfs patch is based on top of my cleanup series, but is not dependent on it in any significant way.
I tested on the following setup of upper/lower on same base xfs:
/dev-lower_layer on /base type xfs (rw,relatime,attr2,inode64,noquota) /dev-lower_layer on /lower type xfs (rw,relatime,attr2,inode64,noquota) /dev-lower_layer on /upper type xfs (rw,relatime,attr2,inode64,noquota)
overlay on /mnt type overlay (rw,relatime,lowerdir=/lower,upperdir=/upper/0,workdir=/upper/work)
Generated some whiteouts some copy ups and some opaque objects:
root@kvm-xfstests:~# rm /mnt/a/pointless100 root@kvm-xfstests:~# rmdir /mnt/a/empty100 root@kvm-xfstests:~# touch /mnt/a/foo100 root@kvm-xfstests:~# touch /mnt/a/dir100 root@kvm-xfstests:~# touch /mnt/a/newfile root@kvm-xfstests:~# mkdir /mnt/a/newdir
Used this tool I introduced to xfstests to print the resulting dtypes:
root@kvm-xfstests:~# ./xfstests/src/t_dir_type /upper/0/a/ . d .. d pointless100 w empty100 w foo100 u dir100 u newfile f newdir d
What do you think of the proposed rename API?
To me, it makes some sense, because a request to re-classify a directory entry is like a request to re-index it, which is basically what rename is about. It may even make sense to be able to call the rename API for changing dtype, without changing the name/parent at all.
Amir.
Amir Goldstein (4):
vfs: add RENAME_VFS_DTYPE vfs_rename() flag
xfs: support RENAME_VFS_DTYPE flag
ovl: use RENAME_DT_UNKNOWN to optimize stable d_inode
ovl: use RENAME_DT_WHT to optimize ovl_dir_read_merged()
fs/overlayfs/copy_up.c | 8 +++++++- fs/overlayfs/dir.c | 12 +++++++++--- fs/overlayfs/overlayfs.h | 5 +++++ fs/overlayfs/readdir.c | 2 +- fs/xfs/libxfs/xfs_dir2.c | 1 + fs/xfs/xfs_iops.c | 11 ++++++++--- include/linux/fs.h | 30 ++++++++++++++++++++++++++++++ include/uapi/linux/fs.h | 4 ++++ 8 files changed, 65 insertions(+), 8 deletions(-)
Signature · 1 line
2.7.4