From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 9857130F927 for ; Mon, 3 Aug 2026 02:12:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785723138; cv=none; b=ieu1fP1VxP1pLS/Hr9s3wJjxGQupnFGaWquEQuTerDJduQ9uJRlOX1C0bjE1BG0Scps5nB3sXNoGiCnrMUSZ7bdhSkRgoMTrLwuCHcuJUAYsbKSMtnR72mzhr9Kj5LL+a29HRzjueK7pwLD6SVctpLEJBn2q0txj5SrQ4K0ZqdI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785723138; c=relaxed/simple; bh=yzn95ksPoS5SDD+AjaUTF3um7onbSa10b4HgxMzy2Rg=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=VzY5P7a83GIokfjEofcGRJdeqLZ5VchFelvPpgAf4273WfNuHnRMIdQ1pcp+d4GlqesgLfcWr8X327Yb+MX3NMCrHu3U0kkU5NcWueg3ocsdLR0uhLkDfn0u4B2HE0mXIX+8TKxQ614UOE31nkfd5gtpsT+Iy40Ju8qUZZFRPQQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b2SfWOxj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b2SfWOxj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE6471F000E9; Mon, 3 Aug 2026 02:12:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1785723136; bh=Ld3fnnQevrRHNCxH/HctbVgrPv5BoFsH/RwdXZ9V4w4=; h=Date:Cc:Subject:To:References:From:In-Reply-To; b=b2SfWOxjEUBGOQMBFl0eWmrxDRdoqendt3DIjYSYZwWazNAW2WhSmrOUh7vwIFEzG 6NZdAtJgFACGbGAWnUHTL6EJzlkLc1W6Wq2n1iq9EXkTXPJpRcdapczHFenC78VnSx SKX/HNCV21jABeRSK16H0gpKexNwPolYgq4N3yunKhr5rA4TyMzi36E9ZQXQkeJKBX ktAhHy/pZxm+djce0W1TIEpn2TVyK0ElC3GL4sKd/euY6a6ptN/jfXM6pPY+sEhH4x szOvxC99qfk8Cczil1mCT1be44FwC7wxExZY07Zn6w6+/6LpKgI6RHhXib1CQPDh/O kO8TQp0IwSQlw== Message-ID: <01934160-5194-4a74-867a-11da373a3630@kernel.org> Date: Mon, 3 Aug 2026 10:12:12 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: chao@kernel.org, Daeho Jeong Subject: Re: [f2fs-dev] [PATCH v2] f2fs_io: add dev_alias command for dynamic device aliasing management To: Daeho Jeong , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com References: <20260606011942.1206814-1-daeho43@gmail.com> Content-Language: en-US From: Chao Yu In-Reply-To: <20260606011942.1206814-1-daeho43@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Daeho, can you please update this patch to use last ioctl interface? On 6/6/26 09:19, Daeho Jeong wrote: > From: Daeho Jeong > > This commit adds a new 'dev_alias' command to f2fs_io tool to support > dynamic inclusion, exclusion and status querying of device alias ranges. > > Signed-off-by: Daeho Jeong > --- > v2: remove a f2fs specific flag from getflags. > --- > tools/f2fs_io/f2fs_io.c | 46 +++++++++++++++++++++++++++++++++++++++++ > tools/f2fs_io/f2fs_io.h | 7 +++++++ > 2 files changed, 53 insertions(+) > > diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c > index c977f4d..3fa323b 100644 > --- a/tools/f2fs_io/f2fs_io.c > +++ b/tools/f2fs_io/f2fs_io.c > @@ -2509,6 +2509,51 @@ static void do_test_lookup_perf(int argc, char **argv, const struct cmd_desc *cm > exit(0); > } > > +#define dev_alias_desc "device alias control" > +#define dev_alias_help \ > +"f2fs_io dev_alias [include|exclude|status] [file]\n\n" \ > +"include, exclude or status a range of device alias given the file\n" > + > +static void do_dev_alias(int argc, char **argv, const struct cmd_desc *cmd) > +{ > + int fd, ret; > + > + if (argc != 3) { > + fputs("Excess arguments\n\n", stderr); > + fputs(cmd->cmd_help, stderr); > + exit(1); > + } > + > + fd = xopen(argv[2], O_RDWR, 0); > + > + if (!strcmp(argv[1], "exclude")) { > + ret = ioctl(fd, F2FS_IOC_EXCLUDE_DEV_ALIAS); > + if (ret < 0) > + die_errno("F2FS_IOC_EXCLUDE_DEV_ALIAS failed"); > + printf("%s device alias range of %s\n", argv[1], argv[2]); > + } else if (!strcmp(argv[1], "include")) { > + ret = ioctl(fd, F2FS_IOC_INCLUDE_DEV_ALIAS); > + if (ret < 0) > + die_errno("F2FS_IOC_INCLUDE_DEV_ALIAS failed"); > + printf("%s device alias range of %s\n", argv[1], argv[2]); > + } else if (!strcmp(argv[1], "status")) { > + u32 status = 0; > + > + ret = ioctl(fd, F2FS_IOC_GET_DEV_ALIAS_STATUS, &status); > + if (ret < 0) > + die_errno("F2FS_IOC_GET_DEV_ALIAS_STATUS failed"); > + > + printf("device alias status of %s: %s\n", argv[2], > + status == F2FS_DEV_ALIAS_STATUS_EXCLUDED ? "excluded" : "included"); > + } else { > + fputs("Wrong request type\n\n", stderr); > + fputs(cmd->cmd_help, stderr); > + exit(1); > + } > + > + exit(0); > +} > + > #define freeze_desc "freeze filesystem" > #define freeze_help "f2fs_io freeze [directory_path]\n\n" > > @@ -2603,6 +2648,7 @@ const struct cmd_desc cmd_list[] = { > CMD(get_advise), > CMD(ioprio), > CMD(ftruncate), > + CMD(dev_alias), > CMD(test_create_perf), > CMD(test_lookup_perf), > CMD(freeze), > diff --git a/tools/f2fs_io/f2fs_io.h b/tools/f2fs_io/f2fs_io.h > index b0d4099..57d96b7 100644 > --- a/tools/f2fs_io/f2fs_io.h > +++ b/tools/f2fs_io/f2fs_io.h > @@ -96,6 +96,9 @@ typedef u32 __be32; > #define F2FS_IOC_START_ATOMIC_REPLACE _IO(F2FS_IOCTL_MAGIC, 25) > #define F2FS_IOC_GET_DEV_ALIAS_FILE _IOR(F2FS_IOCTL_MAGIC, 26, __u32) > #define F2FS_IOC_IO_PRIO _IOW(F2FS_IOCTL_MAGIC, 27, __u32) > +#define F2FS_IOC_EXCLUDE_DEV_ALIAS _IO(F2FS_IOCTL_MAGIC, 28) > +#define F2FS_IOC_INCLUDE_DEV_ALIAS _IO(F2FS_IOCTL_MAGIC, 29) > +#define F2FS_IOC_GET_DEV_ALIAS_STATUS _IOR(F2FS_IOCTL_MAGIC, 30, __u32) > > #ifndef FSCRYPT_POLICY_V1 > #define FSCRYPT_POLICY_V1 0 > @@ -200,6 +203,10 @@ enum { > F2FS_IOPRIO_WRITE = 1, /* high write priority */ > }; > > +/* for F2FS_IOC_GET_DEV_ALIAS_STATUS */ > +#define F2FS_DEV_ALIAS_STATUS_INCLUDED 0 > +#define F2FS_DEV_ALIAS_STATUS_EXCLUDED 1 > + > #ifndef FS_IMMUTABLE_FL > #define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */ > #endif