From patchwork Fri Feb 17 16:09:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 9580331 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1978F6043A for ; Fri, 17 Feb 2017 16:10:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C38528701 for ; Fri, 17 Feb 2017 16:10:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 013792871C; Fri, 17 Feb 2017 16:10:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A94AC2871C for ; Fri, 17 Feb 2017 16:10:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934728AbdBQQJ6 (ORCPT ); Fri, 17 Feb 2017 11:09:58 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:35024 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934729AbdBQQJz (ORCPT ); Fri, 17 Feb 2017 11:09:55 -0500 Received: by mail-wm0-f43.google.com with SMTP id v186so19437092wmd.0 for ; Fri, 17 Feb 2017 08:09:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9cvJXnDRjprKzFRcZWMxXg+E92qZ/ihl02IPrCmw31g=; b=a/p5n8oQKsSXpv2beuQsFll2zVSKHrEbPIl7wiOXriF+a7mWICl4eyECyMv7RBD8G+ tQkA1sj/pbOObWlYFJI09EV6Pvm4FFME4yJxKUSIyjjFYL1jhc8bdCJTN8cLcUiCs7Iv OZCnhksxKMbrQFS01/n6uM9uMv69/bcLLAoIvSAKnl216rlhhwZ02rQmi72CpA6d+fv0 Zlw8HpjlGT6TDgk51xChO8rFOGGSNSfy2ZxlT/2pwPZSK12g4XZqYKY1vJY4Yvfa+8yO PMSgCQAZsOpV8jvUtYMQ2fqfOswJQ0t5rzFUER+F3qzdOS1nFMFpbw0PdakGA3Gl0AUR 0I/A== X-Gm-Message-State: AMke39kEEEH8wzyIjXa/ThqYeK4k4B1fIpJrdaO3QhyDaWz7yZDZxSiO1ORH5roSl4Fp9b3n X-Received: by 10.28.5.70 with SMTP id 67mr4449389wmf.32.1487347793943; Fri, 17 Feb 2017 08:09:53 -0800 (PST) Received: from veci.piliscsaba.szeredi.hu (pool-dsl-2c-0018.externet.hu. [217.173.44.24]) by smtp.gmail.com with ESMTPSA id h23sm4538793wrc.48.2017.02.17.08.09.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Feb 2017 08:09:52 -0800 (PST) From: Miklos Szeredi To: Al Viro Cc: linux-unionfs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 8/9] vfs: use helper for calling f_op->fsync() Date: Fri, 17 Feb 2017 17:09:37 +0100 Message-Id: <1487347778-18596-9-git-send-email-mszeredi@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1487347778-18596-1-git-send-email-mszeredi@redhat.com> References: <1487347778-18596-1-git-send-email-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Miklos Szeredi --- fs/sync.c | 2 +- include/linux/fs.h | 6 ++++++ ipc/shm.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/sync.c b/fs/sync.c index 2a54c1f22035..11ba023434b1 100644 --- a/fs/sync.c +++ b/fs/sync.c @@ -192,7 +192,7 @@ int vfs_fsync_range(struct file *file, loff_t start, loff_t end, int datasync) spin_unlock(&inode->i_lock); mark_inode_dirty_sync(inode); } - return file->f_op->fsync(file, start, end, datasync); + return call_fsync(file, start, end, datasync); } EXPORT_SYMBOL(vfs_fsync_range); diff --git a/include/linux/fs.h b/include/linux/fs.h index 6e74b726c3ca..1293005de2e3 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1745,6 +1745,12 @@ static inline int call_mmap(struct file *file, struct vm_area_struct *vma) return file->f_op->mmap(file, vma); } +static inline int call_fsync(struct file *file, loff_t start, loff_t end, + int datasync) +{ + return file->f_op->fsync(file, start, end, datasync); +} + ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, unsigned long nr_segs, unsigned long fast_segs, struct iovec *fast_pointer, diff --git a/ipc/shm.c b/ipc/shm.c index 4329fe3ef594..258aff2e03bb 100644 --- a/ipc/shm.c +++ b/ipc/shm.c @@ -452,7 +452,7 @@ static int shm_fsync(struct file *file, loff_t start, loff_t end, int datasync) if (!sfd->file->f_op->fsync) return -EINVAL; - return sfd->file->f_op->fsync(sfd->file, start, end, datasync); + return call_fsync(sfd->file, start, end, datasync); } static long shm_fallocate(struct file *file, int mode, loff_t offset,