Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1683493ybz; Thu, 23 Apr 2020 03:50:11 -0700 (PDT) X-Google-Smtp-Source: APiQypKg6S6C5p7UOhg0JEUhwdfUdPZvgPDTIWYMm3AaCjrTrNhD2iSyOCGJ6G7EB8Y2fBBg/Vnv X-Received: by 2002:aa7:d455:: with SMTP id q21mr2053936edr.235.1587639011554; Thu, 23 Apr 2020 03:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587639011; cv=none; d=google.com; s=arc-20160816; b=S1YrlKV/kfmRYMy8JX35p6BxPmWov3jFTcFgN7vbKf0kN5G9PJL60U/jhZFHOqrp8E +7kSK8zo+tPKODIk7NUyMww/3RasK595Ai/ux+Ax3n0G3twReB03iasI+h0bKZ133awL ia5V4Kl/LLCWK6nRobStG7FAU55Sw1+f1hlkwl+TYSTkzkSnwuuHGZnDotOC5hu8S8n9 d4jJiMlqeM2sCrbPRO8gkthsGWnZ1K8IoW9K7uxeQp6s+ydLko9WrJ3TiwcxlBl7KxEQ 0PUiyScEkl4Zo+3QddTG+Ckeamb5HtgVanwhjOVWYfPgRD0c1CnXkRUSI8/LzN7wXhoo 161Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:cc:to:from; bh=8zSYPjGGSB7gWMGJIx1pvBQCTLQ3djIhAWx8XiadlYo=; b=D3dpsw5oBhhXPNjs/9Rhiq5Bdc92Xqo4rfHo0N1e4hiHb7/Bdmr9rdUSXHyhihazX6 /TvSh1Rtyec4PH27Eh55nMYekRZRbjWzJms+et47G3iuN5wSSR+i4uPk2/fiQTxpeOXB fExKck97fjyqJ3Uw20jxsCppREJ9ai03CUUhXLT/4Es9EnSomN8kiOhkTHXvc7S37wpw R6jZasvOKfaRHkP9g+2SspGySDzkJUOZca8io7hC2scPRF+dY4i7kak8aBqC0sZJG+UI WP4D7POuO5UbwkKc07P58/uOeagyTlPtIF4ZrMHtbfePCOha1ZscB8JPPpZbw2TI3iKH vF9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r11si920507edq.390.2020.04.23.03.49.48; Thu, 23 Apr 2020 03:50:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727860AbgDWKsu (ORCPT + 99 others); Thu, 23 Apr 2020 06:48:50 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57880 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727121AbgDWKsu (ORCPT ); Thu, 23 Apr 2020 06:48:50 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03NAW5Ac092909 for ; Thu, 23 Apr 2020 06:48:49 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 30gmua8hxe-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Apr 2020 06:48:49 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 23 Apr 2020 11:48:10 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 23 Apr 2020 11:48:05 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 03NAmedZ59113688 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Apr 2020 10:48:40 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2788411C04A; Thu, 23 Apr 2020 10:48:40 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1FBBD11C064; Thu, 23 Apr 2020 10:48:37 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.199.60.18]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 23 Apr 2020 10:48:36 +0000 (GMT) From: Ritesh Harjani To: linux-ext4@vger.kernel.org Cc: jack@suse.cz, tytso@mit.edu, adilger@dilger.ca, darrick.wong@oracle.com, hch@infradead.org, Alexander Viro , Dan Carpenter , "Aneesh Kumar K . V" , Ritesh Harjani , Murphy Zhou , Miklos Szeredi , Amir Goldstein , linux-fsdevel@vger.kernel.org, linux-unionfs@vger.kernel.org Subject: [PATCH 3/5] vfs: EXPORT_SYMBOL for fiemap_check_ranges() Date: Thu, 23 Apr 2020 16:17:55 +0530 X-Mailer: git-send-email 2.21.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20042310-0008-0000-0000-00000375F52C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20042310-0009-0000-0000-00004A97C1E4 Message-Id: <58eee51755bb15c312c9d5935655a89466bd34ca.1587555962.git.riteshh@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-23_07:2020-04-22,2020-04-23 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 adultscore=0 impostorscore=0 mlxscore=0 malwarescore=0 suspectscore=1 mlxlogscore=990 clxscore=1015 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004230078 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 1. fiemap_check_ranges() is needed by ovl_fiemap() to check for ranges before calling underlying inode's ->fiemap() call. 2. With this change even ext4 can use generic fiemap_check_ranges() instead of having a duplicate copy of it. So make this EXPORT_SYMBOL for use by overlayfs. Signed-off-by: Ritesh Harjani --- fs/ioctl.c | 5 +++-- include/linux/fs.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/ioctl.c b/fs/ioctl.c index 282d45be6f45..f1d93263186c 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -166,8 +166,8 @@ int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags) } EXPORT_SYMBOL(fiemap_check_flags); -static int fiemap_check_ranges(struct super_block *sb, - u64 start, u64 len, u64 *new_len) +int fiemap_check_ranges(struct super_block *sb, u64 start, u64 len, + u64 *new_len) { u64 maxbytes = (u64) sb->s_maxbytes; @@ -187,6 +187,7 @@ static int fiemap_check_ranges(struct super_block *sb, return 0; } +EXPORT_SYMBOL(fiemap_check_ranges); static int ioctl_fiemap(struct file *filp, struct fiemap __user *ufiemap) { diff --git a/include/linux/fs.h b/include/linux/fs.h index 4f6f59b4f22a..1ea70fe07618 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1759,6 +1759,8 @@ int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, u64 phys, u64 len, u32 flags); int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); +int fiemap_check_ranges(struct super_block *sb, u64 start, u64 len, + u64 *new_len); /* * This is the "filldir" function type, used by readdir() to let * the kernel specify what kind of dirent layout it wants to have. -- 2.21.0