diff options
author | Harvey Harrison <harvey.harrison@gmail.com> | 2008-05-01 07:35:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-01 11:04:02 -0400 |
commit | bd7309677c937bf23296f6c81027123c84c5cc5c (patch) | |
tree | b5dfaf691425424c5f4a1ed23c1e019a111808fa /fs/fuse | |
parent | 3dfcf9c4bf1fda4aa75861bcf6c50607dd322fe5 (diff) |
fuse: use clamp() rather than nested min/max
clamp() exists for this use.
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 9ced35b00686..f28cf8b46f80 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -934,7 +934,7 @@ static int fuse_get_user_pages(struct fuse_req *req, const char __user *buf, | |||
934 | 934 | ||
935 | nbytes = min(nbytes, (unsigned) FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT); | 935 | nbytes = min(nbytes, (unsigned) FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT); |
936 | npages = (nbytes + offset + PAGE_SIZE - 1) >> PAGE_SHIFT; | 936 | npages = (nbytes + offset + PAGE_SIZE - 1) >> PAGE_SHIFT; |
937 | npages = min(max(npages, 1), FUSE_MAX_PAGES_PER_REQ); | 937 | npages = clamp(npages, 1, FUSE_MAX_PAGES_PER_REQ); |
938 | down_read(¤t->mm->mmap_sem); | 938 | down_read(¤t->mm->mmap_sem); |
939 | npages = get_user_pages(current, current->mm, user_addr, npages, write, | 939 | npages = get_user_pages(current, current->mm, user_addr, npages, write, |
940 | 0, req->pages, NULL); | 940 | 0, req->pages, NULL); |