Skip to content

Commit 5b2cccd

Browse files
amir73ilMiklos Szeredi
authored andcommitted
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: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent 9f99e50 commit 5b2cccd

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

fs/overlayfs/copy_up.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ int ovl_set_attr(struct dentry *upperdentry, struct kstat *stat)
232232
return err;
233233
}
234234

235-
struct ovl_fh *ovl_encode_fh(struct dentry *real, bool is_upper)
235+
struct ovl_fh *ovl_encode_real_fh(struct dentry *real, bool is_upper)
236236
{
237237
struct ovl_fh *fh;
238238
int fh_type, fh_len, dwords;
@@ -300,7 +300,7 @@ int ovl_set_origin(struct dentry *dentry, struct dentry *lower,
300300
* up and a pure upper inode.
301301
*/
302302
if (ovl_can_decode_fh(lower->d_sb)) {
303-
fh = ovl_encode_fh(lower, false);
303+
fh = ovl_encode_real_fh(lower, false);
304304
if (IS_ERR(fh))
305305
return PTR_ERR(fh);
306306
}
@@ -321,7 +321,7 @@ static int ovl_set_upper_fh(struct dentry *upper, struct dentry *index)
321321
const struct ovl_fh *fh;
322322
int err;
323323

324-
fh = ovl_encode_fh(upper, true);
324+
fh = ovl_encode_real_fh(upper, true);
325325
if (IS_ERR(fh))
326326
return PTR_ERR(fh);
327327

fs/overlayfs/export.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,8 @@ static int ovl_d_to_fh(struct dentry *dentry, char *buf, int buflen)
228228
goto fail;
229229

230230
/* Encode an upper or lower file handle */
231-
fh = ovl_encode_fh(enc_lower ? ovl_dentry_lower(dentry) :
232-
ovl_dentry_upper(dentry), !enc_lower);
231+
fh = ovl_encode_real_fh(enc_lower ? ovl_dentry_lower(dentry) :
232+
ovl_dentry_upper(dentry), !enc_lower);
233233
err = PTR_ERR(fh);
234234
if (IS_ERR(fh))
235235
goto fail;
@@ -267,8 +267,8 @@ static int ovl_dentry_to_fh(struct dentry *dentry, u32 *fid, int *max_len)
267267
return OVL_FILEID;
268268
}
269269

270-
static int ovl_encode_inode_fh(struct inode *inode, u32 *fid, int *max_len,
271-
struct inode *parent)
270+
static int ovl_encode_fh(struct inode *inode, u32 *fid, int *max_len,
271+
struct inode *parent)
272272
{
273273
struct dentry *dentry;
274274
int type;
@@ -685,7 +685,7 @@ static struct dentry *ovl_upper_fh_to_d(struct super_block *sb,
685685
if (!ofs->upper_mnt)
686686
return ERR_PTR(-EACCES);
687687

688-
upper = ovl_decode_fh(fh, ofs->upper_mnt);
688+
upper = ovl_decode_real_fh(fh, ofs->upper_mnt);
689689
if (IS_ERR_OR_NULL(upper))
690690
return upper;
691691

@@ -829,7 +829,7 @@ static struct dentry *ovl_get_parent(struct dentry *dentry)
829829
}
830830

831831
const struct export_operations ovl_export_operations = {
832-
.encode_fh = ovl_encode_inode_fh,
832+
.encode_fh = ovl_encode_fh,
833833
.fh_to_dentry = ovl_fh_to_dentry,
834834
.fh_to_parent = ovl_fh_to_parent,
835835
.get_name = ovl_get_name,

fs/overlayfs/namei.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static struct ovl_fh *ovl_get_fh(struct dentry *dentry, const char *name)
180180
goto out;
181181
}
182182

183-
struct dentry *ovl_decode_fh(struct ovl_fh *fh, struct vfsmount *mnt)
183+
struct dentry *ovl_decode_real_fh(struct ovl_fh *fh, struct vfsmount *mnt)
184184
{
185185
struct dentry *real;
186186
int bytes;
@@ -326,7 +326,7 @@ int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh,
326326
int i;
327327

328328
for (i = 0; i < ofs->numlower; i++) {
329-
origin = ovl_decode_fh(fh, ofs->lower_layers[i].mnt);
329+
origin = ovl_decode_real_fh(fh, ofs->lower_layers[i].mnt);
330330
if (origin)
331331
break;
332332
}
@@ -424,7 +424,7 @@ int ovl_verify_set_fh(struct dentry *dentry, const char *name,
424424
struct ovl_fh *fh;
425425
int err;
426426

427-
fh = ovl_encode_fh(real, is_upper);
427+
fh = ovl_encode_real_fh(real, is_upper);
428428
err = PTR_ERR(fh);
429429
if (IS_ERR(fh))
430430
goto fail;
@@ -460,7 +460,7 @@ struct dentry *ovl_index_upper(struct ovl_fs *ofs, struct dentry *index)
460460
if (IS_ERR_OR_NULL(fh))
461461
return ERR_CAST(fh);
462462

463-
upper = ovl_decode_fh(fh, ofs->upper_mnt);
463+
upper = ovl_decode_real_fh(fh, ofs->upper_mnt);
464464
kfree(fh);
465465

466466
if (IS_ERR_OR_NULL(upper))
@@ -628,7 +628,7 @@ int ovl_get_index_name(struct dentry *origin, struct qstr *name)
628628
struct ovl_fh *fh;
629629
int err;
630630

631-
fh = ovl_encode_fh(origin, false);
631+
fh = ovl_encode_real_fh(origin, false);
632632
if (IS_ERR(fh))
633633
return PTR_ERR(fh);
634634

fs/overlayfs/overlayfs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static inline bool ovl_is_impuredir(struct dentry *dentry)
266266

267267
/* namei.c */
268268
int ovl_check_fh_len(struct ovl_fh *fh, int fh_len);
269-
struct dentry *ovl_decode_fh(struct ovl_fh *fh, struct vfsmount *mnt);
269+
struct dentry *ovl_decode_real_fh(struct ovl_fh *fh, struct vfsmount *mnt);
270270
int ovl_check_origin_fh(struct ovl_fs *ofs, struct ovl_fh *fh,
271271
struct dentry *upperdentry, struct ovl_path **stackp);
272272
int ovl_verify_set_fh(struct dentry *dentry, const char *name,
@@ -361,7 +361,7 @@ int ovl_copy_up(struct dentry *dentry);
361361
int ovl_copy_up_flags(struct dentry *dentry, int flags);
362362
int ovl_copy_xattr(struct dentry *old, struct dentry *new);
363363
int ovl_set_attr(struct dentry *upper, struct kstat *stat);
364-
struct ovl_fh *ovl_encode_fh(struct dentry *real, bool is_upper);
364+
struct ovl_fh *ovl_encode_real_fh(struct dentry *real, bool is_upper);
365365
int ovl_set_origin(struct dentry *dentry, struct dentry *lower,
366366
struct dentry *upper);
367367

0 commit comments

Comments
 (0)