diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-04-20 19:52:15 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-05-02 19:49:32 -0400 |
commit | 4e82901cd6d1af21ae232ae835c36d8230c809e8 (patch) | |
tree | 540414489118912197e5a5bf2624adbedec899c4 /fs/libfs.c | |
parent | 3125d2650cae97d8f313ab696cd0ed66916e767a (diff) |
dcache_{readdir,dir_lseek}() users: switch to ->iterate_shared
no need to lock directory in dcache_dir_lseek(), while we are
at it - per-struct file exclusion is enough.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/libfs.c')
-rw-r--r-- | fs/libfs.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/libfs.c b/fs/libfs.c index 43dd28031a1a..dd8a074482ac 100644 --- a/fs/libfs.c +++ b/fs/libfs.c | |||
@@ -89,7 +89,6 @@ EXPORT_SYMBOL(dcache_dir_close); | |||
89 | loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence) | 89 | loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence) |
90 | { | 90 | { |
91 | struct dentry *dentry = file->f_path.dentry; | 91 | struct dentry *dentry = file->f_path.dentry; |
92 | inode_lock(d_inode(dentry)); | ||
93 | switch (whence) { | 92 | switch (whence) { |
94 | case 1: | 93 | case 1: |
95 | offset += file->f_pos; | 94 | offset += file->f_pos; |
@@ -97,7 +96,6 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence) | |||
97 | if (offset >= 0) | 96 | if (offset >= 0) |
98 | break; | 97 | break; |
99 | default: | 98 | default: |
100 | inode_unlock(d_inode(dentry)); | ||
101 | return -EINVAL; | 99 | return -EINVAL; |
102 | } | 100 | } |
103 | if (offset != file->f_pos) { | 101 | if (offset != file->f_pos) { |
@@ -124,7 +122,6 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence) | |||
124 | spin_unlock(&dentry->d_lock); | 122 | spin_unlock(&dentry->d_lock); |
125 | } | 123 | } |
126 | } | 124 | } |
127 | inode_unlock(d_inode(dentry)); | ||
128 | return offset; | 125 | return offset; |
129 | } | 126 | } |
130 | EXPORT_SYMBOL(dcache_dir_lseek); | 127 | EXPORT_SYMBOL(dcache_dir_lseek); |
@@ -190,7 +187,7 @@ const struct file_operations simple_dir_operations = { | |||
190 | .release = dcache_dir_close, | 187 | .release = dcache_dir_close, |
191 | .llseek = dcache_dir_lseek, | 188 | .llseek = dcache_dir_lseek, |
192 | .read = generic_read_dir, | 189 | .read = generic_read_dir, |
193 | .iterate = dcache_readdir, | 190 | .iterate_shared = dcache_readdir, |
194 | .fsync = noop_fsync, | 191 | .fsync = noop_fsync, |
195 | }; | 192 | }; |
196 | EXPORT_SYMBOL(simple_dir_operations); | 193 | EXPORT_SYMBOL(simple_dir_operations); |