Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp692198pxb; Wed, 20 Jan 2021 18:46:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJzZaq463Zih4h2U9cdUxmTN21syPhz7fR9h/r4sUiYifP2KUZIvbiGlDahWrNxZA1g7BZFc X-Received: by 2002:a17:906:f246:: with SMTP id gy6mr7561048ejb.264.1611197199868; Wed, 20 Jan 2021 18:46:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611197199; cv=none; d=google.com; s=arc-20160816; b=FNeboaA/143I1TjIhD2ju+8Npm547/aaurZypIs267S39PgLKjaYu2nlFhEaMyyyIr h7TN0PWmylJwOCedoJlOsDJUUfGwDS5uJIkeShHICBTdjHWP5Lxtn5zAtOaftUYgM8NW oJOWg9yS3p6Rs6xwWNARPvcEyXD1rEtYKZLS+2cO29aeZgP5T6y7nK6EHhvr7MvW4ZJA 9V8RslLCs4EAaswVzBb6Es96aKBpocyk4ycdpR6BXSrDgniiq3qLvIRALCyps3OGxgtB SyRUQq0NpxWPOhsBmzdyDYHKWLbpPukPKAcU+JHUigivnag6Nw8GfHJmUhJ9BFYrXCvQ /8lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:organization:dkim-signature; bh=seHfPkWJgWtlglmjT0RaV4SzsvsdViNEADyqU/Qqi74=; b=j4mEFZyi8OMS90ju7AMMwb0P7p/PIB7XiAAVGfeAYjeVMY1dnSRw+rhrUSq5Plc2bo 2W7rbxC8CM0BeYhIfwfhTS5Qn1mW4uwTjRih51GCA9AmrwsAZre1QJqZ+X4LBQ5pqnbe SAOHitJagIihtbGk9EX2ZALOXLwmqGbddn9/7zSi2xbNtmknRoVSnD21hptn/yEwfpLa ILKeru7VjFXjouf6wY0p11GP+kLEY2f+k0B8BsFP/+JYbhdG98CsZza05syKdaoQB1lt x7RKlNZWgTNRUG9CylDnwVHx0gsu7w3TAL8hqrUluCXcotZYz2+/26jBxPXnEtB+b58c bMnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EDBoFXOZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a29si1613572edm.288.2021.01.20.18.46.16; Wed, 20 Jan 2021 18:46:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EDBoFXOZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391628AbhAUAG1 (ORCPT + 99 others); Wed, 20 Jan 2021 19:06:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35570 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727499AbhATWYH (ORCPT ); Wed, 20 Jan 2021 17:24:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611181342; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=seHfPkWJgWtlglmjT0RaV4SzsvsdViNEADyqU/Qqi74=; b=EDBoFXOZpQhML3LDEbvfgnMD3Ac+E0H9ogSYdDy9LHVPaaY+VbwG6xR8ZqW1K0IrzKkJkQ 2xzgy6Q40m4+FgGY/o3MEI1J2vm+PTgUMDv1lzs1fYQr0mMRgJgHVKt6FiL6LhLkbqXYWv OAr5dW8Q9TOIwN51ioSwkPW4EZ+c0hw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-603-Fw6FIRyZM4Kx_cOXY1cKtQ-1; Wed, 20 Jan 2021 17:22:21 -0500 X-MC-Unique: Fw6FIRyZM4Kx_cOXY1cKtQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4005B107ACE8; Wed, 20 Jan 2021 22:22:19 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-115-23.rdu2.redhat.com [10.10.115.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4CAB36F998; Wed, 20 Jan 2021 22:22:12 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 Subject: [PATCH 04/25] vfs: Export rw_verify_area() for use by cachefiles From: David Howells To: Trond Myklebust , Anna Schumaker , Steve French , Dominique Martinet Cc: dhowells@redhat.com, Jeff Layton , David Wysochanski , Matthew Wilcox , Alexander Viro , linux-cachefs@redhat.com, linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs-developer@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 20 Jan 2021 22:22:12 +0000 Message-ID: <161118133204.1232039.70595719156846825.stgit@warthog.procyon.org.uk> In-Reply-To: <161118128472.1232039.11746799833066425131.stgit@warthog.procyon.org.uk> References: <161118128472.1232039.11746799833066425131.stgit@warthog.procyon.org.uk> User-Agent: StGit/0.23 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Export rw_verify_area() for so that cachefiles can use it before issuing call_read_iter() and call_write_iter() to effect async DIO operations against the cache. Signed-off-by: David Howells --- fs/internal.h | 5 ----- fs/read_write.c | 1 + include/linux/fs.h | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/internal.h b/fs/internal.h index 77c50befbfbe..92e686249c40 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -164,11 +164,6 @@ extern char *simple_dname(struct dentry *, char *, int); extern void dput_to_list(struct dentry *, struct list_head *); extern void shrink_dentry_list(struct list_head *); -/* - * read_write.c - */ -extern int rw_verify_area(int, struct file *, const loff_t *, size_t); - /* * pipe.c */ diff --git a/fs/read_write.c b/fs/read_write.c index 75f764b43418..fe84e11245bd 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -400,6 +400,7 @@ int rw_verify_area(int read_write, struct file *file, const loff_t *ppos, size_t return security_file_permission(file, read_write == READ ? MAY_READ : MAY_WRITE); } +EXPORT_SYMBOL(rw_verify_area); static ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos) { diff --git a/include/linux/fs.h b/include/linux/fs.h index fd47deea7c17..493804856ab3 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2760,6 +2760,7 @@ extern int notify_change(struct dentry *, struct iattr *, struct inode **); extern int inode_permission(struct inode *, int); extern int generic_permission(struct inode *, int); extern int __check_sticky(struct inode *dir, struct inode *inode); +extern int rw_verify_area(int, struct file *, const loff_t *, size_t); static inline bool execute_ok(struct inode *inode) {