From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBA5FC47258 for ; Sat, 2 May 2020 00:29:36 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 9184321775; Sat, 2 May 2020 00:29:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="QzXT/C9f"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="ivikTslk"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="CpGv4rA1" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9184321775 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net 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.90_1) (envelope-from ) id 1jUg2C-0006Rt-9c; Sat, 02 May 2020 00:29:36 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUg2A-0006Rg-J4 for linux-f2fs-devel@lists.sourceforge.net; Sat, 02 May 2020 00:29:34 +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=ZqvFTE/VDPedXYGpjUxDK+lt8WwFX5TjbKO9MCB1/ic=; b=QzXT/C9fFdeJHIqF8d6OvO0tfw qoLN7V6QyJd7rPpW496OY/ZcTT6/7Vm8g14tidqVnUOwwFYGhG8KTQoHEcb2mL0l1tlHyq2N+bDio foP6IafRGaIu86BlGNXnqBb0GDq5puPMaKroY0d5KuZlJbobMo+33/b922evuYMQaCgg=; 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=ZqvFTE/VDPedXYGpjUxDK+lt8WwFX5TjbKO9MCB1/ic=; b=i vikTslkYbLLWMlF8tyl5nHHWpksqkhamy+kie1obz+nOKiZLuHs0khncDoRhXY9G7DCNDO0X65YMc b4bx8K8mET7Z6r+kuW3TVQ3Qj+Kmk0aUhx3dvtKfuZDU/MEELFFcirOr89gydKqHaEaeGWJWaMkGS sltVgG1EBmlevL90=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1jUg28-001Mi6-Lf for linux-f2fs-devel@lists.sourceforge.net; Sat, 02 May 2020 00:29:34 +0000 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 51EED208C3; Sat, 2 May 2020 00:29:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588379361; bh=op8KTw6dVH3HYKvOhSfU5jV+d/47qo+/s2bCO/zN6hQ=; h=From:To:Cc:Subject:Date:From; b=CpGv4rA1v+ERm3A8fDm19LH5Ly0clnJTdl8uksjKJ+ThzlplSb3OYe+tcSidfIlu6 WrMsSI0kjIgol80GWKPp8y6sZ6bi7OLuqcGr00sIAEfTqfLKGtmYGQna01FlYvBCmt hbO1dvt9K4dFCyTpXuIfvngdhq8GI0DIJol079ko= From: Jaegeuk Kim To: linux-f2fs-devel@lists.sourceforge.net Date: Fri, 1 May 2020 17:29:18 -0700 Message-Id: <20200502002920.76569-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.26.2.526.g744177e7f7-goog MIME-Version: 1.0 X-Headers-End: 1jUg28-001Mi6-Lf Subject: [f2fs-dev] [PATCH 1/3] f2fs_io: add fsync 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: , Cc: Jaegeuk Kim Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Signed-off-by: Jaegeuk Kim --- tools/f2fs_io/f2fs_io.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tools/f2fs_io/f2fs_io.c b/tools/f2fs_io/f2fs_io.c index c1edef1..c84b6ab 100644 --- a/tools/f2fs_io/f2fs_io.c +++ b/tools/f2fs_io/f2fs_io.c @@ -130,6 +130,30 @@ static void full_write(int fd, const void *buf, size_t count) } } +#define fsync_desc "fsync" +#define fsync_help \ +"f2fs_io fsync [file]\n\n" \ +"fsync given the file\n" \ + +static void do_fsync(int argc, char **argv, const struct cmd_desc *cmd) +{ + int fd; + + if (argc != 2) { + fputs("Excess arguments\n\n", stderr); + fputs(cmd->cmd_help, stderr); + exit(1); + } + + fd = xopen(argv[1], O_WRONLY, 0); + + if (fsync(fd) != 0) + die_errno("fsync failed"); + + printf("fsync a file\n"); + exit(0); +} + #define set_verity_desc "Set fs-verity" #define set_verity_help \ "f2fs_io set_verity [file]\n\n" \ @@ -780,6 +804,7 @@ static void do_reserve_cblocks(int argc, char **argv, const struct cmd_desc *cmd static void do_help(int argc, char **argv, const struct cmd_desc *cmd); const struct cmd_desc cmd_list[] = { _CMD(help), + CMD(fsync), CMD(set_verity), CMD(getflags), CMD(setflags), -- 2.26.2.526.g744177e7f7-goog _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel