History

fs: introduce file_getattr and file_setattr syscalls

Introduce file_getattr() and file_setattr() syscalls to manipulate inode extended attributes. The syscalls takes pair of file descriptor and pathname. Then it operates on inode opened accroding to openat() semantics. The struct file_attr is passed to obtain/change extended attributes. This is an alternative to FS_IOC_FSSETXATTR ioctl with a difference that file don't need to be open as we can reference it with a path instead of fd. By having this we can manipulated inode extended attributes not only on regular files but also on special ones. This is not possible with FS_IOC_FSSETXATTR ioctl as with special files we can not call ioctl() directly on the filesystem inode using fd. This patch adds two new syscalls which allows userspace to get/set extended inode attributes on special files by using parent directory and a path - *at() like syscall.

Andrey Albershteyn committed 1 year ago

Commit be7efb21 parent 276e13621 files · +218 −1Browse files

Showing the changes to scripts (1 of 21 files). Show all

Unified · Split

scripts/syscall.tbl+2−0
@@ -408,3 +408,5 @@ · 407 unmodified lines
408408 465 common listxattrat sys_listxattrat
409409 466 common removexattrat sys_removexattrat
410410 467 common open_tree_attr sys_open_tree_attr
411+468 common file_getattr sys_file_getattr
412+469 common file_setattr sys_file_setattr