aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/file.c
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2012-11-10 10:55:56 -0500
committerMiklos Szeredi <mszeredi@suse.cz>2013-01-24 10:21:28 -0500
commitfb05f41f5f96f7423c53da4d87913fb44fd0565d (patch)
treed3cad72fea5e2b58b8bfa65aa3568e3617507234 /fs/fuse/file.c
parent5565a9d884327ac45d49041f1b846dac273e110c (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.c23
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
1151static ssize_t __fuse_direct_io(struct file *file, const struct iovec *iov, 1151ssize_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
1213ssize_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}
1219EXPORT_SYMBOL_GPL(fuse_direct_io); 1212EXPORT_SYMBOL_GPL(fuse_direct_io);
1220 1213
1221static ssize_t __fuse_direct_read(struct file *file, const struct iovec *iov, 1214static 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,
1238static ssize_t fuse_direct_read(struct file *file, char __user *buf, 1231static 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,
1264static ssize_t fuse_direct_write(struct file *file, const char __user *buf, 1257static 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