From patchwork Sat Apr 4 19:13:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Monakhov X-Patchwork-Id: 6161381 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 557CCBF4A6 for ; Sat, 4 Apr 2015 19:17:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88F05203AD for ; Sat, 4 Apr 2015 19:17:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8F095202DD for ; Sat, 4 Apr 2015 19:17:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753403AbbDDTQt (ORCPT ); Sat, 4 Apr 2015 15:16:49 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:6393 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753063AbbDDTNw (ORCPT ); Sat, 4 Apr 2015 15:13:52 -0400 Received: from mct2.qa.sw.ru ([10.29.1.63]) by relay.sw.ru (8.13.4/8.13.4) with ESMTP id t34JDUJI024798; Sat, 4 Apr 2015 22:13:46 +0300 (MSK) From: Dmitry Monakhov To: linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, viro@zeniv.linux.org.uk, Dmitry Monakhov , linux-nfs@vger.kernel.org Subject: [PATCH 09/16] nfs: use is_xxx_kiocb instead of filp->fl_flags Date: Sat, 4 Apr 2015 23:13:18 +0400 Message-Id: <1428174805-853-10-git-send-email-dmonakhov@openvz.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1428174805-853-1-git-send-email-dmonakhov@openvz.org> References: <1428174805-853-1-git-send-email-dmonakhov@openvz.org> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Cc: linux-nfs@vger.kernel.org Signed-off-by: Dmitry Monakhov --- fs/nfs/direct.c | 7 +++---- fs/nfs/file.c | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index c3929fb..76950c6 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -964,8 +964,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter, loff_t pos) { ssize_t result = -EINVAL; - struct file *file = iocb->ki_filp; - struct address_space *mapping = file->f_mapping; + struct address_space *mapping = iocb->ki_filp->f_mapping; struct inode *inode = mapping->host; struct nfs_direct_req *dreq; struct nfs_lock_context *l_ctx; @@ -976,9 +975,9 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter, nfs_add_stats(mapping->host, NFSIOS_DIRECTWRITTENBYTES, count); dfprintk(FILE, "NFS: direct write(%pD2, %zd@%Ld)\n", - file, count, (long long) pos); + iocb->ki_filp, count, (long long) pos); - result = generic_write_checks(file, &pos, &count, 0); + result = generic_write_checks(iocb, &pos, &count, 0); if (result) goto out; diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 37b1558..709cb7f 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -170,7 +170,7 @@ nfs_file_read(struct kiocb *iocb, struct iov_iter *to) struct inode *inode = file_inode(iocb->ki_filp); ssize_t result; - if (iocb->ki_filp->f_flags & O_DIRECT) + if (is_direct_kiocb(iocb)) return nfs_file_direct_read(iocb, to, iocb->ki_pos); dprintk("NFS: read(%pD2, %zu@%lu)\n", @@ -680,7 +680,7 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from) if (result) return result; - if (file->f_flags & O_DIRECT) + if (is_direct_kiocb(iocb)) return nfs_file_direct_write(iocb, from, pos); dprintk("NFS: write(%pD2, %zu@%Ld)\n", @@ -692,7 +692,7 @@ ssize_t nfs_file_write(struct kiocb *iocb, struct iov_iter *from) /* * O_APPEND implies that we must revalidate the file length. */ - if (file->f_flags & O_APPEND) { + if (is_append_kiocb(iocb)) { result = nfs_revalidate_file_size(inode, file); if (result) goto out;