summaryrefslogtreecommitdiffstats
path: root/fs/overlayfs/overlayfs.h
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2018-01-11 01:25:32 -0500
committerMiklos Szeredi <mszeredi@redhat.com>2018-01-24 04:19:54 -0500
commit051224438af21047b34160b1e0ad1c5af45fdace (patch)
tree236eb05c06c40ca34f1e89f9aee63fe613c58c28 /fs/overlayfs/overlayfs.h
parent1eff1a1deec727bacead79ec64554c1df190f43c (diff)
ovl: generalize ovl_verify_origin() and helpers
Remove the "origin" language from the functions that handle set, get and verify of "origin" xattr and pass the xattr name as an argument. The same helpers are going to be used for NFS export to get, get and verify the "upper" xattr for directory index entries. ovl_verify_origin() is now a helper used only to verify non upper file handle stored in "origin" xattr of upper inode. The upper root dir file handle is still stored in "origin" xattr on the index dir for backward compatibility. This is going to be changed by the patch that adds directory index entries support. Signed-off-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/overlayfs/overlayfs.h')
-rw-r--r--fs/overlayfs/overlayfs.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
index d55afb6646b0..1d62b1e6111a 100644
--- a/fs/overlayfs/overlayfs.h
+++ b/fs/overlayfs/overlayfs.h
@@ -249,8 +249,8 @@ static inline bool ovl_is_impuredir(struct dentry *dentry)
249 249
250 250
251/* namei.c */ 251/* namei.c */
252int ovl_verify_origin(struct dentry *dentry, struct dentry *origin, 252int ovl_verify_set_fh(struct dentry *dentry, const char *name,
253 bool is_upper, bool set); 253 struct dentry *real, bool is_upper, bool set);
254int ovl_verify_index(struct ovl_fs *ofs, struct dentry *index); 254int ovl_verify_index(struct ovl_fs *ofs, struct dentry *index);
255int ovl_get_index_name(struct dentry *origin, struct qstr *name); 255int ovl_get_index_name(struct dentry *origin, struct qstr *name);
256int ovl_path_next(int idx, struct dentry *dentry, struct path *path); 256int ovl_path_next(int idx, struct dentry *dentry, struct path *path);
@@ -258,6 +258,12 @@ struct dentry *ovl_lookup(struct inode *dir, struct dentry *dentry,
258 unsigned int flags); 258 unsigned int flags);
259bool ovl_lower_positive(struct dentry *dentry); 259bool ovl_lower_positive(struct dentry *dentry);
260 260
261static inline int ovl_verify_origin(struct dentry *upper,
262 struct dentry *origin, bool set)
263{
264 return ovl_verify_set_fh(upper, OVL_XATTR_ORIGIN, origin, false, set);
265}
266
261/* readdir.c */ 267/* readdir.c */
262extern const struct file_operations ovl_dir_operations; 268extern const struct file_operations ovl_dir_operations;
263int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list); 269int ovl_check_empty_dir(struct dentry *dentry, struct list_head *list);
@@ -320,6 +326,6 @@ int ovl_copy_up(struct dentry *dentry);
320int ovl_copy_up_flags(struct dentry *dentry, int flags); 326int ovl_copy_up_flags(struct dentry *dentry, int flags);
321int ovl_copy_xattr(struct dentry *old, struct dentry *new); 327int ovl_copy_xattr(struct dentry *old, struct dentry *new);
322int ovl_set_attr(struct dentry *upper, struct kstat *stat); 328int ovl_set_attr(struct dentry *upper, struct kstat *stat);
323struct ovl_fh *ovl_encode_fh(struct dentry *lower, bool is_upper); 329struct ovl_fh *ovl_encode_fh(struct dentry *real, bool is_upper);
324int ovl_set_origin(struct dentry *dentry, struct dentry *lower, 330int ovl_set_origin(struct dentry *dentry, struct dentry *lower,
325 struct dentry *upper); 331 struct dentry *upper);