lkml.org 
[lkml]   [2014]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 32/56] fs/nfs: support compiling out splice
Date
Compile out splice support from nfs when the splice-family of syscalls is not
supported by the system (i.e. CONFIG_SYSCALL_SPLICE is undefined).

Signed-off-by: Pieter Smith <pieter@boesman.nl>
---
fs/nfs/file.c | 6 ++++--
fs/nfs/nfs4file.c | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 524dd80..b36b4fb 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -187,6 +187,7 @@ nfs_file_read(struct kiocb *iocb, struct iov_iter *to)
}
EXPORT_SYMBOL_GPL(nfs_file_read);

+#ifdef CONFIG_SYSCALL_SPLICE
ssize_t
nfs_file_splice_read(struct file *filp, loff_t *ppos,
struct pipe_inode_info *pipe, size_t count,
@@ -207,6 +208,7 @@ nfs_file_splice_read(struct file *filp, loff_t *ppos,
return res;
}
EXPORT_SYMBOL_GPL(nfs_file_splice_read);
+#endif /* #ifdef CONFIG_SYSCALL_SPLICE */

int
nfs_file_mmap(struct file * file, struct vm_area_struct * vma)
@@ -915,8 +917,8 @@ const struct file_operations nfs_file_operations = {
.fsync = nfs_file_fsync,
.lock = nfs_lock,
.flock = nfs_flock,
- .splice_read = nfs_file_splice_read,
- .splice_write = iter_file_splice_write,
+ SPLICE_READ_INIT(nfs_file_splice_read)
+ SPLICE_WRITE_INIT(iter_file_splice_write)
.check_flags = nfs_check_flags,
.setlease = nfs_setlease,
};
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index a816f06..81dd4c8 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -128,8 +128,8 @@ const struct file_operations nfs4_file_operations = {
.fsync = nfs4_file_fsync,
.lock = nfs_lock,
.flock = nfs_flock,
- .splice_read = nfs_file_splice_read,
- .splice_write = iter_file_splice_write,
+ SPLICE_READ_INIT(nfs_file_splice_read)
+ SPLICE_WRITE_INIT(iter_file_splice_write)
.check_flags = nfs_check_flags,
.setlease = nfs_setlease,
};
--
1.9.1


\
 
 \ /
  Last update: 2014-11-13 23:01    [W:0.020 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site