From: James Simmons Date: Wed, 10 Jul 2013 19:41:47 +0000 (-0400) Subject: LU-2800 autoconf: remove vectored fops tests X-Git-Tag: 2.4.53~55 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=33d52bf33f671ebd344b17155f2c7e1af57e95e1 LU-2800 autoconf: remove vectored fops tests file_operations.readv/writev have been removed since v2.6.19 We can remove the test and the dead code. Signed-off-by: Jeff Mahoney Signed-off-by: James Simmons Change-Id: I6b4bd25d769c0ea2486faaca70e0945552c3b2cd Reviewed-on: http://review.whamcloud.com/5343 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: Christopher J. Morrone Reviewed-by: Oleg Drokin --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index f850604..b9fa7d7 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -396,44 +396,6 @@ AC_DEFUN([LC_LINUX_FIEMAP_H], []) ]) -# 2.6.19 - -# LC_FILE_WRITEV -# 2.6.19 replaced writev with aio_write -AC_DEFUN([LC_FILE_WRITEV], -[AC_MSG_CHECKING([writev in fops]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct file_operations *fops = NULL; - fops->writev = NULL; -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FILE_WRITEV, 1, - [use fops->writev]) -],[ - AC_MSG_RESULT(no) -]) -]) - -# LC_FILE_READV -# 2.6.19 replaced readv with aio_read -AC_DEFUN([LC_FILE_READV], -[AC_MSG_CHECKING([readv in fops]) -LB_LINUX_TRY_COMPILE([ - #include -],[ - struct file_operations *fops = NULL; - fops->readv = NULL; -],[ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FILE_READV, 1, - [use fops->readv]) -],[ - AC_MSG_RESULT(no) -]) -]) - # raid5-zerocopy patch # @@ -1623,10 +1585,6 @@ AC_DEFUN([LC_PROG_LINUX], #2.6.18 + RHEL5 (fc6) LC_LINUX_FIEMAP_H - # 2.6.19 - LC_FILE_WRITEV - LC_FILE_READV - # raid5-zerocopy patch LC_PAGE_CONSTANT diff --git a/lustre/include/lclient.h b/lustre/include/lclient.h index a24460f..dd782ee 100644 --- a/lustre/include/lclient.h +++ b/lustre/include/lclient.h @@ -114,9 +114,7 @@ struct ccc_io { * File descriptor against which IO is done. */ struct ll_file_data *cui_fd; -#ifndef HAVE_FILE_WRITEV struct kiocb *cui_iocb; -#endif }; /** diff --git a/lustre/llite/file.c b/lustre/llite/file.c index 87b30b4..648b40a 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -1088,9 +1088,7 @@ restart: cio->cui_iov = args->u.normal.via_iov; cio->cui_nrsegs = args->u.normal.via_nrsegs; cio->cui_tot_nrsegs = cio->cui_nrsegs; -#ifndef HAVE_FILE_WRITEV cio->cui_iocb = args->u.normal.via_iocb; -#endif if ((iot == CIT_WRITE) && !(cio->cui_fd->fd_flags & LL_FILE_GROUP_LOCKED)) { if (mutex_lock_interruptible(&lli-> @@ -1189,56 +1187,6 @@ static int ll_file_get_iov_count(const struct iovec *iov, return 0; } -#ifdef HAVE_FILE_READV -static ssize_t ll_file_readv(struct file *file, const struct iovec *iov, - unsigned long nr_segs, loff_t *ppos) -{ - struct lu_env *env; - struct vvp_io_args *args; - size_t count; - ssize_t result; - int refcheck; - ENTRY; - - result = ll_file_get_iov_count(iov, &nr_segs, &count); - if (result) - RETURN(result); - - env = cl_env_get(&refcheck); - if (IS_ERR(env)) - RETURN(PTR_ERR(env)); - - args = vvp_env_args(env, IO_NORMAL); - args->u.normal.via_iov = (struct iovec *)iov; - args->u.normal.via_nrsegs = nr_segs; - - result = ll_file_io_generic(env, args, file, CIT_READ, ppos, count); - cl_env_put(env, &refcheck); - RETURN(result); -} - -static ssize_t ll_file_read(struct file *file, char *buf, size_t count, - loff_t *ppos) -{ - struct lu_env *env; - struct iovec *local_iov; - ssize_t result; - int refcheck; - ENTRY; - - env = cl_env_get(&refcheck); - if (IS_ERR(env)) - RETURN(PTR_ERR(env)); - - local_iov = &vvp_env_info(env)->vti_local_iov; - local_iov->iov_base = (void __user *)buf; - local_iov->iov_len = count; - result = ll_file_readv(file, local_iov, 1, ppos); - cl_env_put(env, &refcheck); - RETURN(result); -} - -#else static ssize_t ll_file_aio_read(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos) { @@ -1296,62 +1244,11 @@ static ssize_t ll_file_read(struct file *file, char *buf, size_t count, cl_env_put(env, &refcheck); RETURN(result); } -#endif /* * Write to a file (through the page cache). + * AIO stuff */ -#ifdef HAVE_FILE_WRITEV -static ssize_t ll_file_writev(struct file *file, const struct iovec *iov, - unsigned long nr_segs, loff_t *ppos) -{ - struct lu_env *env; - struct vvp_io_args *args; - size_t count; - ssize_t result; - int refcheck; - ENTRY; - - result = ll_file_get_iov_count(iov, &nr_segs, &count); - if (result) - RETURN(result); - - env = cl_env_get(&refcheck); - if (IS_ERR(env)) - RETURN(PTR_ERR(env)); - - args = vvp_env_args(env, IO_NORMAL); - args->u.normal.via_iov = (struct iovec *)iov; - args->u.normal.via_nrsegs = nr_segs; - - result = ll_file_io_generic(env, args, file, CIT_WRITE, ppos, count); - cl_env_put(env, &refcheck); - RETURN(result); -} - -static ssize_t ll_file_write(struct file *file, const char *buf, size_t count, - loff_t *ppos) -{ - struct lu_env *env; - struct iovec *local_iov; - ssize_t result; - int refcheck; - ENTRY; - - env = cl_env_get(&refcheck); - if (IS_ERR(env)) - RETURN(PTR_ERR(env)); - - local_iov = &vvp_env_info(env)->vti_local_iov; - local_iov->iov_base = (void __user *)buf; - local_iov->iov_len = count; - - result = ll_file_writev(file, local_iov, 1, ppos); - cl_env_put(env, &refcheck); - RETURN(result); -} - -#else /* AIO stuff */ static ssize_t ll_file_aio_write(struct kiocb *iocb, const struct iovec *iov, unsigned long nr_segs, loff_t pos) { @@ -1409,7 +1306,6 @@ static ssize_t ll_file_write(struct file *file, const char *buf, size_t count, cl_env_put(env, &refcheck); RETURN(result); } -#endif /* * Send file content (through pagecache) somewhere with helper @@ -3286,24 +3182,12 @@ int ll_inode_permission(struct inode *inode, int mask, struct nameidata *nd) RETURN(rc); } -#ifdef HAVE_FILE_READV -#define READ_METHOD readv -#define READ_FUNCTION ll_file_readv -#define WRITE_METHOD writev -#define WRITE_FUNCTION ll_file_writev -#else -#define READ_METHOD aio_read -#define READ_FUNCTION ll_file_aio_read -#define WRITE_METHOD aio_write -#define WRITE_FUNCTION ll_file_aio_write -#endif - /* -o localflock - only provides locally consistent flock locks */ struct file_operations ll_file_operations = { .read = ll_file_read, - .READ_METHOD = READ_FUNCTION, + .aio_read = ll_file_aio_read, .write = ll_file_write, - .WRITE_METHOD = WRITE_FUNCTION, + .aio_write = ll_file_aio_write, .unlocked_ioctl = ll_file_ioctl, .open = ll_file_open, .release = ll_file_release, @@ -3316,9 +3200,9 @@ struct file_operations ll_file_operations = { struct file_operations ll_file_operations_flock = { .read = ll_file_read, - .READ_METHOD = READ_FUNCTION, + .aio_read = ll_file_aio_read, .write = ll_file_write, - .WRITE_METHOD = WRITE_FUNCTION, + .aio_write = ll_file_aio_write, .unlocked_ioctl = ll_file_ioctl, .open = ll_file_open, .release = ll_file_release, @@ -3334,9 +3218,9 @@ struct file_operations ll_file_operations_flock = { /* These are for -o noflock - to return ENOSYS on flock calls */ struct file_operations ll_file_operations_noflock = { .read = ll_file_read, - .READ_METHOD = READ_FUNCTION, + .aio_read = ll_file_aio_read, .write = ll_file_write, - .WRITE_METHOD = WRITE_FUNCTION, + .aio_write = ll_file_aio_write, .unlocked_ioctl = ll_file_ioctl, .open = ll_file_open, .release = ll_file_release, diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index a7216f4..b0a45ef 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -986,9 +986,7 @@ struct vvp_io_args { union { struct { -#ifndef HAVE_FILE_WRITEV struct kiocb *via_iocb; -#endif struct iovec *via_iov; unsigned long via_nrsegs; } normal; diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c index 5bf9956..b644bd8 100644 --- a/lustre/llite/vvp_io.c +++ b/lustre/llite/vvp_io.c @@ -485,19 +485,6 @@ static void vvp_io_setattr_fini(const struct lu_env *env, vvp_io_fini(env, ios); } -#ifdef HAVE_FILE_READV -static ssize_t lustre_generic_file_read(struct file *file, - struct ccc_io *vio, loff_t *ppos) -{ - return generic_file_readv(file, vio->cui_iov, vio->cui_nrsegs, ppos); -} - -static ssize_t lustre_generic_file_write(struct file *file, - struct ccc_io *vio, loff_t *ppos) -{ - return generic_file_writev(file, vio->cui_iov, vio->cui_nrsegs, ppos); -} -#else static ssize_t lustre_generic_file_read(struct file *file, struct ccc_io *vio, loff_t *ppos) { @@ -511,7 +498,6 @@ static ssize_t lustre_generic_file_write(struct file *file, return generic_file_aio_write(vio->cui_iocb, vio->cui_iov, vio->cui_nrsegs, *ppos); } -#endif static int vvp_io_read_start(const struct lu_env *env, const struct cl_io_slice *ios) @@ -625,9 +611,7 @@ static int vvp_io_write_start(const struct lu_env *env, * out-of-order writes. */ pos = io->u.ci_wr.wr.crw_pos = i_size_read(inode); -#ifndef HAVE_FILE_WRITEV cio->cui_iocb->ki_pos = pos; -#endif } CDEBUG(D_VFSTRACE, "write: [%lli, %lli)\n", pos, pos + (long long)cnt);