Skip to content

Add ioctl to support extended inode flags

David Sterba linux-btrfs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 7 repliesIn review
  2. v17 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- dropped renaming of variable from patch "btrfs: rename btrfs_flags_to_ioctl to reflect which flags it touches"
- fixed the error handling in "btrfs: add FS_IOC_FSSETXATTR ioctl"
- new patch to unify naming of some local variables

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8btrfs: rename btrfs_update_iflags to reflect which flags it touchesfs/btrfs/ctree.h fs/btrfs/inode.c fs/btrfs/ioctl.c+5 -52 replies
2/8btrfs: rename btrfs_mask_flags to reflect which flags it touchesfs/btrfs/ioctl.c+5 -42 replies
3/8btrfs: rename check_flags to reflect which flags it touchesfs/btrfs/ioctl.c+3 -20 replies
4/8btrfs: rename btrfs_flags_to_ioctl to reflect which flags it touchesfs/btrfs/ioctl.c+5 -41 reply
5/8btrfs: add helpers for FS_XFLAG_* conversionfs/btrfs/ioctl.c+32 -02 replies
6/8btrfs: add FS_IOC_FSGETXATTR ioctlfs/btrfs/ioctl.c+20 -00 replies
7/8btrfs: add FS_IOC_FSSETXATTR ioctlfs/btrfs/ioctl.c+94 -00 replies
8/8btrfs: unify naming of flags variables for SETFLAGS and XFLAGSfs/btrfs/ioctl.c+53 -530 replies

Reviews trailers per patch

None of the 8 patches has a Reviewed-by or Acked-by.

PatchChandan Jay Sharma
1/8
2/8
3/8
4/8
5/8
6/8Based-on-patches-by
7/8Based-on-patches-by
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/8] Add ioctl to support extended inode flags

Changes for v2:
- dropped renaming of variable from patch "btrfs: rename btrfs_flags_to_ioctl to reflect which flags it touches"
- fixed the error handling in "btrfs: add FS_IOC_FSSETXATTR ioctl"
- new patch to unify naming of some local variables

I'm about to add this patchset to the main queue for 4.18, unless there are objections.

The patchset implements the existing VFS ioctls for reading extended ioctl flags by btrfs.

There are many flags/attributes/extended/combined, the naming is confusing, so let's recap what we have:

* generic VFS inode flags (i_flags)
- S_* namespace
https://elixir.bootlin.com/linux/v4.17-rc1/source/include/linux/fs.h#L1850
- FS_IOC_GETFLAGS, FS_IOC_SETFLAGS
- tools: lsatrr, chattr

* btrfs inode flags, on-disk format, independent of the above, with to/from conversions
https://elixir.bootlin.com/linux/v4.17-rc1/source/fs/btrfs/ctree.h#L1416

* extended attributes, also called XATTR, but they're different entity, stored by an inode as key:value pairs
- tools: getfattr, setfattr

* XFLAGs, another interface to the generic S_* flags, new ioctl added because [GS]ETFLAGS is frozen, new bits added, eg. for project quotas or DAX, and more that originate in XFS features
https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/fs.h#L168
- tools: xfs_io -c lsattr, xfs_io -c chattr

In the future, btrfs will probably get:

- nodefrag -- eg. to disable autodefrag or defrag ioctl
- nosymlinks -- for directories, prevent creating new symlinks
- dax

git://github.com/kdave/btrfs-devel dev/xflags

David Sterba (8):
btrfs: rename btrfs_update_iflags to reflect which flags it touches
btrfs: rename btrfs_mask_flags to reflect which flags it touches
btrfs: rename check_flags to reflect which flags it touches
btrfs: rename btrfs_flags_to_ioctl to reflect which flags it touches
btrfs: add helpers for FS_XFLAG_* conversion
btrfs: add FS_IOC_FSGETXATTR ioctl
btrfs: add FS_IOC_FSSETXATTR ioctl
btrfs: unify naming of flags variables for SETFLAGS and XFLAGS

 fs/btrfs/ctree.h |   2 +-
 fs/btrfs/inode.c |   4 +-
 fs/btrfs/ioctl.c | 271 ++++++++++++++++++++++++++++++++++++++++++-------------
 3 files changed, 213 insertions(+), 64 deletions(-)
Signature · 1 line
2.16.2