diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-17 11:19:44 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 20:47:54 -0400 |
commit | b85fd6bdc99da917f5ae0f90f0c2d86ef9a766aa (patch) | |
tree | 234aae960810ead4ad2811a31b0898afce7b46e1 /fs | |
parent | 2def9e4ec75e6771def66a07960dd516e119ab4c (diff) |
don't open-code parent_ino() in assorted ->readdir()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/dir.c | 2 | ||||
-rw-r--r-- | fs/cifs/readdir.c | 2 | ||||
-rw-r--r-- | fs/coda/dir.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index b6d436f3c1ae..e8477dc51b45 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -252,7 +252,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
252 | off = 1; | 252 | off = 1; |
253 | } | 253 | } |
254 | if (filp->f_pos == 1) { | 254 | 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); |
256 | dout("readdir off 1 -> '..'\n"); | 256 | dout("readdir off 1 -> '..'\n"); |
257 | if (filldir(dirent, "..", 2, ceph_make_fpos(0, 1), | 257 | if (filldir(dirent, "..", 2, ceph_make_fpos(0, 1), |
258 | ceph_translate_ino(inode->i_sb, ino), | 258 | ceph_translate_ino(inode->i_sb, ino), |
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 6751e745bbc6..965a3af186a1 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
@@ -796,7 +796,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) | |||
796 | file->f_pos++; | 796 | file->f_pos++; |
797 | case 1: | 797 | case 1: |
798 | if (filldir(direntry, "..", 2, file->f_pos, | 798 | 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) { |
800 | cERROR(1, "Filldir for parent dir failed"); | 800 | cERROR(1, "Filldir for parent dir failed"); |
801 | rc = -ENOMEM; | 801 | rc = -ENOMEM; |
802 | break; | 802 | break; |
diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 9d52897c1b6d..0239433f50cb 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c | |||
@@ -473,7 +473,7 @@ static int coda_venus_readdir(struct file *coda_file, void *buf, | |||
473 | coda_file->f_pos++; | 473 | coda_file->f_pos++; |
474 | } | 474 | } |
475 | if (coda_file->f_pos == 1) { | 475 | 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); |
477 | if (ret < 0) | 477 | if (ret < 0) |
478 | goto out; | 478 | goto out; |
479 | result++; | 479 | result++; |