From patchwork Sun Dec 15 09:17: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: 13908698 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 09EB814A604; Sun, 15 Dec 2024 09:17:41 +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=1734254263; cv=none; b=SjGSAnqn9DiriIDcuuleKXHuq5WL+Xr1Qbj3imuTyE0v/+K71Rv7OCfvXtm6YTSgNpG4G5wLvNtBiaNF+9xjdFk8uM8h22F4WeAOgcW7SS4IN0D5JO/bxokWEaTSBUB8E2+OxS82WfoA+eFYdL389TnLQ9pBU5QAf8fzCLRO4QU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734254263; c=relaxed/simple; bh=6aeQoPPhjSTLAIpt9Pme+pM/1AgdYlsLH520tvGJqcw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CLXsJJu2qwJD0DB9Zs5ruVMr1t/DaEmwFztgoBIzNx3dyAoYJ9qs1RC2e3EKa0rzUtP2qjSUe+6mkgbLjvYPTPjfb1BjqWsZ8IIIn/ZeOMttXjIbFOMeQdv2h3FOU7HkuGGHtZJNiIRaQRH9x+SNWIYp82BP4e38FbgeW1syMG4= 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=cwVwLGzO; 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="cwVwLGzO" Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BF1k7Nt010643; Sun, 15 Dec 2024 09:17:31 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=dlH7q3cP1NjRA0ySa 5TB1D1j8xmoS0D2fm0YzjmNQC8=; b=cwVwLGzOlJOxTpvS1Elu0Lh1O652OiqFp d0060/wr6WGhOtA6zzkUSG5HpwIFTLFxV4Sg0N90NBkr2lmj+GdlyID3PRzQsoE5 m0b0x1qRgPTjqCbcTSAYVEboDcsOZLS0p1ZkPnUkSV6BtuOt0DtHxEe8o64frnOG jCVPiUU6q3zlmgSYqyS0S2uDBR44OleHDjLeRszIC2iBdKPMc9kdausnFLOIrKyn kbrwCTmJCM0KG4mStc+ZWD8+T2fvwx9vjYKi7TDPcY51Cd/KoNaM2rJvT6XSX78w 5Xv3xrAWwXk2uzLt8x0HZBEKt0xtebrNBo9zFdnByl94Wp4cskf0w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43hm5gsc5k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 15 Dec 2024 09:17:31 +0000 (GMT) Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4BF9HUtT017717; Sun, 15 Dec 2024 09:17:30 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43hm5gsc5f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 15 Dec 2024 09:17:30 +0000 (GMT) Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4BF81T6n011249; Sun, 15 Dec 2024 09:17:29 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 43hpjjs2ey-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 15 Dec 2024 09:17:29 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4BF9HS1O57803190 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 15 Dec 2024 09:17:28 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1F7C820043; Sun, 15 Dec 2024 09:17:28 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7024120040; Sun, 15 Dec 2024 09:17:26 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com.com (unknown [9.124.213.165]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Sun, 15 Dec 2024 09:17:26 +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: [PATCH 1/3] include/linux.h: use linux/magic.h to get XFS_SUPER_MAGIC Date: Sun, 15 Dec 2024 14:47:15 +0530 Message-ID: <713c4e61358b95bbdf95daca094abc73a230e52f.1734253505.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: 9O8ltBblyVW0WNvzQr2J2vvRljfqcVTS X-Proofpoint-GUID: Sw549-82DhBEEc9dxZJb7iiU725u3-pM 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 mlxscore=0 impostorscore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=631 spamscore=0 phishscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412150076 This avoids open coding the magic number Signed-off-by: Ojaswin Mujoo Reviewed-by: Christoph Hellwig --- include/linux.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux.h b/include/linux.h index e9eb7bfb26a1..306a31e092a7 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 Sun Dec 15 09:17:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ojaswin Mujoo X-Patchwork-Id: 13908697 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 A7BF54437A; Sun, 15 Dec 2024 09:17: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=1734254262; cv=none; b=Mjx32/u0DDauazBlZ40ebSeuawP99Cxdq3Ix25QKZD0nMwZyxkcxQbvCFlNziEHA5wbp0/HN+rbQ9iaR40STP7aPKywS14CrcorHOGSUeSNOuJ1H5DfTZnWHdg1wfzIhX/nnQ/Xe0pDAtTT8MRfmeb2u6SGzbzO+tJTzzGtF4I8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734254262; c=relaxed/simple; bh=90lMp4bnxmYkRBBPinXYFbWXFgyPUo8c23umpPHs5RY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S1BfDeGpuwV94Bw1dbvKNFGFZCx8z9lJ4TBgKfE8oPsTkMbdeVLEQHtMpzPoEoViuZtJTT3V7EEwhwE4Nc62N/ZjeJI6JCHEJN1JcF8AcbvQ3oV0Po0ev+UNvjXim4haWeYNtjjkmyTxdvG5maaRpcOfivJYvR8inSJ156HW9bM= 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=ncvX0Zix; 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="ncvX0Zix" Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4BF3rZMV022857; Sun, 15 Dec 2024 09:17: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=rbs2KeWSMHh5QUqIS xTVc+VALG2wLP6H5PXmmKzieS4=; b=ncvX0Zix9RcVs1tsWMCc9pWZU99fHK8VH Xl3FJy/hJ+Nm5YQqnUwfJuO72GUXa4BNP+xLF52QUMOrhxzJasGGWcXmbPN8KSnb p5Pox2XYnaR8Ficvy+XTprNFgpYVImbtAz9UKIjrh6EhGvjubokCSHrCR3sf/qvG qxo/sFda97gUHQC6ppU+ip2FY2WeN4xhlKlnkUQYrDb3L0uIKJ8/ZtCndBecnEN3 Q/HrPlgN9hwb2tpE98PY1ENSrHBE6xbxwMTvAF8LMZLEBoW+0dA3zvOvoNYtF7jN SPh4iDeGrntRUsNwIV4CwlYf85ghGgRJjO3qotvvPXGOqQW4wTqQw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43hqkgrt6h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 15 Dec 2024 09:17:34 +0000 (GMT) Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4BF9HYc4021988; Sun, 15 Dec 2024 09:17:34 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 43hqkgrt6d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 15 Dec 2024 09:17:34 +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 4BF95egX014391; Sun, 15 Dec 2024 09:17:33 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 43hq218xhh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 15 Dec 2024 09:17:33 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4BF9HVXH56951090 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 15 Dec 2024 09:17:31 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 814E920043; Sun, 15 Dec 2024 09:17:31 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 676A120040; Sun, 15 Dec 2024 09:17:28 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com.com (unknown [9.124.213.165]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Sun, 15 Dec 2024 09:17:28 +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 , Dave Chinner Subject: [PATCH 2/3] xfs_io: allow foreign FSes to show FS_IOC_FSGETXATTR details Date: Sun, 15 Dec 2024 14:47:16 +0530 Message-ID: <592adf8dd6cbc469608dfde3b340c6180fdc19d3.1734253505.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: YjZBwv7NVH1IQ1y608o8lLCuH4flKOid X-Proofpoint-ORIG-GUID: uaaZWKlB5N0K6vlihn37SUekxzqM55IE 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 suspectscore=0 clxscore=1015 bulkscore=0 phishscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 adultscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412150076 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 --- 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 Sun Dec 15 09:17:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ojaswin Mujoo X-Patchwork-Id: 13908699 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 9574D155312; Sun, 15 Dec 2024 09:17:43 +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=1734254265; cv=none; b=oQHcXXvGja34Isy8DSN8+RaDS+QffJt8mzSNAnO4ihA/w9qGzF0JEUb4Nmnq0BZ7I1Yg8TFjeeLZy35Wxg4T985lMXC75AyYulRu1GtlyP6JPv6qC5uPEJk7dzqPEcr7yi0cUhkW9Ety+vZcXjvlpmGJIvvPyhV/Le2FY4ADbeE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734254265; c=relaxed/simple; bh=pfGkfSRbBeBZe2pfv8FMlZ/K7pb4YLUhiD7uHI13nsM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n6AgxMJpea7RPcMbMfgzzAKcHD8+3buISr3eme1/JlXu525aYXHOWpSttD46AEks9ypRFVYJAdv2y3qvLxai9eOXM2I85W45IIIQAKIbUUhy/f3lOzhIs71QWxNkiS5Vxso9KQvDqsksRt0EVGboYezW/d1WzNOSnhODUgy41rQ= 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=IYwZJxk8; 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="IYwZJxk8" 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 4BENaW5H013424; Sun, 15 Dec 2024 09:17:37 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=IYwZJxk8/JZ0z/08M/N6Lf26RLoQ0ENr2 oEZAqLDHLRQ+HAqvRviMwkSymIEITtXuHZ3X6cUs8mTk7vnLhJPYUrc3hyooYy+q cj6LK0Pe93XrTK+3PLwuJe+AYoT9wSkvVDIOW+jefqg/tQkNgxYinD8Cp3Eis0Ux /igAi+dPcDP0ERQw+wSANPMtqnMY0oKTLIZWz8cOchWYHNtDgeSO5ppMGi6Ngsd0 IIV6s9mt/Xq0d01oBx/IhD0Coqj3NEiGRx9S7qLoRrLxCr9G4zeY243OQOUswjD5 4aI+pZBORa/qRKicUYbu7IwsFIk8VbIysrlLoYeJHE/Ac9uaIqY5Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 43hkua17mn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 15 Dec 2024 09:17:37 +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 4BF9HaXs011753; Sun, 15 Dec 2024 09:17:36 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 43hkua17mg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 15 Dec 2024 09:17:36 +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 4BF7C5Tp024026; Sun, 15 Dec 2024 09:17:35 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 43hnuk1731-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 15 Dec 2024 09:17:35 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4BF9HX0T64815366 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 15 Dec 2024 09:17:33 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B88A620043; Sun, 15 Dec 2024 09:17:33 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD70920040; Sun, 15 Dec 2024 09:17:31 +0000 (GMT) Received: from li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com.com (unknown [9.124.213.165]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Sun, 15 Dec 2024 09:17: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" , John Garry Subject: [PATCH 3/3] xfs_io: add extsize command support Date: Sun, 15 Dec 2024 14:47:17 +0530 Message-ID: <505e0447396daec6f3b574d5d0fa7d8f915dc090.1734253505.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: cdVfGJaQdjyE28ipvQIpMmqOmbzot33I X-Proofpoint-ORIG-GUID: FW2fEMr9DnHC1kU6rHdqX7Du6uBM2Vut 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 bulkscore=0 adultscore=0 impostorscore=0 suspectscore=0 malwarescore=0 clxscore=1015 spamscore=0 priorityscore=1501 mlxscore=0 phishscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2411120000 definitions=main-2412150072 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 --- 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;