| @@ -439,7 +439,7 @@ static unsigned int vfs_dent_type(uint8_t type) · 438 unmodified lines |
| 439 | 439 | */ |
| 440 | 440 | static int ubifs_readdir(struct file *file, struct dir_context *ctx) |
| 441 | 441 | { |
| 442 | | − int err; |
| 442 | + int err = 0; |
| 443 | 443 | struct qstr nm; |
| 444 | 444 | union ubifs_key key; |
| 445 | 445 | struct ubifs_dent_node *dent; |
| @@ -541,14 +541,12 @@ out: · 95 unmodified lines |
| 541 | 541 | kfree(file->private_data); |
| 542 | 542 | file->private_data = NULL; |
| 543 | 543 | |
| 544 | | − if (err != -ENOENT) { |
| 544 | + if (err != -ENOENT) |
| 545 | 545 | ubifs_err(c, "cannot find next direntry, error %d", err); |
| 546 | | − return err; |
| 547 | | − } |
| 548 | 546 | |
| 549 | 547 | /* 2 is a special value indicating that there are no more direntries */ |
| 550 | 548 | ctx->pos = 2; |
| 551 | | − return 0; |
| 549 | + return err; |
| 552 | 550 | } |
| 553 | 551 | |
| 554 | 552 | /* Free saved readdir() state when the directory is closed */ |
| @@ -1060,9 +1058,9 @@ static void unlock_4_inodes(struct inode *inode1, struct inode *inode2, · 505 unmodified lines |
| 1060 | 1058 | mutex_unlock(&ubifs_inode(inode1)->ui_mutex); |
| 1061 | 1059 | } |
| 1062 | 1060 | |
| 1063 | | −static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry, |
| 1064 | | − struct inode *new_dir, struct dentry *new_dentry, |
| 1065 | | − unsigned int flags) |
| 1061 | +static int do_rename(struct inode *old_dir, struct dentry *old_dentry, |
| 1062 | + struct inode *new_dir, struct dentry *new_dentry, |
| 1063 | + unsigned int flags) |
| 1066 | 1064 | { |
| 1067 | 1065 | struct ubifs_info *c = old_dir->i_sb->s_fs_info; |
| 1068 | 1066 | struct inode *old_inode = d_inode(old_dentry); |
| @@ -1323,7 +1321,7 @@ static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry, · 254 unmodified lines |
| 1323 | 1321 | return err; |
| 1324 | 1322 | } |
| 1325 | 1323 | |
| 1326 | | −static int ubifs_rename2(struct inode *old_dir, struct dentry *old_dentry, |
| 1324 | +static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry, |
| 1327 | 1325 | struct inode *new_dir, struct dentry *new_dentry, |
| 1328 | 1326 | unsigned int flags) |
| 1329 | 1327 | { |
| @@ -1336,7 +1334,7 @@ static int ubifs_rename2(struct inode *old_dir, struct dentry *old_dentry, · 6 unmodified lines |
| 1336 | 1334 | if (flags & RENAME_EXCHANGE) |
| 1337 | 1335 | return ubifs_xrename(old_dir, old_dentry, new_dir, new_dentry); |
| 1338 | 1336 | |
| 1339 | | − return ubifs_rename(old_dir, old_dentry, new_dir, new_dentry, flags); |
| 1337 | + return do_rename(old_dir, old_dentry, new_dir, new_dentry, flags); |
| 1340 | 1338 | } |
| 1341 | 1339 | |
| 1342 | 1340 | int ubifs_getattr(struct vfsmount *mnt, struct dentry *dentry, |
| @@ -1387,7 +1385,7 @@ const struct inode_operations ubifs_dir_inode_operations = { · 44 unmodified lines |
| 1387 | 1385 | .mkdir = ubifs_mkdir, |
| 1388 | 1386 | .rmdir = ubifs_rmdir, |
| 1389 | 1387 | .mknod = ubifs_mknod, |
| 1390 | | − .rename = ubifs_rename2, |
| 1388 | + .rename = ubifs_rename, |
| 1391 | 1389 | .setattr = ubifs_setattr, |
| 1392 | 1390 | .getattr = ubifs_getattr, |
| 1393 | 1391 | .listxattr = ubifs_listxattr, |