Expose additional file level attributes
commit39a4daf742a4bd34b34f85e004895385e4c46c1a
authorUmer Saleem <usaleem@ixsystems.com>
Tue, 8 Mar 2022 01:52:03 +0000 (8 06:52 +0500)
committerGitHub <noreply@github.com>
Tue, 8 Mar 2022 01:52:03 +0000 (7 17:52 -0800)
treeeed72bcbb589ca6a3d0288cc723ae9fa8da3e73e
parent9955b9ba2efafeeb88ccb4c4ab5707ef2974fb47
Expose additional file level attributes

ZFS allows to update and retrieve additional file level attributes for
FreeBSD. This commit allows additional file level attributes to be
updated and retrieved for Linux. These include the flags stored in the
upper half of z_pflags only.

Two new IOCTLs have been added for this purpose. ZFS_IOC_GETDOSFLAGS
can be used to retrieve the attributes, while ZFS_IOC_SETDOSFLAGS can
be used to update the attributes.

Attributes that are allowed to be updated include ZFS_IMMUTABLE,
ZFS_APPENDONLY, ZFS_NOUNLINK, ZFS_ARCHIVE, ZFS_NODUMP, ZFS_SYSTEM,
ZFS_HIDDEN, ZFS_READONLY, ZFS_REPARSE, ZFS_OFFLINE and ZFS_SPARSE.
Flags can be or'd together while calling ZFS_IOC_SETDOSFLAGS.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Umer Saleem <usaleem@ixsystems.com>
Closes #13118
24 files changed:
configure.ac
include/sys/fs/zfs.h
include/sys/zfs_znode.h
module/os/linux/zfs/zpl_file.c
tests/runfiles/common.run
tests/runfiles/freebsd.run
tests/runfiles/linux.run
tests/zfs-tests/cmd/Makefile.am
tests/zfs-tests/cmd/read_dos_attributes/.gitignore [new file with mode: 0644]
tests/zfs-tests/cmd/read_dos_attributes/Makefile.am [new file with mode: 0644]
tests/zfs-tests/cmd/read_dos_attributes/read_dos_attributes.c [new file with mode: 0644]
tests/zfs-tests/cmd/write_dos_attributes/.gitignore [new file with mode: 0644]
tests/zfs-tests/cmd/write_dos_attributes/Makefile.am [new file with mode: 0644]
tests/zfs-tests/cmd/write_dos_attributes/write_dos_attributes.c [new file with mode: 0644]
tests/zfs-tests/include/commands.cfg
tests/zfs-tests/tests/functional/Makefile.am
tests/zfs-tests/tests/functional/acl/off/Makefile.am
tests/zfs-tests/tests/functional/acl/off/dosmode.ksh
tests/zfs-tests/tests/functional/acl/off/dosmode_readonly_write.c
tests/zfs-tests/tests/functional/dos_attributes/Makefile.am [new file with mode: 0644]
tests/zfs-tests/tests/functional/dos_attributes/cleanup.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/dos_attributes/read_dos_attrs_001.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/dos_attributes/setup.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/dos_attributes/write_dos_attrs_001.ksh [new file with mode: 0755]