Skip to content

Commit c26ddc4

Browse files
xp4ns3Al Viro
authored andcommitted
fs/sysv: Use dir_put_page() in sysv_rename()
Use the dir_put_page() helper in sysv_rename() instead of open-coding two kunmap() + put_page(). Cc: Al Viro <[email protected]> Suggested-by: Ira Weiny <[email protected]> Signed-off-by: Fabio M. De Francesco <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 8dd6c7b commit c26ddc4

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

fs/sysv/dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const struct file_operations sysv_dir_operations = {
2828
.fsync = generic_file_fsync,
2929
};
3030

31-
static inline void dir_put_page(struct page *page)
31+
inline void dir_put_page(struct page *page)
3232
{
3333
kunmap(page);
3434
put_page(page);

fs/sysv/namei.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,10 @@ static int sysv_rename(struct user_namespace *mnt_userns, struct inode *old_dir,
250250
return 0;
251251

252252
out_dir:
253-
if (dir_de) {
254-
kunmap(dir_page);
255-
put_page(dir_page);
256-
}
253+
if (dir_de)
254+
dir_put_page(dir_page);
257255
out_old:
258-
kunmap(old_page);
259-
put_page(old_page);
256+
dir_put_page(old_page);
260257
out:
261258
return err;
262259
}

fs/sysv/sysv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ extern void sysv_destroy_icache(void);
148148

149149

150150
/* dir.c */
151+
extern void dir_put_page(struct page *page);
151152
extern struct sysv_dir_entry *sysv_find_entry(struct dentry *, struct page **);
152153
extern int sysv_add_link(struct dentry *, struct inode *);
153154
extern int sysv_delete_entry(struct sysv_dir_entry *, struct page *);

0 commit comments

Comments
 (0)