Skip to content

Commit

Permalink
fuse: fix argument type in fuse_get_user_pages()
Browse files Browse the repository at this point in the history
Fix the following warning:

fs/fuse/file.c: In function 'fuse_direct_io':
fs/fuse/file.c:1002: warning: passing argument 3 of 'fuse_get_user_pages' from incompatible pointer type

This was introduced by commit f4975c6 "fuse: allow kernel to access
"direct_io" files".

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
  • Loading branch information
Miklos Szeredi committed Apr 9, 2009
1 parent f4efdd6 commit ce60a2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,9 +938,9 @@ static void fuse_release_user_pages(struct fuse_req *req, int write)
}

static int fuse_get_user_pages(struct fuse_req *req, const char __user *buf,
unsigned *nbytesp, int write)
size_t *nbytesp, int write)
{
unsigned nbytes = *nbytesp;
size_t nbytes = *nbytesp;
unsigned long user_addr = (unsigned long) buf;
unsigned offset = user_addr & ~PAGE_MASK;
int npages;
Expand All @@ -955,7 +955,7 @@ static int fuse_get_user_pages(struct fuse_req *req, const char __user *buf,
return 0;
}

nbytes = min(nbytes, (unsigned) FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT);
nbytes = min_t(size_t, nbytes, FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT);
npages = (nbytes + offset + PAGE_SIZE - 1) >> PAGE_SHIFT;
npages = clamp(npages, 1, FUSE_MAX_PAGES_PER_REQ);
down_read(&current->mm->mmap_sem);
Expand Down

0 comments on commit ce60a2f

Please sign in to comment.