From patchwork Wed Dec 11 07:54:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ojaswin Mujoo X-Patchwork-Id: 13903058 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 037F91D4610; Wed, 11 Dec 2024 07:54:22 +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=1733903664; cv=none; b=bo/FTwY2fJgTfaVymkuMPt5HE/hGKJdzb1rnmvASNVkrrVUSmUobwUKfYa9R4xeapVqa3l9zlMG2h+ze90bluGPBTs9CXuruT6FR/GF2bhmXpp1m1WJXcCDLjUqdIaq8aNof+HSjDLAm37vlOgRBxxhLatE3S2j+9OoYcvBtvW8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733903664; c=relaxed/simple; bh=axX8Rs8fCIAa7yHd06SvWN/1+357Te2hyqUEDYDIhK4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eqyL1XO5I9/YViY7eeUYg9OoA8ics8BPfFkbx9vCOOfy/0eQztH1s9tzVRJ2q5RMsHwaMWAG6PcYRcpm1ev3ymCiETHZFQ1Wy/e9X7iGWftqLKDnI+Li4nsRvfAX947rfpexNB1L9GIFAb3411da+0s/L+ILBguFeONvWGvYcMY= 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=UX73zzqI; 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="UX73zzqI" 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 4BAN243s025982; Wed, 11 Dec 2024 07:54:18 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=gNeYCLrrXrBMTdGxm Twjs2/qN/TjHQxLio1ngFJcVmQ=; b=UX73zzqIA8g1K4jhve1yZMmZ6JcO/DF/N Fmnk67EJYSGsxOse8ElQCKO52wgGSqPr6S8cjJX061fntWAkOk9hOT+qO9cDiGFM xAvZHpkOq09AiW70/vWVehgnsXKzzB5HjlJdJlEHlBZ1rJLaRZLkPi7aZv654+Rf lv3xBzPnK0oMtCjHU56Cf7BOKzxar7vra1VgruJsDQvJSRH+w+O1s+nN/EvN/Zc6 cBmWWBi1YAx58N7AdSniEJdU1Ik7bICsdeuOYIO7pURbOh7HgqaF7Ysla4PzWE// MKEf05DcAF9ycnq62lJ5rAiZFktPnTW+4CzKQ6SCHGlOTy1zTM90w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43cbsqb3cw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2024 07:54:17 +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 4BB7sHo3002061; Wed, 11 Dec 2024 07:54:17 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 43cbsqb3ct-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2024 07:54:17 +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 4BB60CkA018618; Wed, 11 Dec 2024 07:54:16 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 43d26kg4u5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2024 07:54:16 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4BB7sEJm35258876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Dec 2024 07:54:14 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 86D562004B; Wed, 11 Dec 2024 07:54:14 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0AB4C20040; Wed, 11 Dec 2024 07:54:13 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com.com (unknown [9.39.30.217]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Dec 2024 07:54:12 +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" , John Garry Subject: [RFC 1/3] include/linux.h: Factor out generic platform_test_fs_fd() helper Date: Wed, 11 Dec 2024 13:24:02 +0530 Message-ID: <5996d6854a16852daca5977063af6f2af2f0f4ca.1733902742.git.ojaswin@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: wPTgXinEIitIBHVsZOpmudcZ69X-d8zT X-Proofpoint-GUID: wpuxY-BeZ4zx2yXrkJeXVphrixv6ze7J 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 mlxlogscore=868 adultscore=0 lowpriorityscore=0 clxscore=1015 phishscore=0 impostorscore=0 suspectscore=0 spamscore=0 mlxscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110056 Factor our the generic code to detect the FS type out of platform_test_fs_fd(). This can then be used to detect different file systems types based on magic number. Also, add a helper to detect if the fd is from an ext4 filesystem. Signed-off-by: Ojaswin Mujoo --- include/linux.h | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/include/linux.h b/include/linux.h index e9eb7bfb26a1..52c64014c57f 100644 --- a/include/linux.h +++ b/include/linux.h @@ -43,13 +43,7 @@ static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) return ioctl(fd, cmd, p); } -/* - * platform_test_xfs_*() implies that xfsctl will succeed on the file; - * on Linux, at least, special files don't get xfs file ops, - * so return 0 for those - */ - -static __inline__ int platform_test_xfs_fd(int fd) +static __inline__ int platform_test_fs_fd(int fd, long type) { struct statfs statfsbuf; struct stat statbuf; @@ -60,7 +54,22 @@ 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 == type); +} + +/* + * platform_test_xfs_*() implies that xfsctl will succeed on the file; + * on Linux, at least, special files don't get xfs file ops, + * so return 0 for those + */ +static __inline__ int platform_test_xfs_fd(int fd) +{ + return platform_test_fs_fd(fd, 0x58465342); /* XFSB */ +} + +static __inline__ int platform_test_ext4_fd(int fd) +{ + return platform_test_fs_fd(fd, 0xef53); /* EXT4 magic number */ } static __inline__ int platform_test_xfs_path(const char *path) From patchwork Wed Dec 11 07:54:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ojaswin Mujoo X-Patchwork-Id: 13903059 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 183A21D7994; Wed, 11 Dec 2024 07:54:24 +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=1733903666; cv=none; b=TLAbhfETbRawBgDGpTrDR+bJ+4hvDc9MqGtj04mXVcAyue+WVHFUj2HOE5VPGvtMDKBnV5+4rWOV+mX/C9IURQFLVABws6Or4o3+zqW9LURLiBQa9YQ8fNvDDKVxXykfAxy7seeInEyictcAYQiUxgG3QZt2gcAsq/WifBcPzkU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733903666; c=relaxed/simple; bh=R+Le9eHMyodYKLUy/sCV14U+hjz3fFLE47Hm+cEBwL4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qbZUTzhASRw9yKj8XTxVa0M/CKm/XIpyshHpTdvCeXULzSXsuNDSG35NEyceUt/C4lm8wyrZMqjd4dqDuknjSeN7rN8Ihy7JMz0OWBHShzN0uiIyBGsjFwhQ45ezpNsTd29ZHTYoXzZg+Lr5NABmplSVB8KCxs77/gSoio6+rT8= 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=ND1taurG; 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="ND1taurG" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BB0lUIl003941; Wed, 11 Dec 2024 07:54:20 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=IzsxzOAcswDRsfeoR Iv2l8vtZ1Ep4s77VsAzBWWVcY0=; b=ND1taurG2QosRXXEU8IlCFE32XIcZTnD+ iI+eC85puyZkEF0FzsgbLjyjMzO8p0+EzivOwpZkkVAsNIkyiV2qbnCvfoTmabNs YAba17CALa0TALxOXwSa98UB4xOCP84jaY91VBnH2URoeU3+xJpiRwHVNMGXb97e EgDec1dREd8rsik5C9EaR0lbHHP8NhhOWCKUyXKX8ShVBKE1NSLDepcWs64ooVrF aGG0KXOhTOw+t+Apdb+1j/ZuxSd5d9LETAcfDWxiUDsv9CeMjS1X6RwTX+gv30al kPr8f7gaJYFEyt+a0Mh67+bJhbRuxblWuo0In4C7i9pb+wDAHtCFg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43ce0xjpw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2024 07:54:19 +0000 (GMT) Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4BB7sJgJ027245; Wed, 11 Dec 2024 07:54:19 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 43ce0xjpw0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2024 07:54:19 +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 4BB7jPab017364; Wed, 11 Dec 2024 07:54:18 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 43d3d1qv05-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2024 07:54:18 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4BB7sG5l33096300 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Dec 2024 07:54:16 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A90632004B; Wed, 11 Dec 2024 07:54:16 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CE8CC20040; Wed, 11 Dec 2024 07:54:14 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com.com (unknown [9.39.30.217]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Dec 2024 07:54:14 +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" , John Garry Subject: [RFC 2/3] xfs_io: Add ext4 support to show FS_IOC_FSGETXATTR details Date: Wed, 11 Dec 2024 13:24:03 +0530 Message-ID: <3b4b9f091519d2b2085888d296888179da3bdb73.1733902742.git.ojaswin@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: zN0jENuyTW5_JS81wIx_ZUrWvrJ5PCty X-Proofpoint-ORIG-GUID: xm7UNWL_Z6BLcgwCFZGGQdusl2_OcHhX 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 lowpriorityscore=0 spamscore=0 clxscore=1015 impostorscore=0 mlxscore=0 mlxlogscore=992 priorityscore=1501 malwarescore=0 adultscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110056 Currently with stat we only show FS_IOC_FSGETXATTR details if the filesystem is XFS. With extsize support also coming to ext4 make sure to show these details when -c "stat" or "statx" is used. No functional changes for filesystems other than ext4. Signed-off-by: Ojaswin Mujoo --- io/stat.c | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/io/stat.c b/io/stat.c index 326f2822e276..d06c2186cde4 100644 --- a/io/stat.c +++ b/io/stat.c @@ -97,14 +97,14 @@ print_file_info(void) file->flags & IO_TMPFILE ? _(",tmpfile") : ""); } -static void -print_xfs_info(int verbose) +static void print_extended_info(int verbose) { - struct dioattr dio; - struct fsxattr fsx, fsxa; + struct dioattr dio; + struct fsxattr fsx, fsxa; + bool is_xfs_fd = platform_test_xfs_fd(file->fd); - if ((xfsctl(file->name, file->fd, FS_IOC_FSGETXATTR, &fsx)) < 0 || - (xfsctl(file->name, file->fd, XFS_IOC_FSGETXATTRA, &fsxa)) < 0) { + if ((ioctl(file->fd, FS_IOC_FSGETXATTR, &fsx)) < 0 || + (is_xfs_fd && (xfsctl(file->name, file->fd, XFS_IOC_FSGETXATTRA, &fsxa) < 0))) { perror("FS_IOC_FSGETXATTR"); } else { printf(_("fsxattr.xflags = 0x%x "), fsx.fsx_xflags); @@ -113,14 +113,18 @@ print_xfs_info(int verbose) 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); + if (is_xfs_fd) + 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); + + if (is_xfs_fd) { + 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); + } } } @@ -167,10 +171,10 @@ stat_f( printf(_("stat.ctime = %s"), ctime(&st.st_ctime)); } - if (file->flags & IO_FOREIGN) + if (file->flags & IO_FOREIGN && !platform_test_ext4_fd(file->fd)) return 0; - print_xfs_info(verbose); + print_extended_info(verbose); return 0; } @@ -440,10 +444,10 @@ statx_f( ctime((time_t *)&stx.stx_btime.tv_sec)); } - if (file->flags & IO_FOREIGN) + if (file->flags & IO_FOREIGN && !platform_test_ext4_fd(file->fd)) return 0; - print_xfs_info(verbose); + print_extended_info(verbose); return 0; } From patchwork Wed Dec 11 07:54:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ojaswin Mujoo X-Patchwork-Id: 13903060 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 785511D7E57; Wed, 11 Dec 2024 07:54:26 +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=1733903668; cv=none; b=rmQ9Bg8SewLCpuThz4KBf2Co4XqK82zp5/v6BkdeMCEOufHKiNbYfUtscBKKUaATeYMM3AJ9K3tROJtxTBVlFgFlOaKBkQrkhXmRbOx42uaw7fQpWFVXIvRT79DlShgoCdTgG6+CIA9q1XJhHeHbvhPiidAac6bp/VcDivDLhRU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733903668; c=relaxed/simple; bh=pfGkfSRbBeBZe2pfv8FMlZ/K7pb4YLUhiD7uHI13nsM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iZ7eqraqpz3tLxCplFx3r7+CMNbRx/oCFqtG8umN7Uwz+ND00mNBg2JRWPjZxgGBS2e7ki9cTtIQYiVTroDPCW2QZsijqfdPejYke4Pv27vWFS6hx+G0ofDcsg4F/05APo10DKWERuk+mt2HuLrYO7K9pXVz8ofXW5rt1tUCuy8= 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=TYy2zpvA; 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="TYy2zpvA" Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BB0QRQH003998; Wed, 11 Dec 2024 07:54:22 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=TYy2zpvAaLe+j65ZSKM9ilCNfobngMCBQ 6cnqrWBKxKxPE95N3thMlapaZEahiTXvefvH5gzG7yxzTEAUekEnEfTLklA0xRds uGgc4Jlu78XErlpt0/h1sto1rIwZl15OEW52cEHZpsjDbpemP1UfJ/py6PohHv0L paaz3MQwstbQrwn8e4ds3SAXCg5KOy018Ffd5sPNqsakqRZ0Nly57ahDKIEdjybQ M4wOf0adGABOizcqCvOMx1sqSNtUUPLdJHnv8YuI/uzGXFkRU5vPWqD2q1irmHNL NPwstQcIP4+/h8a35SBi1ALlcZxh0jxdzvdTFnHW8Dvr481ji2l2Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43ce0xjpw8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2024 07:54:22 +0000 (GMT) Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4BB7sL4T027263; Wed, 11 Dec 2024 07:54:21 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 43ce0xjpw4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2024 07:54:21 +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 4BB5RaBS032724; Wed, 11 Dec 2024 07:54:20 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 43d0psges1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2024 07:54:20 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4BB7sJXc56754476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Dec 2024 07:54:19 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2E37020043; Wed, 11 Dec 2024 07:54:19 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE4BF2004B; Wed, 11 Dec 2024 07:54:16 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com.com (unknown [9.39.30.217]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 11 Dec 2024 07:54:16 +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" , John Garry Subject: [RFC 3/3] xfs_io: add extsize command support Date: Wed, 11 Dec 2024 13:24:04 +0530 Message-ID: <6448e3adc13eff8b152f7954c838eb9315c91574.1733902742.git.ojaswin@linux.ibm.com> X-Mailer: git-send-email 2.43.5 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: zPgKlWGDTEiC5BBEweJUQkS2-JFkl0GQ X-Proofpoint-ORIG-GUID: gGOaBbh5aCzP7gqrkh6LrX6uO8hz8naR 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 lowpriorityscore=0 spamscore=0 clxscore=1015 impostorscore=0 mlxscore=0 mlxlogscore=999 priorityscore=1501 malwarescore=0 adultscore=0 bulkscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412110056 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;