diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2012-11-10 10:55:56 -0500 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2013-01-24 10:21:28 -0500 |
commit | fb05f41f5f96f7423c53da4d87913fb44fd0565d (patch) | |
tree | d3cad72fea5e2b58b8bfa65aa3568e3617507234 /fs/fuse/file.c | |
parent | 5565a9d884327ac45d49041f1b846dac273e110c (diff) |
fuse: cleanup fuse_direct_io()
Fix the following sparse warnings:
fs/fuse/file.c:1216:43: warning: cast removes address space of expression
fs/fuse/file.c:1216:43: warning: incorrect type in initializer (different address spaces)
fs/fuse/file.c:1216:43: expected void [noderef] <asn:1>*iov_base
fs/fuse/file.c:1216:43: got void *<noident>
fs/fuse/file.c:1241:43: warning: cast removes address space of expression
fs/fuse/file.c:1241:43: warning: incorrect type in initializer (different address spaces)
fs/fuse/file.c:1241:43: expected void [noderef] <asn:1>*iov_base
fs/fuse/file.c:1241:43: got void *<noident>
fs/fuse/file.c:1267:43: warning: cast removes address space of expression
fs/fuse/file.c:1267:43: warning: incorrect type in initializer (different address spaces)
fs/fuse/file.c:1267:43: expected void [noderef] <asn:1>*iov_base
fs/fuse/file.c:1267:43: got void *<noident>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs/fuse/file.c')
-rw-r--r-- | fs/fuse/file.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 68e10d43bd3f..28bc9c672196 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -1148,9 +1148,9 @@ static inline int fuse_iter_npages(const struct iov_iter *ii_p) | |||
1148 | return min(npages, FUSE_MAX_PAGES_PER_REQ); | 1148 | return min(npages, FUSE_MAX_PAGES_PER_REQ); |
1149 | } | 1149 | } |
1150 | 1150 | ||
1151 | static ssize_t __fuse_direct_io(struct file *file, const struct iovec *iov, | 1151 | ssize_t fuse_direct_io(struct file *file, const struct iovec *iov, |
1152 | unsigned long nr_segs, size_t count, | 1152 | unsigned long nr_segs, size_t count, loff_t *ppos, |
1153 | loff_t *ppos, int write) | 1153 | int write) |
1154 | { | 1154 | { |
1155 | struct fuse_file *ff = file->private_data; | 1155 | struct fuse_file *ff = file->private_data; |
1156 | struct fuse_conn *fc = ff->fc; | 1156 | struct fuse_conn *fc = ff->fc; |
@@ -1209,13 +1209,6 @@ static ssize_t __fuse_direct_io(struct file *file, const struct iovec *iov, | |||
1209 | 1209 | ||
1210 | return res; | 1210 | return res; |
1211 | } | 1211 | } |
1212 | |||
1213 | ssize_t fuse_direct_io(struct file *file, const char __user *buf, | ||
1214 | size_t count, loff_t *ppos, int write) | ||
1215 | { | ||
1216 | struct iovec iov = { .iov_base = (void *)buf, .iov_len = count }; | ||
1217 | return __fuse_direct_io(file, &iov, 1, count, ppos, write); | ||
1218 | } | ||
1219 | EXPORT_SYMBOL_GPL(fuse_direct_io); | 1212 | EXPORT_SYMBOL_GPL(fuse_direct_io); |
1220 | 1213 | ||
1221 | static ssize_t __fuse_direct_read(struct file *file, const struct iovec *iov, | 1214 | static ssize_t __fuse_direct_read(struct file *file, const struct iovec *iov, |
@@ -1227,8 +1220,8 @@ static ssize_t __fuse_direct_read(struct file *file, const struct iovec *iov, | |||
1227 | if (is_bad_inode(inode)) | 1220 | if (is_bad_inode(inode)) |
1228 | return -EIO; | 1221 | return -EIO; |
1229 | 1222 | ||
1230 | res = __fuse_direct_io(file, iov, nr_segs, iov_length(iov, nr_segs), | 1223 | res = fuse_direct_io(file, iov, nr_segs, iov_length(iov, nr_segs), |
1231 | ppos, 0); | 1224 | ppos, 0); |
1232 | 1225 | ||
1233 | fuse_invalidate_attr(inode); | 1226 | fuse_invalidate_attr(inode); |
1234 | 1227 | ||
@@ -1238,7 +1231,7 @@ static ssize_t __fuse_direct_read(struct file *file, const struct iovec *iov, | |||
1238 | static ssize_t fuse_direct_read(struct file *file, char __user *buf, | 1231 | static ssize_t fuse_direct_read(struct file *file, char __user *buf, |
1239 | size_t count, loff_t *ppos) | 1232 | size_t count, loff_t *ppos) |
1240 | { | 1233 | { |
1241 | struct iovec iov = { .iov_base = (void *)buf, .iov_len = count }; | 1234 | struct iovec iov = { .iov_base = buf, .iov_len = count }; |
1242 | return __fuse_direct_read(file, &iov, 1, ppos); | 1235 | return __fuse_direct_read(file, &iov, 1, ppos); |
1243 | } | 1236 | } |
1244 | 1237 | ||
@@ -1251,7 +1244,7 @@ static ssize_t __fuse_direct_write(struct file *file, const struct iovec *iov, | |||
1251 | 1244 | ||
1252 | res = generic_write_checks(file, ppos, &count, 0); | 1245 | res = generic_write_checks(file, ppos, &count, 0); |
1253 | if (!res) { | 1246 | if (!res) { |
1254 | res = __fuse_direct_io(file, iov, nr_segs, count, ppos, 1); | 1247 | res = fuse_direct_io(file, iov, nr_segs, count, ppos, 1); |
1255 | if (res > 0) | 1248 | if (res > 0) |
1256 | fuse_write_update_size(inode, *ppos); | 1249 | fuse_write_update_size(inode, *ppos); |
1257 | } | 1250 | } |
@@ -1264,7 +1257,7 @@ static ssize_t __fuse_direct_write(struct file *file, const struct iovec *iov, | |||
1264 | static ssize_t fuse_direct_write(struct file *file, const char __user *buf, | 1257 | static ssize_t fuse_direct_write(struct file *file, const char __user *buf, |
1265 | size_t count, loff_t *ppos) | 1258 | size_t count, loff_t *ppos) |
1266 | { | 1259 | { |
1267 | struct iovec iov = { .iov_base = (void *)buf, .iov_len = count }; | 1260 | struct iovec iov = { .iov_base = (void __user *)buf, .iov_len = count }; |
1268 | struct inode *inode = file->f_path.dentry->d_inode; | 1261 | struct inode *inode = file->f_path.dentry->d_inode; |
1269 | ssize_t res; | 1262 | ssize_t res; |
1270 | 1263 | ||