From patchwork Thu Feb 13 18:01:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 13973813 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5CC44C021A4 for ; Thu, 13 Feb 2025 18:01:57 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tidXB-0006g2-0k; Thu, 13 Feb 2025 18:01:57 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tidX9-0006fu-Pp for linux-f2fs-devel@lists.sourceforge.net; Thu, 13 Feb 2025 18:01:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=etkomFXr4/IuIcI4nHoogOxKooxq2q9LY3Zkr/OSmOo=; b=C11cfH0BbmqMc2Qc8Pr396LGHr lxiX/pkbyh3xQh2QHqjV4q87g8SoZDxWUDztwGd28dVXYev2TqUsx5VmJ2SczstQUYhBrmIZhRWtf 8Rcs+v+WcSD9mIHTusSzi6lZCifEpTVxmxex7Ipa4zV1VfEjgQJdisVmq1eNZ6lM4ja4=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=etkomFXr4/IuIcI4nHoogOxKooxq2q9LY3Zkr/OSmOo=; b=R X5qcVBmyUMOLQphCPvbhXblgFp4p5luoMSvKIKtUMof1CYwmBIQLD89L1gXtvHEjYvAZyxBG+Wq4b /i846WmPku6bxa4G9A0zSR2JLhsJ6NG88owbrfsj2Kb18siU6RmY7AYmYkBFk2moHWUbxzrE6v+V0 BixHWP64B9IIgFxY=; Received: from nyc.source.kernel.org ([147.75.193.91]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tidX9-0000YX-1q for linux-f2fs-devel@lists.sourceforge.net; Thu, 13 Feb 2025 18:01:55 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 1ABCCA42821 for ; Thu, 13 Feb 2025 17:59:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 04F74C4CED1; Thu, 13 Feb 2025 18:01:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739469704; bh=Q+OW2aGUNBqv2QBKefyntT017Lfwys1/4EA4EGN3rXQ=; h=From:To:Cc:Subject:Date:From; b=SxwPjd1c0aICOqFsiiVB1vgiSO3XFbnUQZKSQiYJdVNSt6ke7lnkr4Q/xvGH8seA8 9adgl2lG0NEsz+Bwkz0hCyA/dNdayCGFwVAhmBsMA2xQ8dNhLDBVuMhsAO9pJ4aCF/ eJb8CZPAYlL33ZSMGDFMsKlI9bE0GO35dguMS8U8jYoshGyBZgIq6wqNL19+6Sb+4V VFTpGJVpwHo6Kp3X/VuuNL5HRruUJwRJQ2eUuni0+946Ru0fr+7s0pzG0Clf1l1Rug Rfa4nvVpxj2cQWy+3sS1TWlU+s4IYPP1RyIePDYySzz5nBSBeafaBJH8Av7DBqB8/k I7sc6O8624GWw== To: linux-f2fs-devel@lists.sourceforge.net Date: Thu, 13 Feb 2025 18:01:40 +0000 Message-ID: <20250213180142.1366047-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.48.1.601.g30ceb7b040-goog MIME-Version: 1.0 X-Headers-End: 1tidX9-0000YX-1q Subject: [f2fs-dev] [PATCH 1/2] f2fs_io: support fadvise dontneed, random, and noreuse X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jaegeuk Kim via Linux-f2fs-devel From: Jaegeuk Kim Reply-To: Jaegeuk Kim Cc: Jaegeuk Kim Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Jaegeuk Kim --- tools/f2fs_io/f2fs_io.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c index fa01f8fd4809..e7ad22e08ba5 100644 --- a/tools/f2fs_io/f2fs_io.c +++ b/tools/f2fs_io/f2fs_io.c @@ -441,7 +441,10 @@ static void do_shutdown(int argc, char **argv, const struct cmd_desc *cmd) "fadvice given the file\n" \ "advice can be\n" \ " willneed\n" \ +" dontneed\n" \ +" noreuse\n" \ " sequential\n" \ +" random\n" \ static void do_fadvise(int argc, char **argv, const struct cmd_desc *cmd) { @@ -458,8 +461,14 @@ static void do_fadvise(int argc, char **argv, const struct cmd_desc *cmd) if (!strcmp(argv[1], "willneed")) { advice = POSIX_FADV_WILLNEED; + } else if (!strcmp(argv[1], "dontneed")) { + advice = POSIX_FADV_DONTNEED; + } else if (!strcmp(argv[1], "noreuse")) { + advice = POSIX_FADV_NOREUSE; } else if (!strcmp(argv[1], "sequential")) { advice = POSIX_FADV_SEQUENTIAL; + } else if (!strcmp(argv[1], "random")) { + advice = POSIX_FADV_RANDOM; } else { fputs("Wrong advice\n\n", stderr); fputs(cmd->cmd_help, stderr);