From patchwork Mon Nov 16 00:59:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11907003 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6F99B138B for ; Mon, 16 Nov 2020 01:00:12 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F0F322223C for ; Mon, 16 Nov 2020 01:00:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0F322223C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id E4FF821F9C9; Sun, 15 Nov 2020 17:00:09 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 17CF821F895 for ; Sun, 15 Nov 2020 17:00:08 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id 47FEE222C; Sun, 15 Nov 2020 20:00:06 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id 3C60B2C7E6; Sun, 15 Nov 2020 20:00:06 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Sun, 15 Nov 2020 19:59:34 -0500 Message-Id: <1605488401-981-2-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1605488401-981-1-git-send-email-jsimmons@infradead.org> References: <1605488401-981-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 01/28] llite: remove splice_read handling for PCC X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" For older kernels with PCC we handled splice_read ourself but this is no longer needed since generic_file_splice_read() is just a wrapper around the read_iter() operation. We can safely remove pcc_file_splice_read(). Use the read_iter() / write_iter() functions for pccf_file instead of the default file of the passed in kiocb. WC-bug-id: https://jira.whamcloud.com/browse/LU-13745 Lustre-commit: 1635dc9de0bc1d ("LU-13745 llite: switch generic_file_splice_read() to use of ->read_iter()") Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/39272 Reviewed-by: Wang Shilong Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- fs/lustre/llite/pcc.c | 33 ++------------------------------- fs/lustre/llite/pcc.h | 5 ----- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/fs/lustre/llite/pcc.c b/fs/lustre/llite/pcc.c index 5a4bb33..28ca9cb 100644 --- a/fs/lustre/llite/pcc.c +++ b/fs/lustre/llite/pcc.c @@ -1592,7 +1592,7 @@ ssize_t pcc_file_read_iter(struct kiocb *iocb, * filp->f_ops->read_iter uses ->aio_read hook directly * to add support for ext4-dax. */ - result = file->f_op->read_iter(iocb, iter); + result = iocb->ki_filp->f_op->read_iter(iocb, iter); iocb->ki_filp = file; pcc_io_fini(inode); @@ -1633,7 +1633,7 @@ ssize_t pcc_file_write_iter(struct kiocb *iocb, * the normal vfs interface to the local PCC file system, * the inode lock is not needed. */ - result = file->f_op->write_iter(iocb, iter); + result = iocb->ki_filp->f_op->write_iter(iocb, iter); iocb->ki_filp = file; out: pcc_io_fini(inode); @@ -1734,35 +1734,6 @@ int pcc_inode_getattr(struct inode *inode, u32 request_mask, return rc; } -ssize_t pcc_file_splice_read(struct file *in_file, loff_t *ppos, - struct pipe_inode_info *pipe, - size_t count, unsigned int flags, - bool *cached) -{ - struct inode *inode = file_inode(in_file); - struct ll_file_data *fd = in_file->private_data; - struct file *pcc_file = fd->fd_pcc_file.pccf_file; - ssize_t result; - - *cached = false; - if (!pcc_file) - return 0; - - if (!file_inode(pcc_file)->i_fop->splice_read) - return -ENOTSUPP; - - pcc_io_init(inode, PIT_SPLICE_READ, cached); - if (!*cached) - return 0; - - result = file_inode(pcc_file)->i_fop->splice_read(pcc_file, - ppos, pipe, count, - flags); - - pcc_io_fini(inode); - return result; -} - int pcc_fsync(struct file *file, loff_t start, loff_t end, int datasync, bool *cached) { diff --git a/fs/lustre/llite/pcc.h b/fs/lustre/llite/pcc.h index b13f9da8..d3aae9b 100644 --- a/fs/lustre/llite/pcc.h +++ b/fs/lustre/llite/pcc.h @@ -184,8 +184,6 @@ enum pcc_io_type { PIT_FAULT, /* fsync system call handling */ PIT_FSYNC, - /* splice_read system call */ - PIT_SPLICE_READ, /* open system call */ PIT_OPEN, }; @@ -241,9 +239,6 @@ ssize_t pcc_file_write_iter(struct kiocb *iocb, struct iov_iter *iter, int pcc_inode_getattr(struct inode *inode, u32 request_mask, unsigned int flags, bool *cached); int pcc_inode_setattr(struct inode *inode, struct iattr *attr, bool *cached); -ssize_t pcc_file_splice_read(struct file *in_file, loff_t *ppos, - struct pipe_inode_info *pipe, size_t count, - unsigned int flags, bool *cached); int pcc_fsync(struct file *file, loff_t start, loff_t end, int datasync, bool *cached); int pcc_file_mmap(struct file *file, struct vm_area_struct *vma, bool *cached);