mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
fuse: move fuse_release_user_pages() up
fuse_release_user_pages() will be indirectly used by fuse_send_read/write in future patches. Signed-off-by: Maxim Patlasov <mpatlasov@parallels.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
This commit is contained in:
parent
3c18ef8117
commit
187c5c3633
1 changed files with 12 additions and 12 deletions
|
@ -494,6 +494,18 @@ void fuse_read_fill(struct fuse_req *req, struct file *file, loff_t pos,
|
|||
req->out.args[0].size = count;
|
||||
}
|
||||
|
||||
static void fuse_release_user_pages(struct fuse_req *req, int write)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < req->num_pages; i++) {
|
||||
struct page *page = req->pages[i];
|
||||
if (write)
|
||||
set_page_dirty_lock(page);
|
||||
put_page(page);
|
||||
}
|
||||
}
|
||||
|
||||
static size_t fuse_send_read(struct fuse_req *req, struct file *file,
|
||||
loff_t pos, size_t count, fl_owner_t owner)
|
||||
{
|
||||
|
@ -1046,18 +1058,6 @@ static ssize_t fuse_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
|
|||
return written ? written : err;
|
||||
}
|
||||
|
||||
static void fuse_release_user_pages(struct fuse_req *req, int write)
|
||||
{
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < req->num_pages; i++) {
|
||||
struct page *page = req->pages[i];
|
||||
if (write)
|
||||
set_page_dirty_lock(page);
|
||||
put_page(page);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void fuse_page_descs_length_init(struct fuse_req *req,
|
||||
unsigned index, unsigned nr_pages)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue