Skip to content

Commit b85fd6b

Browse files
author
Al Viro
committed
don't open-code parent_ino() in assorted ->readdir()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 2def9e4 commit b85fd6b

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

‎fs/ceph/dir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
252252
off = 1;
253253
}
254254
if (filp->f_pos == 1) {
255-
ino_t ino = filp->f_dentry->d_parent->d_inode->i_ino;
255+
ino_t ino = parent_ino(filp->f_dentry);
256256
dout("readdir off 1 -> '..'\n");
257257
if (filldir(dirent, "..", 2, ceph_make_fpos(0, 1),
258258
ceph_translate_ino(inode->i_sb, ino),

‎fs/cifs/readdir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
796796
file->f_pos++;
797797
case 1:
798798
if (filldir(direntry, "..", 2, file->f_pos,
799-
file->f_path.dentry->d_parent->d_inode->i_ino, DT_DIR) < 0) {
799+
parent_ino(file->f_path.dentry), DT_DIR) < 0) {
800800
cERROR(1, "Filldir for parent dir failed");
801801
rc = -ENOMEM;
802802
break;

‎fs/coda/dir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ static int coda_venus_readdir(struct file *coda_file, void *buf,
473473
coda_file->f_pos++;
474474
}
475475
if (coda_file->f_pos == 1) {
476-
ret = filldir(buf, "..", 2, 1, de->d_parent->d_inode->i_ino, DT_DIR);
476+
ret = filldir(buf, "..", 2, 1, parent_ino(de), DT_DIR);
477477
if (ret < 0)
478478
goto out;
479479
result++;

0 commit comments

Comments
 (0)