diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2010-12-07 14:16:56 -0500 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2010-12-07 14:16:56 -0500 |
commit | 8ac835056ca39b242d98332f46e4d65428a8b7db (patch) | |
tree | c35c2644c9bfce1dcf1b5298b00c03bd1c8d2f9a /fs/fuse | |
parent | 7572777eef78ebdee1ecb7c258c0ef94d35bad16 (diff) |
fuse: ioctl cleanup
Get rid of unnecessary page_address()-es.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
CC: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/file.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 8b984a2cebb..ca3b6bbb379 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -1740,7 +1740,7 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg, | |||
1740 | struct fuse_ioctl_out outarg; | 1740 | struct fuse_ioctl_out outarg; |
1741 | struct fuse_req *req = NULL; | 1741 | struct fuse_req *req = NULL; |
1742 | struct page **pages = NULL; | 1742 | struct page **pages = NULL; |
1743 | struct page *iov_page = NULL; | 1743 | struct iovec *iov_page = NULL; |
1744 | struct iovec *in_iov = NULL, *out_iov = NULL; | 1744 | struct iovec *in_iov = NULL, *out_iov = NULL; |
1745 | unsigned int in_iovs = 0, out_iovs = 0, num_pages = 0, max_pages; | 1745 | unsigned int in_iovs = 0, out_iovs = 0, num_pages = 0, max_pages; |
1746 | size_t in_size, out_size, transferred; | 1746 | size_t in_size, out_size, transferred; |
@@ -1751,7 +1751,7 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg, | |||
1751 | 1751 | ||
1752 | err = -ENOMEM; | 1752 | err = -ENOMEM; |
1753 | pages = kzalloc(sizeof(pages[0]) * FUSE_MAX_PAGES_PER_REQ, GFP_KERNEL); | 1753 | pages = kzalloc(sizeof(pages[0]) * FUSE_MAX_PAGES_PER_REQ, GFP_KERNEL); |
1754 | iov_page = alloc_page(GFP_KERNEL); | 1754 | iov_page = (struct iovec *) __get_free_page(GFP_KERNEL); |
1755 | if (!pages || !iov_page) | 1755 | if (!pages || !iov_page) |
1756 | goto out; | 1756 | goto out; |
1757 | 1757 | ||
@@ -1760,7 +1760,7 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg, | |||
1760 | * RETRY from server is not allowed. | 1760 | * RETRY from server is not allowed. |
1761 | */ | 1761 | */ |
1762 | if (!(flags & FUSE_IOCTL_UNRESTRICTED)) { | 1762 | if (!(flags & FUSE_IOCTL_UNRESTRICTED)) { |
1763 | struct iovec *iov = page_address(iov_page); | 1763 | struct iovec *iov = iov_page; |
1764 | 1764 | ||
1765 | iov->iov_base = (void __user *)arg; | 1765 | iov->iov_base = (void __user *)arg; |
1766 | iov->iov_len = _IOC_SIZE(cmd); | 1766 | iov->iov_len = _IOC_SIZE(cmd); |
@@ -1841,7 +1841,7 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg, | |||
1841 | 1841 | ||
1842 | /* did it ask for retry? */ | 1842 | /* did it ask for retry? */ |
1843 | if (outarg.flags & FUSE_IOCTL_RETRY) { | 1843 | if (outarg.flags & FUSE_IOCTL_RETRY) { |
1844 | char *vaddr; | 1844 | void *vaddr; |
1845 | 1845 | ||
1846 | /* no retry if in restricted mode */ | 1846 | /* no retry if in restricted mode */ |
1847 | err = -EIO; | 1847 | err = -EIO; |
@@ -1862,14 +1862,14 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg, | |||
1862 | goto out; | 1862 | goto out; |
1863 | 1863 | ||
1864 | vaddr = kmap_atomic(pages[0], KM_USER0); | 1864 | vaddr = kmap_atomic(pages[0], KM_USER0); |
1865 | err = fuse_copy_ioctl_iovec(page_address(iov_page), vaddr, | 1865 | err = fuse_copy_ioctl_iovec(iov_page, vaddr, |
1866 | transferred, in_iovs + out_iovs, | 1866 | transferred, in_iovs + out_iovs, |
1867 | (flags & FUSE_IOCTL_COMPAT) != 0); | 1867 | (flags & FUSE_IOCTL_COMPAT) != 0); |
1868 | kunmap_atomic(vaddr, KM_USER0); | 1868 | kunmap_atomic(vaddr, KM_USER0); |
1869 | if (err) | 1869 | if (err) |
1870 | goto out; | 1870 | goto out; |
1871 | 1871 | ||
1872 | in_iov = page_address(iov_page); | 1872 | in_iov = iov_page; |
1873 | out_iov = in_iov + in_iovs; | 1873 | out_iov = in_iov + in_iovs; |
1874 | 1874 | ||
1875 | err = fuse_verify_ioctl_iov(in_iov, in_iovs); | 1875 | err = fuse_verify_ioctl_iov(in_iov, in_iovs); |
@@ -1891,8 +1891,7 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg, | |||
1891 | out: | 1891 | out: |
1892 | if (req) | 1892 | if (req) |
1893 | fuse_put_request(fc, req); | 1893 | fuse_put_request(fc, req); |
1894 | if (iov_page) | 1894 | free_page((unsigned long) iov_page); |
1895 | __free_page(iov_page); | ||
1896 | while (num_pages) | 1895 | while (num_pages) |
1897 | __free_page(pages[--num_pages]); | 1896 | __free_page(pages[--num_pages]); |
1898 | kfree(pages); | 1897 | kfree(pages); |