aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat/namei_msdos.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-07-08 21:20:11 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-07-20 01:44:26 -0400
commita9049376ee05bf966bfe2b081b5071326856890a (patch)
treeefb3cbfc7760537f201bb28dacbb0d39ec39f04c /fs/fat/namei_msdos.c
parent0c1aa9a952c3608eb17bf990466f1491d1ee8b6c (diff)
make d_splice_alias(ERR_PTR(err), dentry) = ERR_PTR(err)
... and simplify the living hell out of callers Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/fat/namei_msdos.c')
-rw-r--r--fs/fat/namei_msdos.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/fs/fat/namei_msdos.c b/fs/fat/namei_msdos.c
index 3b222dafd15b..66e83b845455 100644
--- a/fs/fat/namei_msdos.c
+++ b/fs/fat/namei_msdos.c
@@ -209,29 +209,20 @@ static struct dentry *msdos_lookup(struct inode *dir, struct dentry *dentry,
209 int err; 209 int err;
210 210
211 lock_super(sb); 211 lock_super(sb);
212
213 err = msdos_find(dir, dentry->d_name.name, dentry->d_name.len, &sinfo); 212 err = msdos_find(dir, dentry->d_name.name, dentry->d_name.len, &sinfo);
214 if (err) { 213 switch (err) {
215 if (err == -ENOENT) { 214 case -ENOENT:
216 inode = NULL; 215 inode = NULL;
217 goto out; 216 break;
218 } 217 case 0:
219 goto error; 218 inode = fat_build_inode(sb, sinfo.de, sinfo.i_pos);
220 } 219 brelse(sinfo.bh);
221 220 break;
222 inode = fat_build_inode(sb, sinfo.de, sinfo.i_pos); 221 default:
223 brelse(sinfo.bh); 222 inode = ERR_PTR(err);
224 if (IS_ERR(inode)) {
225 err = PTR_ERR(inode);
226 goto error;
227 } 223 }
228out:
229 unlock_super(sb); 224 unlock_super(sb);
230 return d_splice_alias(inode, dentry); 225 return d_splice_alias(inode, dentry);
231
232error:
233 unlock_super(sb);
234 return ERR_PTR(err);
235} 226}
236 227
237/***** Creates a directory entry (name is already formatted). */ 228/***** Creates a directory entry (name is already formatted). */