From patchwork Thu Dec 19 12:39:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ojaswin Mujoo X-Patchwork-Id: 13915043 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1156021D58E; Thu, 19 Dec 2024 12:39:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734611988; cv=none; b=kbkFYmGpRmV/47Hgm16SIN1kxLjB86PrNil0SnfDLrWG1wfNpElhfnDbbsRw++mqw8J0I2o590HpH8hV5L4cqaXJMAE+IdOTqBqQ3ULYveJiQbLCM4d5/uCKI8ZlQQ1qQHRC6l4ejNxyo5Kqq57umc2EhvqSc3Mip7eG4FcSYWQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734611988; c=relaxed/simple; bh=CuBOXjTuvHfA0Uu7CO0zK1h+lN97EAVcve9h1X9zP7I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R/V6sM3LSPqjDCyUb5cRq5qwjuem4SxkZ6SYXJO09Glj01p1yOCn2jJEiF91pe6nam6FyKV0JyASTLa6lLVaGg6NEsUS9CLJ7HyVHhWAuGtEZnBjV7RE+/z9SDyCxop6zMiSyr1r447X7kR5GbGaXOkJrsqj1iwC93e/lAc5b7U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=RLaPxZfz; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="RLaPxZfz" Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BJB0ada014467; Thu, 19 Dec 2024 12:39:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=qenZDd2Pg2oH6MmP0 yiyoUp+FSIFvvyOcjz6tEO+sp8=; b=RLaPxZfzSq4XrLytywrb35As5P3Ea5Uqs pvUkBOKsEUzNbDRQQQgZ8DxHQDWYq+LVUbOzU1eSPMVUHVpm3Eh9ggO8hJIO9xMR qas4TRaVafLbPeCl2mMORlDVpf0K2eJ2ImEehtVRBxCiHeSTACJZXyiNdBPrCHTj mH+a2rWW2N/CfuYrlyMdUVvt6lKQIZnA70g7O8FtKcBLPwTYn67butVpTnOcnlQF jvXXDdatbMvuox1+zdXWqMJDM8hYY55tNJorH9E9/oc40SQvmgi+uBKpqCrUjFpl qKSihLoLB0ftLBKKitM9w+/Bn2jUmRzDLrQ6jPzQbrBgE0LsoANjA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43mj808dg8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 12:39:34 +0000 (GMT) Received: from m0356516.ppops.net (m0356516.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4BJCQOFd003695; Thu, 19 Dec 2024 12:39:34 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43mj808dg5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 12:39:33 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4BJ8vSDo024047; Thu, 19 Dec 2024 12:39:33 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 43hnukn0wg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 12:39:33 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4BJCdVuq50463176 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Dec 2024 12:39:31 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 329D620043; Thu, 19 Dec 2024 12:39:31 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9659E20040; Thu, 19 Dec 2024 12:39:29 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com.com (unknown [9.124.219.143]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 19 Dec 2024 12:39:29 +0000 (GMT) From: Ojaswin Mujoo To: linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org Cc: Ritesh Harjani , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrey Albershteyn , "Darrick J . Wong" , Christoph Hellwig Subject: [PATCH v2 1/3] include/linux.h: use linux/magic.h to get XFS_SUPER_MAGIC Date: Thu, 19 Dec 2024 18:09:13 +0530 Message-ID: <66f4220d2c2da6ce143114f9635ed8cd4e54af1d.1734611784.git.ojaswin@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: OI_ZFSzmbKymEj-HCiJebYcX9P__ipPg X-Proofpoint-ORIG-GUID: VLgjs2cL8888JOEYdeEjwUrH29TrVKQf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 phishscore=0 mlxlogscore=592 bulkscore=0 adultscore=0 suspectscore=0 clxscore=1015 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412190100 This avoids open coding the magic number Reviewed-by: Christoph Hellwig Signed-off-by: Ojaswin Mujoo Reviewed-by: "Darrick J. Wong" --- include/linux.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux.h b/include/linux.h index e9eb7bfb26a1..b3516d54c51b 100644 --- a/include/linux.h +++ b/include/linux.h @@ -37,6 +37,7 @@ #endif #include #include +#include /* super block magic numbers */ static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) { @@ -60,7 +61,7 @@ static __inline__ int platform_test_xfs_fd(int fd) return 0; if (!S_ISREG(statbuf.st_mode) && !S_ISDIR(statbuf.st_mode)) return 0; - return (statfsbuf.f_type == 0x58465342); /* XFSB */ + return statfsbuf.f_type == XFS_SUPER_MAGIC; } static __inline__ int platform_test_xfs_path(const char *path) From patchwork Thu Dec 19 12:39:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ojaswin Mujoo X-Patchwork-Id: 13915042 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B5CA22577A; Thu, 19 Dec 2024 12:39:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.158.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734611987; cv=none; b=cdU623ACjlOuNV3D6k11S+ohxHK9unrCeCGk9mciIqsWki4JvL1d6/rylAHhsAMkx8Kp8dCg0ZrusYnEJDTa88MruUlVw5/MwiSiKCwpwscYEDmFhk1ZKqbPT5Mpp2dUeiEiA+HUVpjzMekxY0TVWFrdeRSzrPHGtTKCk6Ve8/4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734611987; c=relaxed/simple; bh=90lMp4bnxmYkRBBPinXYFbWXFgyPUo8c23umpPHs5RY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bMjsdu7DPiWofZx/K4SJ8ABGPYg3lMJF4pZ6UPHV3Ne49dNQ0xAxFbtWCyO8PPZTy5YnWVkU9+V9+T4kskLZYnBdQ9Bzp/vRfFOOjhUvGcvym3Zm9l6iljuL5f+mSZlEj39CMMMP6VUdqhIsbpwqwYzo9kKAJzbnqHUWmLfwk/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=IaLZEBE6; arc=none smtp.client-ip=148.163.158.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="IaLZEBE6" Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BJ0WTwT012308; Thu, 19 Dec 2024 12:39:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=rbs2KeWSMHh5QUqIS xTVc+VALG2wLP6H5PXmmKzieS4=; b=IaLZEBE6Jh5uoIu/WaFqmm9Qx+6OLMZ39 qbm2Z2Z5c1oYbvRnU3xsIUuOtBaGHBK6Vclz/4w3NbHeV1VPIESBLnGFw4Y/Ot/p ENd61mNzKMorfiYssIF7rarOE2mD2J20xfnEvstVw+aZpLMY/dNodAHb2KHaS3rs K+mKxg6KVvs4s9Cu0RySi8GA+7VkiMbsmEGrnZ0VL8a/AmAx0xrgF/LXKeEKUlZb Pd2zAMrbGlmjFeMTxoEeoZnQ3J4Xt0obyBlVpABdbi28CgDK38dwJvUkAyqDEckJ URD8g+PvBNs7qPzzReH0d7AI2PF8BAdQYDda9sXuuPDkqIFbSjrbw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43kyv4weqh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 12:39:36 +0000 (GMT) Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4BJCUkwg004165; Thu, 19 Dec 2024 12:39:35 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43kyv4weqf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 12:39:35 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4BJBWL9V029326; Thu, 19 Dec 2024 12:39:34 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 43hmbswb4k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 12:39:34 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4BJCdXRS60948854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Dec 2024 12:39:33 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0F20120040; Thu, 19 Dec 2024 12:39:33 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7CF4020043; Thu, 19 Dec 2024 12:39:31 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com.com (unknown [9.124.219.143]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 19 Dec 2024 12:39:31 +0000 (GMT) From: Ojaswin Mujoo To: linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org Cc: Ritesh Harjani , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrey Albershteyn , "Darrick J . Wong" , Dave Chinner Subject: [PATCH v2 2/3] xfs_io: allow foreign FSes to show FS_IOC_FSGETXATTR details Date: Thu, 19 Dec 2024 18:09:14 +0530 Message-ID: <0d572efaadc1ed7726a79c0f8cc074914f45d320.1734611784.git.ojaswin@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: u5JfBTabQNbqHKogWeSApIoYFvnjdL-E X-Proofpoint-ORIG-GUID: -4JGun3iQ1ZIMbZKbfYAr4U0DUwlHhHW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 impostorscore=0 priorityscore=1501 adultscore=0 phishscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412190100 Currently with stat we only show FS_IOC_FSGETXATTR details if the filesystem is XFS. With extsize support also coming to ext4 and possibly other filesystems, make sure to allow foreign FSes to display these details when "stat" or "statx" is used. (Thanks to Dave for suggesting implementation of print_extended_info()) Suggested-by: Dave Chinner Signed-off-by: Ojaswin Mujoo Reviewed-by: "Darrick J. Wong" --- io/stat.c | 63 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/io/stat.c b/io/stat.c index 326f2822e276..3ce3308d0562 100644 --- a/io/stat.c +++ b/io/stat.c @@ -98,30 +98,45 @@ print_file_info(void) } static void -print_xfs_info(int verbose) +print_extended_info(int verbose) { - struct dioattr dio; - struct fsxattr fsx, fsxa; - - if ((xfsctl(file->name, file->fd, FS_IOC_FSGETXATTR, &fsx)) < 0 || - (xfsctl(file->name, file->fd, XFS_IOC_FSGETXATTRA, &fsxa)) < 0) { - perror("FS_IOC_FSGETXATTR"); - } else { - printf(_("fsxattr.xflags = 0x%x "), fsx.fsx_xflags); - printxattr(fsx.fsx_xflags, verbose, 0, file->name, 1, 1); - printf(_("fsxattr.projid = %u\n"), fsx.fsx_projid); - printf(_("fsxattr.extsize = %u\n"), fsx.fsx_extsize); - printf(_("fsxattr.cowextsize = %u\n"), fsx.fsx_cowextsize); - printf(_("fsxattr.nextents = %u\n"), fsx.fsx_nextents); - printf(_("fsxattr.naextents = %u\n"), fsxa.fsx_nextents); + struct dioattr dio = {}; + struct fsxattr fsx = {}, fsxa = {}; + + if ((ioctl(file->fd, FS_IOC_FSGETXATTR, &fsx)) < 0) { + perror("FS_IOC_GETXATTR"); + exitcode = 1; + return; } + + printf(_("fsxattr.xflags = 0x%x "), fsx.fsx_xflags); + printxattr(fsx.fsx_xflags, verbose, 0, file->name, 1, 1); + printf(_("fsxattr.projid = %u\n"), fsx.fsx_projid); + printf(_("fsxattr.extsize = %u\n"), fsx.fsx_extsize); + printf(_("fsxattr.cowextsize = %u\n"), fsx.fsx_cowextsize); + printf(_("fsxattr.nextents = %u\n"), fsx.fsx_nextents); + + /* Only XFS supports FS_IOC_FSGETXATTRA and XFS_IOC_DIOINFO */ + if (file->flags & IO_FOREIGN) + return; + + if ((ioctl(file->fd, XFS_IOC_FSGETXATTRA, &fsxa)) < 0) { + perror("XFS_IOC_GETXATTRA"); + exitcode = 1; + return; + } + + printf(_("fsxattr.naextents = %u\n"), fsxa.fsx_nextents); + if ((xfsctl(file->name, file->fd, XFS_IOC_DIOINFO, &dio)) < 0) { perror("XFS_IOC_DIOINFO"); - } else { - printf(_("dioattr.mem = 0x%x\n"), dio.d_mem); - printf(_("dioattr.miniosz = %u\n"), dio.d_miniosz); - printf(_("dioattr.maxiosz = %u\n"), dio.d_maxiosz); + exitcode = 1; + return; } + + printf(_("dioattr.mem = 0x%x\n"), dio.d_mem); + printf(_("dioattr.miniosz = %u\n"), dio.d_miniosz); + printf(_("dioattr.maxiosz = %u\n"), dio.d_maxiosz); } int @@ -167,10 +182,7 @@ stat_f( printf(_("stat.ctime = %s"), ctime(&st.st_ctime)); } - if (file->flags & IO_FOREIGN) - return 0; - - print_xfs_info(verbose); + print_extended_info(verbose); return 0; } @@ -440,10 +452,7 @@ statx_f( ctime((time_t *)&stx.stx_btime.tv_sec)); } - if (file->flags & IO_FOREIGN) - return 0; - - print_xfs_info(verbose); + print_extended_info(verbose); return 0; } From patchwork Thu Dec 19 12:39:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ojaswin Mujoo X-Patchwork-Id: 13915041 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 915412253F8; Thu, 19 Dec 2024 12:39:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734611982; cv=none; b=FM7bfY9U6x0l50LHYF26UNkcS9AbpzMevlAxE0hKgfvva4qbVXmSedBPKuLxA1DlUzU/WWpL8413e8wIM5VlM2fPj8n6s5P6s0uEtg9dtJHXDDxaTEDUXQTuHKdw7H9/ewGkO2KDCSaec5DGq6RODg5zDxVw4EikCxDtnGypoeY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734611982; c=relaxed/simple; bh=pfGkfSRbBeBZe2pfv8FMlZ/K7pb4YLUhiD7uHI13nsM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s3g8U5KWyoq8OJ23oRMLkxJewIUg48uxQ5D/zKXaTRDX9XSjf0cM34bKxZj1A7y38ixTkjC3EqXzKamkPKeviFvXe71Pda8OvfaQAO/4lyKqOrG4NWgxjfV8BC8DkAgNSEIPm/FQ8tdRVenfLPzj3joF8g+HE8Pz1JrssoYaBRY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=ZNka8ei/; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="ZNka8ei/" Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BJ3qMCj012952; Thu, 19 Dec 2024 12:39:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=56iEWu45x5ZogUIJ3 B7E3Njw8FYRxDwCN46dpTp1gNM=; b=ZNka8ei/DdSx3P8jezCG1BFdPAkkxYG7n rPIP9FoCBG4TUCZ2VpWIhnAq+LnQxazYU8HBIgzM4ERPpE9ZIKYBfiKlXEvYFGg4 OcuBvyt6ABMftRPJtgnmmTkMoE9bc5TIImwIqvhYo24s72X2/JcRyZ7RZMqUYfcm XCX1NMG0lo2mIbIA2WYNQAQHTOAbKRU3EmACJzHQ2SNbhIXr2WsOURwgxgWSYABj QCjfRfJ4Jya8zHI9tuPpSUjmAfTNe8Hb8t5K8KwYeXIHPgiJMvjZxhjnfd30EtkM mpACQgwqFmI+uZ5gkF8UeccMnbLqDxf9xCVVVo0ohgmsNiMib8eKA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43mbyc242v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 12:39:38 +0000 (GMT) Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4BJCc9vV025819; Thu, 19 Dec 2024 12:39:37 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43mbyc242t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 12:39:37 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4BJAhP5E014391; Thu, 19 Dec 2024 12:39:36 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 43hq21vqy3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Dec 2024 12:39:36 +0000 Received: from smtpav05.fra02v.mail.ibm.com (smtpav05.fra02v.mail.ibm.com [10.20.54.104]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4BJCdZmk30605656 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Dec 2024 12:39:35 GMT Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2456F20043; Thu, 19 Dec 2024 12:39:35 +0000 (GMT) Received: from smtpav05.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5791620040; Thu, 19 Dec 2024 12:39:33 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com.com (unknown [9.124.219.143]) by smtpav05.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 19 Dec 2024 12:39:33 +0000 (GMT) From: Ojaswin Mujoo To: linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org Cc: Ritesh Harjani , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrey Albershteyn , "Darrick J . Wong" Subject: [PATCH v2 3/3] xfs_io: add extsize command support Date: Thu, 19 Dec 2024 18:09:15 +0530 Message-ID: <931b3f0da15da34cfd9d6460e930ce301e721cf5.1734611784.git.ojaswin@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-xfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ZWVJrq1aX-NeksQ9JZSwX-1sLjowNjnx X-Proofpoint-ORIG-GUID: o3FufTq2-XpEVn0_9XQTSF2ILr_HfmXq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 suspectscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412190100 extsize command is currently only supported with XFS filesystem. Lift this restriction now that ext4 is also supporting extsize hints. Signed-off-by: Ojaswin Mujoo Reviewed-by: "Darrick J. Wong" --- io/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io/open.c b/io/open.c index a30dd89a1fd5..2582ff9b862e 100644 --- a/io/open.c +++ b/io/open.c @@ -997,7 +997,7 @@ open_init(void) extsize_cmd.args = _("[-D | -R] [extsize]"); extsize_cmd.argmin = 0; extsize_cmd.argmax = -1; - extsize_cmd.flags = CMD_NOMAP_OK; + extsize_cmd.flags = CMD_NOMAP_OK | CMD_FOREIGN_OK; extsize_cmd.oneline = _("get/set preferred extent size (in bytes) for the open file"); extsize_cmd.help = extsize_help;