Skip to content

Commit 181b69d

Browse files
committed
Merge tag 'pull-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc vfs pile from Al Viro. Random minor cleanups. * tag 'pull-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs: Fix description of vfs_tmpfile() sysv: switch to put_and_unmap_page() fs/sysv: Don't round down address for kunmap_flush_on_unmap()
2 parents 11b3221 + 73bb5a9 commit 181b69d

4 files changed

Lines changed: 17 additions & 24 deletions

File tree

fs/namei.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3574,9 +3574,9 @@ static int do_open(struct nameidata *nd,
35743574
/**
35753575
* vfs_tmpfile - create tmpfile
35763576
* @idmap: idmap of the mount the inode was found from
3577-
* @dentry: pointer to dentry of the base directory
3577+
* @parentpath: pointer to the path of the base directory
3578+
* @file: file descriptor of the new tmpfile
35783579
* @mode: mode of the new tmpfile
3579-
* @open_flag: flags
35803580
*
35813581
* Create a temporary file.
35823582
*

fs/sysv/dir.c

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ const struct file_operations sysv_dir_operations = {
2828
.fsync = generic_file_fsync,
2929
};
3030

31-
inline void dir_put_page(struct page *page, void *page_addr)
32-
{
33-
kunmap_local((void *)((unsigned long)page_addr & PAGE_MASK));
34-
put_page(page);
35-
}
36-
3731
static void dir_commit_chunk(struct page *page, loff_t pos, unsigned len)
3832
{
3933
struct address_space *mapping = page->mapping;
@@ -58,7 +52,7 @@ static int sysv_handle_dirsync(struct inode *dir)
5852
}
5953

6054
/*
61-
* Calls to dir_get_page()/dir_put_page() must be nested according to the
55+
* Calls to dir_get_page()/put_and_unmap_page() must be nested according to the
6256
* rules documented in mm/highmem.rst.
6357
*
6458
* NOTE: sysv_find_entry() and sysv_dotdot() act as calls to dir_get_page()
@@ -109,11 +103,11 @@ static int sysv_readdir(struct file *file, struct dir_context *ctx)
109103
if (!dir_emit(ctx, name, strnlen(name,SYSV_NAMELEN),
110104
fs16_to_cpu(SYSV_SB(sb), de->inode),
111105
DT_UNKNOWN)) {
112-
dir_put_page(page, kaddr);
106+
put_and_unmap_page(page, kaddr);
113107
return 0;
114108
}
115109
}
116-
dir_put_page(page, kaddr);
110+
put_and_unmap_page(page, kaddr);
117111
}
118112
return 0;
119113
}
@@ -137,7 +131,7 @@ static inline int namecompare(int len, int maxlen,
137131
* itself (as a parameter - res_dir). It does NOT read the inode of the
138132
* entry - you'll have to do that yourself if you want to.
139133
*
140-
* On Success dir_put_page() should be called on *res_page.
134+
* On Success put_and_unmap_page() should be called on *res_page.
141135
*
142136
* sysv_find_entry() acts as a call to dir_get_page() and must be treated
143137
* accordingly for nesting purposes.
@@ -172,7 +166,7 @@ struct sysv_dir_entry *sysv_find_entry(struct dentry *dentry, struct page **res_
172166
name, de->name))
173167
goto found;
174168
}
175-
dir_put_page(page, kaddr);
169+
put_and_unmap_page(page, kaddr);
176170
}
177171

178172
if (++n >= npages)
@@ -215,7 +209,7 @@ int sysv_add_link(struct dentry *dentry, struct inode *inode)
215209
goto out_page;
216210
de++;
217211
}
218-
dir_put_page(page, kaddr);
212+
put_and_unmap_page(page, kaddr);
219213
}
220214
BUG();
221215
return -EINVAL;
@@ -234,7 +228,7 @@ int sysv_add_link(struct dentry *dentry, struct inode *inode)
234228
mark_inode_dirty(dir);
235229
err = sysv_handle_dirsync(dir);
236230
out_page:
237-
dir_put_page(page, kaddr);
231+
put_and_unmap_page(page, kaddr);
238232
return err;
239233
out_unlock:
240234
unlock_page(page);
@@ -327,12 +321,12 @@ int sysv_empty_dir(struct inode * inode)
327321
if (de->name[1] != '.' || de->name[2])
328322
goto not_empty;
329323
}
330-
dir_put_page(page, kaddr);
324+
put_and_unmap_page(page, kaddr);
331325
}
332326
return 1;
333327

334328
not_empty:
335-
dir_put_page(page, kaddr);
329+
put_and_unmap_page(page, kaddr);
336330
return 0;
337331
}
338332

@@ -358,7 +352,7 @@ int sysv_set_link(struct sysv_dir_entry *de, struct page *page,
358352
}
359353

360354
/*
361-
* Calls to dir_get_page()/dir_put_page() must be nested according to the
355+
* Calls to dir_get_page()/put_and_unmap_page() must be nested according to the
362356
* rules documented in mm/highmem.rst.
363357
*
364358
* sysv_dotdot() acts as a call to dir_get_page() and must be treated
@@ -382,7 +376,7 @@ ino_t sysv_inode_by_name(struct dentry *dentry)
382376

383377
if (de) {
384378
res = fs16_to_cpu(SYSV_SB(dentry->d_sb), de->inode);
385-
dir_put_page(page, de);
379+
put_and_unmap_page(page, de);
386380
}
387381
return res;
388382
}

fs/sysv/namei.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ static int sysv_unlink(struct inode * dir, struct dentry * dentry)
164164
inode->i_ctime = dir->i_ctime;
165165
inode_dec_link_count(inode);
166166
}
167-
dir_put_page(page, de);
167+
put_and_unmap_page(page, de);
168168
return err;
169169
}
170170

@@ -227,7 +227,7 @@ static int sysv_rename(struct mnt_idmap *idmap, struct inode *old_dir,
227227
if (!new_de)
228228
goto out_dir;
229229
err = sysv_set_link(new_de, new_page, old_inode);
230-
dir_put_page(new_page, new_de);
230+
put_and_unmap_page(new_page, new_de);
231231
if (err)
232232
goto out_dir;
233233
new_inode->i_ctime = current_time(new_inode);
@@ -256,9 +256,9 @@ static int sysv_rename(struct mnt_idmap *idmap, struct inode *old_dir,
256256

257257
out_dir:
258258
if (dir_de)
259-
dir_put_page(dir_page, dir_de);
259+
put_and_unmap_page(dir_page, dir_de);
260260
out_old:
261-
dir_put_page(old_page, old_de);
261+
put_and_unmap_page(old_page, old_de);
262262
out:
263263
return err;
264264
}

fs/sysv/sysv.h

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

149149

150150
/* dir.c */
151-
extern void dir_put_page(struct page *page, void *vaddr);
152151
extern struct sysv_dir_entry *sysv_find_entry(struct dentry *, struct page **);
153152
extern int sysv_add_link(struct dentry *, struct inode *);
154153
extern int sysv_delete_entry(struct sysv_dir_entry *, struct page *);

0 commit comments

Comments
 (0)