don't open-code parent_ino() in assorted ->readdir()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 17 Jul 2011 15:19:44 +0000 (11:19 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 21 Jul 2011 00:47:54 +0000 (20:47 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/ceph/dir.c
fs/cifs/readdir.c
fs/coda/dir.c

index b6d436f3c1ae01e1cd457cab14131b2d50e1922e..e8477dc51b45fe6bcebfcfd146f6e87ff76ed14d 100644 (file)
@@ -252,7 +252,7 @@ static int ceph_readdir(struct file *filp, void *dirent, filldir_t filldir)
                off = 1;
        }
        if (filp->f_pos == 1) {
-               ino_t ino = filp->f_dentry->d_parent->d_inode->i_ino;
+               ino_t ino = parent_ino(filp->f_dentry);
                dout("readdir off 1 -> '..'\n");
                if (filldir(dirent, "..", 2, ceph_make_fpos(0, 1),
                            ceph_translate_ino(inode->i_sb, ino),
index 6751e745bbc6a5611081a462c36c5159cbf9ee05..965a3af186a19914a3a55ecce94ce1be32f3dbe2 100644 (file)
@@ -796,7 +796,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
                file->f_pos++;
        case 1:
                if (filldir(direntry, "..", 2, file->f_pos,
-                    file->f_path.dentry->d_parent->d_inode->i_ino, DT_DIR) < 0) {
+                    parent_ino(file->f_path.dentry), DT_DIR) < 0) {
                        cERROR(1, "Filldir for parent dir failed");
                        rc = -ENOMEM;
                        break;
index 9d52897c1b6d86aca8bd2f620e4283f1a19a3a44..0239433f50cbe25749896439fc124131afcdf164 100644 (file)
@@ -473,7 +473,7 @@ static int coda_venus_readdir(struct file *coda_file, void *buf,
                coda_file->f_pos++;
        }
        if (coda_file->f_pos == 1) {
-               ret = filldir(buf, "..", 2, 1, de->d_parent->d_inode->i_ino, DT_DIR);
+               ret = filldir(buf, "..", 2, 1, parent_ino(de), DT_DIR);
                if (ret < 0)
                        goto out;
                result++;