Commit 5b2cccd3 authored by Amir Goldstein's avatar Amir Goldstein Committed by Miklos Szeredi

ovl: disambiguate ovl_encode_fh()

Rename ovl_encode_fh() to ovl_encode_real_fh() to differentiate from the
exportfs function ovl_encode_inode_fh() and change the latter to
ovl_encode_fh() to match the exportfs method name.

Rename ovl_decode_fh() to ovl_decode_real_fh() for consistency.
Signed-off-by: default avatarAmir Goldstein <amir73il@gmail.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 9f99e50d
...@@ -232,7 +232,7 @@ int ovl_set_attr(struct dentry *upperdentry, struct kstat *stat) ...@@ -232,7 +232,7 @@ int ovl_set_attr(struct dentry *upperdentry, struct kstat *stat)
return err; return err;
} }
struct ovl_fh *ovl_encode_fh(struct dentry *real, bool is_upper) struct ovl_fh *ovl_encode_real_fh(struct dentry *real, bool is_upper)
{ {
struct ovl_fh *fh; struct ovl_fh *fh;
int fh_type, fh_len, dwords; int fh_type, fh_len, dwords;
...@@ -300,7 +300,7 @@ int ovl_set_origin(struct dentry *dentry, struct dentry *lower, ...@@ -300,7 +300,7 @@ int ovl_set_origin(struct dentry *dentry, struct dentry *lower,
* up and a pure upper inode. * up and a pure upper inode.
*/ */
if (ovl_can_decode_fh(lower->d_sb)) { if (ovl_can_decode_fh(lower->d_sb)) {
fh = ovl_encode_fh(lower, false); fh = ovl_encode_real_fh(lower, false);
if (IS_ERR(fh)) if (IS_ERR(fh))
return PTR_ERR(fh); return PTR_ERR(fh);
} }
...@@ -321,7 +321,7 @@ static int ovl_set_upper_fh(struct dentry *upper, struct dentry *index) ...@@ -321,7 +321,7 @@ static int ovl_set_upper_fh(struct dentry *upper, struct dentry *index)
const struct ovl_fh *fh; const struct ovl_fh *fh;
int err; int err;
fh = ovl_encode_fh(upper, true); fh = ovl_encode_real_fh(upper, true);
if (IS_ERR(fh)) if (IS_ERR(fh))
return PTR_ERR(fh); return PTR_ERR(fh);
......
...@@ -228,8 +228,8 @@ static int ovl_d_to_fh(struct dentry *dentry, char *buf, int buflen) ...@@ -228,8 +228,8 @@ static int ovl_d_to_fh(struct dentry *dentry, char *buf, int buflen)
goto fail; goto fail;
/* Encode an upper or lower file handle */ /* Encode an upper or lower file handle */
fh = ovl_encode_fh(enc_lower ? ovl_dentry_lower(dentry) : fh = ovl_encode_real_fh(enc_lower ? ovl_dentry_lower(dentry) :
ovl_dentry_upper(dentry), !enc_lower); ovl_dentry_upper(dentry), !enc_lower);
err = PTR_ERR(fh); err = PTR_ERR(fh);
if (IS_ERR(fh)) if (IS_ERR(fh))
goto fail; goto fail;
...@@ -267,8 +267,8 @@ static int ovl_dentry_to_fh(struct dentry *dentry, u32 *fid, int *max_len) ...@@ -267,8 +267,8 @@ static int ovl_dentry_to_fh(struct dentry *dentry, u32 *fid, int *max_len)
return OVL_FILEID; return OVL_FILEID;
} }
static int ovl_encode_inode_fh(struct inode *inode, u32 *fid, int *max_len, static int ovl_encode_fh(struct inode *inode, u32 *fid, int *max_len,
struct inode *parent) struct inode *parent)
{ {
struct dentry *dentry; struct dentry *dentry;
int type; int type;
...@@ -685,7 +685,7 @@ static struct dentry *ovl_upper_fh_to_d(struct super_block *sb, ...@@ -685,7 +685,7 @@ static struct dentry *ovl_upper_fh_to_d(struct super_block *sb,
if (!ofs->upper_mnt) if (!ofs->upper_mnt)
return ERR_PTR(-EACCES); return ERR_PTR(-EACCES);
upper = ovl_decode_fh(fh, ofs->upper_mnt); upper = ovl_decode_real_fh(fh, ofs->upper_mnt);
if (IS_ERR_OR_NULL(upper)) if (IS_ERR_OR_NULL(upper))
return upper; return upper;
...@@ -829,7 +829,7 @@ static struct dentry *ovl_get_parent(struct dentry *dentry) ...@@ -829,7 +829,7 @@ static struct dentry *ovl_get_parent(struct dentry *dentry)
} }
const struct export_operations ovl_export_operations = { const struct export_operations ovl_export_operations = {
.encode_fh = ovl_encode_inode_fh, .encode_fh = ovl_encode_fh,
.fh_to_dentry = ovl_fh_to_dentry, .fh_to_dentry = ovl_fh_to_dentry,
.fh_to_parent = ovl_fh_to_parent, .fh_to_parent = ovl_fh_to_parent,
.get_name = ovl_get_name, .get_name = ovl_get_name,
......
...@@ -180,7 +180,7 @@ static struct ovl_fh *ovl_get_fh(struct dentry *dentry, const char *name) ...@@ -180,7 +180,7 @@ static struct ovl_fh *ovl_get_fh(struct dentry *dentry, const char *name)
goto out; goto out;
} }
struct dentry *ovl_decode_fh(struct ovl_fh *fh, struct vfsmount *mnt) struct dentry *ovl_decode_real_fh(struct ovl_fh *fh, struct vfsmount *mnt)
{ {
struct dentry *real; struct dentry *real;
int bytes; int bytes;
...@@ -326,7 +326,7 @@ int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, ...@@ -326,7 +326,7 @@ int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh,
int i; int i;
for (i = 0; i < ofs->numlower; i++) { for (i = 0; i < ofs->numlower; i++) {
origin = ovl_decode_fh(fh, ofs->lower_layers[i].mnt); origin = ovl_decode_real_fh(fh, ofs->lower_layers[i].mnt);
if (origin) if (origin)
break; break;
} }
...@@ -424,7 +424,7 @@ int ovl_verify_set_fh(struct dentry *dentry, const char *name, ...@@ -424,7 +424,7 @@ int ovl_verify_set_fh(struct dentry *dentry, const char *name,
struct ovl_fh *fh; struct ovl_fh *fh;
int err; int err;
fh = ovl_encode_fh(real, is_upper); fh = ovl_encode_real_fh(real, is_upper);
err = PTR_ERR(fh); err = PTR_ERR(fh);
if (IS_ERR(fh)) if (IS_ERR(fh))
goto fail; goto fail;
...@@ -460,7 +460,7 @@ struct dentry *ovl_index_upper(struct ovl_fs *ofs, struct dentry *index) ...@@ -460,7 +460,7 @@ struct dentry *ovl_index_upper(struct ovl_fs *ofs, struct dentry *index)
if (IS_ERR_OR_NULL(fh)) if (IS_ERR_OR_NULL(fh))
return ERR_CAST(fh); return ERR_CAST(fh);
upper = ovl_decode_fh(fh, ofs->upper_mnt); upper = ovl_decode_real_fh(fh, ofs->upper_mnt);
kfree(fh); kfree(fh);
if (IS_ERR_OR_NULL(upper)) if (IS_ERR_OR_NULL(upper))
...@@ -628,7 +628,7 @@ int ovl_get_index_name(struct dentry *origin, struct qstr *name) ...@@ -628,7 +628,7 @@ int ovl_get_index_name(struct dentry *origin, struct qstr *name)
struct ovl_fh *fh; struct ovl_fh *fh;
int err; int err;
fh = ovl_encode_fh(origin, false); fh = ovl_encode_real_fh(origin, false);
if (IS_ERR(fh)) if (IS_ERR(fh))
return PTR_ERR(fh); return PTR_ERR(fh);
......
...@@ -266,7 +266,7 @@ static inline bool ovl_is_impuredir(struct dentry *dentry) ...@@ -266,7 +266,7 @@ static inline bool ovl_is_impuredir(struct dentry *dentry)
/* namei.c */ /* namei.c */
int ovl_check_fh_len(struct ovl_fh *fh, int fh_len); int ovl_check_fh_len(struct ovl_fh *fh, int fh_len);
struct dentry *ovl_decode_fh(struct ovl_fh *fh, struct vfsmount *mnt); struct dentry *ovl_decode_real_fh(struct ovl_fh *fh, struct vfsmount *mnt);
int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh, int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh,
struct dentry *upperdentry, struct ovl_path **stackp); struct dentry *upperdentry, struct ovl_path **stackp);
int ovl_verify_set_fh(struct dentry *dentry, const char *name, int ovl_verify_set_fh(struct dentry *dentry, const char *name,
...@@ -361,7 +361,7 @@ int ovl_copy_up(struct dentry *dentry); ...@@ -361,7 +361,7 @@ int ovl_copy_up(struct dentry *dentry);
int ovl_copy_up_flags(struct dentry *dentry, int flags); int ovl_copy_up_flags(struct dentry *dentry, int flags);
int ovl_copy_xattr(struct dentry *old, struct dentry *new); int ovl_copy_xattr(struct dentry *old, struct dentry *new);
int ovl_set_attr(struct dentry *upper, struct kstat *stat); int ovl_set_attr(struct dentry *upper, struct kstat *stat);
struct ovl_fh *ovl_encode_fh(struct dentry *real, bool is_upper); struct ovl_fh *ovl_encode_real_fh(struct dentry *real, bool is_upper);
int ovl_set_origin(struct dentry *dentry, struct dentry *lower, int ovl_set_origin(struct dentry *dentry, struct dentry *lower,
struct dentry *upper); struct dentry *upper);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment