lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1415913813-362-6-git-send-email-pieter@boesman.nl>
Date:	Thu, 13 Nov 2014 22:22:42 +0100
From:	Pieter Smith <pieter@...sman.nl>
To:	pieter@...sman.nl
Cc:	Josh Triplett <josh@...htriplett.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Oleg Drokin <green@...uxhacker.ru>,
	Andreas Dilger <andreas.dilger@...el.com>,
	Peng Tao <bergwolf@...il.com>,
	Jinshan Xiong <jinshan.xiong@...el.com>,
	"John L. Hammond" <john.hammond@...el.com>,
	JC Lafoucriere <jacques-charles.lafoucriere@....fr>,
	Al Viro <viro@...iv.linux.org.uk>,
	Andrew Perepechko <andrew_perepechko@...atex.com>,
	Dmitry Eremin <dmitry.eremin@...el.com>,
	Lai Siyao <lai.siyao@...el.com>, Li Xi <lixi@....com>,
	Masanari Iida <standby24x7@...il.com>,
	devel@...verdev.osuosl.org (open list:STAGING SUBSYSTEM),
	linux-kernel@...r.kernel.org (open list)
Subject: [PATCH 05/56] fs/lustre: support compiling out splice

Compile out splice support from lustre file-system 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@...sman.nl>
---
 drivers/staging/lustre/lustre/llite/file.c           | 10 +++++++---
 drivers/staging/lustre/lustre/llite/llite_internal.h |  2 ++
 drivers/staging/lustre/lustre/llite/vvp_io.c         |  2 ++
 3 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c
index fd1b75a3..98573da 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -1126,10 +1126,12 @@ restart:
 				down_read(&lli->lli_trunc_sem);
 			}
 			break;
+#ifdef CONFIG_SYSCALL_SPLICE
 		case IO_SPLICE:
 			vio->u.splice.cui_pipe = args->u.splice.via_pipe;
 			vio->u.splice.cui_flags = args->u.splice.via_flags;
 			break;
+#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
 		default:
 			CERROR("Unknown IO type - %u\n", vio->cui_io_subtype);
 			LBUG();
@@ -1223,6 +1225,7 @@ static ssize_t ll_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	return result;
 }
 
+#ifdef CONFIG_SYSCALL_SPLICE
 /*
  * Send file content (through pagecache) somewhere with helper
  */
@@ -1247,6 +1250,7 @@ static ssize_t ll_file_splice_read(struct file *in_file, loff_t *ppos,
 	cl_env_put(env, &refcheck);
 	return result;
 }
+#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
 
 static int ll_lov_recreate(struct inode *inode, struct ost_id *oi,
 			   obd_count ost_idx)
@@ -3078,7 +3082,7 @@ struct file_operations ll_file_operations = {
 	.release	= ll_file_release,
 	.mmap	   = ll_file_mmap,
 	.llseek	 = ll_file_seek,
-	.splice_read    = ll_file_splice_read,
+	SPLICE_READ_INIT(ll_file_splice_read)
 	.fsync	  = ll_fsync,
 	.flush	  = ll_flush
 };
@@ -3093,7 +3097,7 @@ struct file_operations ll_file_operations_flock = {
 	.release	= ll_file_release,
 	.mmap	   = ll_file_mmap,
 	.llseek	 = ll_file_seek,
-	.splice_read    = ll_file_splice_read,
+	SPLICE_READ_INIT(ll_file_splice_read)
 	.fsync	  = ll_fsync,
 	.flush	  = ll_flush,
 	.flock	  = ll_file_flock,
@@ -3111,7 +3115,7 @@ struct file_operations ll_file_operations_noflock = {
 	.release	= ll_file_release,
 	.mmap	   = ll_file_mmap,
 	.llseek	 = ll_file_seek,
-	.splice_read    = ll_file_splice_read,
+	SPLICE_READ_INIT(ll_file_splice_read)
 	.fsync	  = ll_fsync,
 	.flush	  = ll_flush,
 	.flock	  = ll_file_noflock,
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 634ffa6..44fa32a 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -861,7 +861,9 @@ enum vvp_io_subtype {
 	/** normal IO */
 	IO_NORMAL,
 	/** io started from splice_{read|write} */
+#ifdef CONFIG_SYSCALL_SPLICE
 	IO_SPLICE
+#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
 };
 
 /* IO subtypes */
diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c
index a4117d6..2f4aa39 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_io.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_io.c
@@ -530,6 +530,7 @@ static int vvp_io_read_start(const struct lu_env *env,
 		LASSERT(cio->cui_iocb->ki_pos == pos);
 		result = generic_file_read_iter(cio->cui_iocb, cio->cui_iter);
 		break;
+#ifdef CONFIG_SYSCALL_SPLICE
 	case IO_SPLICE:
 		result = generic_file_splice_read(file, &pos,
 				vio->u.splice.cui_pipe, cnt,
@@ -539,6 +540,7 @@ static int vvp_io_read_start(const struct lu_env *env,
 		 * buffers. */
 		io->ci_continue = 0;
 		break;
+#endif /* #ifdef CONFIG_SYSCALL_SPLICE */
 	default:
 		CERROR("Wrong IO type %u\n", vio->cui_io_subtype);
 		LBUG();
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ