summaryrefslogtreecommitdiffstats
path: root/fs/orangefs
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2021-06-19 12:26:16 +0300
committerMiklos Szeredi <mszeredi@redhat.com>2021-08-17 11:47:43 +0200
commit4f911138c8da94bcff84f1d093d28e378703c43f (patch)
tree5e60f8b85f273a6599ad0b52165b84af91189a2b /fs/orangefs
parent7c60610d476766e128cc4284bb6349732cbd6606 (diff)
downloadlinux-stable-4f911138c8da94bcff84f1d093d28e378703c43f.tar.gz
linux-stable-4f911138c8da94bcff84f1d093d28e378703c43f.tar.bz2
linux-stable-4f911138c8da94bcff84f1d093d28e378703c43f.zip
fs: add generic helper for filling statx attribute flags
The immutable and append-only properties on an inode are published on the inode's i_flags and enforced by the VFS. Create a helper to fill the corresponding STATX_ATTR_ flags in the kstat structure from the inode's i_flags. Only orange was converted to use this helper. Other filesystems could use it in the future. Suggested-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/orangefs')
-rw-r--r--fs/orangefs/inode.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index 16ac617df7d7..c1bb4c4b5d67 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -882,12 +882,7 @@ int orangefs_getattr(struct user_namespace *mnt_userns, const struct path *path,
if (!(request_mask & STATX_SIZE))
stat->result_mask &= ~STATX_SIZE;
- stat->attributes_mask = STATX_ATTR_IMMUTABLE |
- STATX_ATTR_APPEND;
- if (inode->i_flags & S_IMMUTABLE)
- stat->attributes |= STATX_ATTR_IMMUTABLE;
- if (inode->i_flags & S_APPEND)
- stat->attributes |= STATX_ATTR_APPEND;
+ generic_fill_statx_attr(inode, stat);
}
return ret;
}