diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-05-17 22:45:29 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-29 04:56:50 -0400 |
commit | 99ce4169a9ff1c6ecdcccf01638eb6d76e5d84d1 (patch) | |
tree | 31a85dbeb321121af614605891202879e3b5e593 /fs/reiserfs | |
parent | 4acf381e1b6c01d6058d353191259c952bd6f3e7 (diff) |
reiserfs: is_privroot_deh() needs only directory inode, actually
... and that - only to get the superblock. Privroot is a directory
and we don't allow hardlinks to those...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r-- | fs/reiserfs/dir.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/reiserfs/dir.c b/fs/reiserfs/dir.c index cba70165e9c5..df25fff3714a 100644 --- a/fs/reiserfs/dir.c +++ b/fs/reiserfs/dir.c | |||
@@ -50,11 +50,10 @@ static int reiserfs_dir_fsync(struct file *filp, loff_t start, loff_t end, | |||
50 | 50 | ||
51 | #define store_ih(where,what) copy_item_head (where, what) | 51 | #define store_ih(where,what) copy_item_head (where, what) |
52 | 52 | ||
53 | static inline bool is_privroot_deh(struct dentry *dir, | 53 | static inline bool is_privroot_deh(struct inode *dir, struct reiserfs_de_head *deh) |
54 | struct reiserfs_de_head *deh) | ||
55 | { | 54 | { |
56 | struct dentry *privroot = REISERFS_SB(dir->d_sb)->priv_root; | 55 | struct dentry *privroot = REISERFS_SB(dir->i_sb)->priv_root; |
57 | return (dir == dir->d_parent && privroot->d_inode && | 56 | return (privroot->d_inode && |
58 | deh->deh_objectid == INODE_PKEY(privroot->d_inode)->k_objectid); | 57 | deh->deh_objectid == INODE_PKEY(privroot->d_inode)->k_objectid); |
59 | } | 58 | } |
60 | 59 | ||
@@ -153,7 +152,7 @@ int reiserfs_readdir_dentry(struct dentry *dentry, struct dir_context *ctx) | |||
153 | } | 152 | } |
154 | 153 | ||
155 | /* Ignore the .reiserfs_priv entry */ | 154 | /* Ignore the .reiserfs_priv entry */ |
156 | if (is_privroot_deh(dentry, deh)) | 155 | if (is_privroot_deh(inode, deh)) |
157 | continue; | 156 | continue; |
158 | 157 | ||
159 | ctx->pos = deh_offset(deh); | 158 | ctx->pos = deh_offset(deh); |