From patchwork Wed Dec 11 00:14:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LongPing Wei X-Patchwork-Id: 13902628 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 EB21EE7717F for ; Wed, 11 Dec 2024 00:14:54 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tLANT-0004mX-1t; Wed, 11 Dec 2024 00:14:54 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tLANR-0004mQ-Jo for linux-f2fs-devel@lists.sourceforge.net; Wed, 11 Dec 2024 00:14:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: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=JY/egANZ1IlZmwOkWBtDSUQisRRSOI7ZL/UXKhOuitQ=; b=E1oG+7mkYf9PFDC8T576iiYcuy h2ALRTk7FqpqfbGId7hNeMBIiVG/hpEXtsg6lpJt+ZJvr7zKAfkJpJV+TrukFL5Nsssb8JWpomezL ehTHB5XCEazrMHwU2hKybkeaC4gFgghGAP6lrF4PwygErEISTaoWpd1v3prtsRtgisOA=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To: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=JY/egANZ1IlZmwOkWBtDSUQisRRSOI7ZL/UXKhOuitQ=; b=Q 9d9Mmo6oixEao9jvGEjAH/ClM1afC5gmvQUA6yvn/EirvPKFWCi/XjL4yWR5AaVhf3kUys7m7+Tob 95XrnDU7JswTswSTvdl6uDxFarlfRbkhfg4I7lLj/MuZMJNIlG4jj6ei/mz3WvOVRP2TtnWNaTeLW 8kok3Ipibd3efXI8=; Received: from mail-eastasiaazon11010044.outbound.protection.outlook.com ([52.101.128.44] helo=HK2PR02CU002.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tLANQ-0002RU-4I for linux-f2fs-devel@lists.sourceforge.net; Wed, 11 Dec 2024 00:14:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sa06drDxSjS9QzvrbGaodh5Qnl7tHz4I2Hg4ILyBjro238lGsKoTlk7sIOs64kcwmQ1VTZoMNYSaIiPInlmsWWv+APZVsZc4Lk0mjVCsNWcCn/HLUnnINzfyZSqB1uFJnu4GQY+f31MwMLxlyEnnvAPHK7Rr0NuTbMAf+97+S9WOjh15T8sDfxuII52DcwlKdfusauvggkWMWeEqQWByK/7puGcwjTpqJnIqKJNXnz1e+f/om/NFzYaAN+FiK+dqFgkIQ8dltATOZsfkJTIOS3RP76Z0DhytutIBUZ62MguCavL8cmPrj1zpNpY4i+pr+sUhHiuJwRs4xNUOjjkFXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JY/egANZ1IlZmwOkWBtDSUQisRRSOI7ZL/UXKhOuitQ=; b=iSH2ZbQsvgUV+hm+6iqZqVZ08gnoK7H9AK6UcMK3cQQiCxZotxZgZ8RBkykP+jbLOn7w6EHyMFBMhcxp1smq52efUoVK9fH3lO9+SMuroFxCGBzjBtXYPWuOaQjrJvJXKui85pc4AMUheiy57v77OZ/o6gTRmAGz0z/JBeXskuMuy+Cta5lZaUtaDKIw37M7Y5XMezOfj5eSTu0iMmDHz/CgA24Uzy0riH7LObntLgDU7cFNd8k+7apNaLNev0hJGITiELWxAeP29NzyFVSkMv7P9Hrb1ypSJGaudrPZHdLt+bu43XUh8welBMw2/4yAxetygLP2gewcbbBsEF7TSQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JY/egANZ1IlZmwOkWBtDSUQisRRSOI7ZL/UXKhOuitQ=; b=u/EjtYexEg8uN231MT91zivkDnYzQpwaNIsZUf63HA/s/C2TxzJlJtsSW6vgz7lK0GxMl2Ce/Lc+dn9766yRaKA2BuxTuYvi0dGIRFGkUcNbxGcXw/mXS923p7Fpi6mL/IcrcXcSPi1neodbAGg4WMmpihT6iYXHNPcJ/QFaE4w= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEZPR02MB7967.apcprd02.prod.outlook.com (2603:1096:101:22a::14) by SEZPR02MB5591.apcprd02.prod.outlook.com (2603:1096:101:38::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15; Wed, 11 Dec 2024 00:14:35 +0000 Received: from SEZPR02MB7967.apcprd02.prod.outlook.com ([fe80::5723:5b88:ed4c:d49b]) by SEZPR02MB7967.apcprd02.prod.outlook.com ([fe80::5723:5b88:ed4c:d49b%3]) with mapi id 15.20.8230.016; Wed, 11 Dec 2024 00:14:35 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Wed, 11 Dec 2024 08:14:04 +0800 Message-Id: <20241211001404.4120186-1-weilongping@oppo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SI1PR02CA0028.apcprd02.prod.outlook.com (2603:1096:4:1f4::6) To SEZPR02MB7967.apcprd02.prod.outlook.com (2603:1096:101:22a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR02MB7967:EE_|SEZPR02MB5591:EE_ X-MS-Office365-Filtering-Correlation-Id: a16f061e-ed67-4977-f8e7-08dd1978cb18 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|366016|52116014|38350700014; X-Microsoft-Antispam-Message-Info: c1JKsxJt4xyIHIiheV8FiZK0tF3CLLZsSjSv3RiJAMduRAuCb9l8ivT2l0n7egW1pgl5182tAXWbme5Zm+9vWFbWBMH9QP8lGRVbTrAfIjZ117fF/yEg5VwI8MxrJD57Vqp9x5XKPe8fHxDGT69AWa2l2Sd7BoXXwrOOt5T3Jgq9H/tky+KgsXG5JOQIlmt4xt2FufnjzI81gmJ50lci8ClgbqjfE6yTcbdTcxEzll++I6wpOWO2sLLkCUfEEMMdo7eHG8cYMcA09xxaMlZRmH+nfL1AToNYHvHyujgCOl2NxLFSdYE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33HUFBE8OIdu4iJfPVIKaa8Cw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEZPR02MB7967.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FxtamBhPmf+kfNN4KbxTOlZ3lxFeR2GATnQ9N1UhKQkw/w4P1bpG5mv2hiWi07YYl1f1dGMCUm0qXODBUwdy8z2NMyldclInnfSkV0eprgVeblQJ3Kj61jKwpXnEjhZ94Lifb29SCGHjKIwWviZNTdf6HqYAYaddH8eXX8wuicoc67u70tbeGk0F6ZrTMbaRRenXt4ByEzGE11DGosoXER/ye8zDQABuyrJd9GX9Jpfv2R7xpY5ymzfMQPnNA2nK1hVwfKWEk80anK5M8lBNtAkRcSBd5oVIM5u+XsgftlMVZo7ItMI5tI6O5AYDo107EiDRGU4jjpPoVAVlDuETtnWMAYDjhhtp333tWXkjUBXFtYFsctnRovZfuIVDP8ylrD8QI2Tr+nin2vRN7clJ1GBDn7dLAaIvnjmEYRYo6aYEqPnUwvtFfO48VWtJUFlsluSeEohOPMRBmbyWTs1wPKEAOiolpP9WjqqUN6mwtwVRn/nw8VH1F8ND7Esp/5nJqTyIYNgpN0FEaC3gQYpaBeJFujjmmJ466s5PAmBuHQC9nZuee21l7QbLY9VpJuhMEvpxaRFsXIAwRejFXy3EKtEZbaF3oTR5shCuRcSN4+RABAji0S0qgBkgMy0Cl2+I0PszVmrrPMU9fFqMK6jNMc+wwN+1cTqt2yyZbNrhyh/0bCXemr037redsbKt7i9w2NFSVuXyK3OzKFJATs4S9d6xirAO6T//U0uQyTQPJkjKXIPKz46n/MXjTF91RhlnwDtwrptPZQRttQPcO7ESbpZbAiolyX6Pu8bDoG9ubcWJ5cVLIMwfdDaS0wYJjOVziP3jpBCv0Ep3t8JXwvIDpg4nyrJUlFFitYlz9P3L3GeV41if2aM5V1utc4Gg3RdtQE+HC/17CeHE/v4R79MDLm5r5xis6e/jZmoH71OcYy8F2cE2N9IjTR6xEffSyOGcBYnXdcvg1DwEzOM380ilaCeAanvtHXMxYJ+9TvQydJCa5QZnhg9NPglFsGpbX2T56ZwKPb7l+YoA7xlOD5sfPGJafncF40AojpOkujuT/Gq7kWajokRi1AbVDy/7XG6zet/bilMnzAxIDr7dNx9/vrPsCaUWqiN7SiSv9d+4fArUX9BvYD3DlISzJRLGAS4X/L3Y/IgC9puywwZ67diQ9EdloccxDkoFKQ3K6sisLgAmWUPdb9ENwpxbSGFIsQr+1VnfpWpj4lR4y/BzO/j5yMN0dF0fZ1ryMvMgTAGHycr3ovPOD4h7DVsW3CkqbkkzgzOSDcVdWr/JyFblp/+/UGlyHV1P8ixKsliPCfjFoZ/OB0vc7H+38tCTLxQ9f5OFLY/JZEBvbMC8Bqe3Only/HnRJBszuY9RZTF+RAr0Od1MlodQvPotyiMdBCN0pB53ksSfMnY4b5e/BvQGhEQ8MW5p45MRNz56rjW4r2Xs+Ku8zagNb22ZzVKwYuGYf3dPCm8xDk9VRj76Uzj7WuTXGQ+kyibPDJUIwpZxcl0/RpBumFFb2CTtCNAiT+lK/oWQ+UquKRSp4i9EG2+dCDHvEnF+cQvc3sMnJaeVaC1mUpWq8A6n4jwEXmM++HUzm4/RshLnIPDIADtLDsEFbbh4pg== X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: a16f061e-ed67-4977-f8e7-08dd1978cb18 X-MS-Exchange-CrossTenant-AuthSource: SEZPR02MB7967.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2024 00:14:35.2946 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bKUJ9nvXFNVXJftQ5I/dYNbS8cVsIJ7ciwWiifNtY4N2RQTH+IJDPWggrpMGuAhC+37FhabUpOtXRbrkNzuL8Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB5591 X-Headers-End: 1tLANQ-0002RU-4I Subject: [f2fs-dev] [PATCH v2 1/2] f2fs-tools: use pread and pwrite when they are available. 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: LongPing Wei via Linux-f2fs-devel From: LongPing Wei Reply-To: LongPing Wei Cc: panglu2022@gmail.com, LongPing Wei , linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This patch wants to reduce the number of system calls to improve performance. pread and pwrite will only be used when the target platform support them. Signed-off-by: LongPing Wei Reviewed-by: Sheng Yong Reviewed-by: Chao Yu --- configure.ac | 4 +++- lib/libf2fs_io.c | 32 +++++++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 2053a65..ddfc3b0 100644 --- a/configure.ac +++ b/configure.ac @@ -182,6 +182,7 @@ AC_TYPE_SIZE_T AC_FUNC_GETMNTENT AC_CHECK_FUNCS_ONCE([ add_key + clock_gettime fallocate fsetxattr fstat @@ -192,8 +193,9 @@ AC_CHECK_FUNCS_ONCE([ getuid keyctl memset + pread + pwrite setmntent - clock_gettime ]) AS_IF([test "$ac_cv_header_byteswap_h" = "yes"], diff --git a/lib/libf2fs_io.c b/lib/libf2fs_io.c index 520ae03..2030440 100644 --- a/lib/libf2fs_io.c +++ b/lib/libf2fs_io.c @@ -279,6 +279,12 @@ static int dcache_io_read(long entry, __u64 offset, off_t blk) if (fd < 0) return fd; +#ifdef HAVE_PREAD + if (pread(fd, dcache_buf + entry * F2FS_BLKSIZE, F2FS_BLKSIZE, offset) < 0) { + MSG(0, "\n pread() fail.\n"); + return -1; + } +#else if (lseek(fd, offset, SEEK_SET) < 0) { MSG(0, "\n lseek fail.\n"); return -1; @@ -287,6 +293,7 @@ static int dcache_io_read(long entry, __u64 offset, off_t blk) MSG(0, "\n read() fail.\n"); return -1; } +#endif dcache_lastused[entry] = ++dcache_usetick; dcache_valid[entry] = true; dcache_blk[entry] = blk; @@ -393,10 +400,15 @@ int dev_read_version(void *buf, __u64 offset, size_t len) { if (c.sparse_mode) return 0; +#ifdef HAVE_RPEAD + if (pread(c.kd, buf, len, (off_t)offset) < 0) + return -1; +#else if (lseek(c.kd, (off_t)offset, SEEK_SET) < 0) return -1; if (read(c.kd, buf, len) < 0) return -1; +#endif return 0; } @@ -535,10 +547,15 @@ int dev_read(void *buf, __u64 offset, size_t len) fd = __get_device_fd(&offset); if (fd < 0) return fd; +#ifdef HAVE_PREAD + if (pread(fd, buf, len, (off_t)offset) < 0) + return -1; +#else if (lseek(fd, (off_t)offset, SEEK_SET) < 0) return -1; if (read(fd, buf, len) < 0) return -1; +#endif return 0; } @@ -615,9 +632,6 @@ static int __dev_write(void *buf, __u64 offset, size_t len, enum rw_hint whint) if (fd < 0) return fd; - if (lseek(fd, (off_t)offset, SEEK_SET) < 0) - return -1; - #if ! defined(__MINGW32__) if (c.need_whint && (c.whint != whint)) { u64 hint = whint; @@ -629,8 +643,15 @@ static int __dev_write(void *buf, __u64 offset, size_t len, enum rw_hint whint) } #endif +#ifdef HAVE_PWRITE + if (pwrite(fd, buf, len, (off_t)offset) < 0) + return -1; +#else + if (lseek(fd, (off_t)offset, SEEK_SET) < 0) + return -1; if (write(fd, buf, len) < 0) return -1; +#endif c.need_fsync = true; @@ -663,10 +684,15 @@ int dev_write_block(void *buf, __u64 blk_addr, enum rw_hint whint) int dev_write_dump(void *buf, __u64 offset, size_t len) { +#ifdef HAVE_PWRITE + if (pwrite(c.dump_fd, buf, len, (off_t)offset) < 0) + return -1; +#else if (lseek(c.dump_fd, (off_t)offset, SEEK_SET) < 0) return -1; if (write(c.dump_fd, buf, len) < 0) return -1; +#endif return 0; } From patchwork Wed Dec 11 00:14:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LongPing Wei X-Patchwork-Id: 13902629 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 B039AE77182 for ; Wed, 11 Dec 2024 00:14:55 +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 1tLANT-0008OZ-96; Wed, 11 Dec 2024 00:14:55 +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 1tLANS-0008OS-6H for linux-f2fs-devel@lists.sourceforge.net; Wed, 11 Dec 2024 00:14:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=MIME-Version:Content-Type:Content-Transfer-Encoding :References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=3OrDzgu8AS1QKRIzR1AKKi8ZBS9DAvpuhxDPK3L6pxs=; b=BD52iPI7NrUuTfFc9M+xNG7grP A+RsD7ZW7u+TGep+goh1lArgVp1ZKa2pzg7N7Pq+3lGqezJAoHTHpjRcxP1xyGl+nCAfkb8uJbf67 8+l9S43D70NuzP0AbeFpyUKFENKIJ40tI/040pDneJYWCzBrwuKuax1Ak39YSbDE+K7o=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=MIME-Version:Content-Type:Content-Transfer-Encoding:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=3OrDzgu8AS1QKRIzR1AKKi8ZBS9DAvpuhxDPK3L6pxs=; b=N8g2ohhMiny1U38yzuHb7MxdpZ u4yzp6eUaEtElwspj/4OfVWVAcjVRZVbq6Z2KjLTrAIpSxz4AXgrgOrXcBJb69XIKosPJmT8wcDBf pd9leTg45ZQPbo2f2igs9dVxVQndWk3QzKAqMtT38NIVHiCpYDygRhJ7SG/9Tgu+pG10=; Received: from mail-eastasiaazon11010044.outbound.protection.outlook.com ([52.101.128.44] helo=HK2PR02CU002.outbound.protection.outlook.com) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tLANR-0002RU-DI for linux-f2fs-devel@lists.sourceforge.net; Wed, 11 Dec 2024 00:14:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hVVAbrBvAujHHa2O3hfgO+wSy2Ybi2/imiyRnYmiDwwE8b9HX4ChVN77l9pmlfD7osH81NiP4Pw28nXuNGX43GHCzTjhiPCP8tRx/txtwivQfKHo82LhpGzkEV8OoU8c/IvqwX4udFuEZGz4xJvAT8UfPGu5GLF/dvna3P0J4Fgq3/88UQK2/6JvtefwUIr066op167SF+yyRFuDOB1ecTeu87+RFi5wAE6bZgXWwWQ1tXyB4TUrF7hfkcCnOxqZnn95luC1dJC3I59qOSjzUX0B60a/CmZRXTr0WcD+h0ahxKX8Ytr+aGwHPhvi6IxWGyJiRU11YLpz5ifxQZEHJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3OrDzgu8AS1QKRIzR1AKKi8ZBS9DAvpuhxDPK3L6pxs=; b=KCQlyJSQZPnIvgbNRygRoFYEPGTjdGrhc0CTv009fT9CNSwOc0Phao+cImJHxa09/+ZOpKJd1CmHaV0YZ4S6FWfc2asHLU4x/esPvIrePwCRz71pp6EFtUGE/6DuiRvplGBl/ibE9O66p8yfw2dnJG4RcWnKEW+HMGyaPW+ss3vxLxfZCOMzjfJm1r7EKNZQuJ9Yj5Nx/oloPtzwu0EVEQaNROMFUpw2uvjmK6H46fPNslksDFcqwdzDl/2eeoSRNsuDaKeIjowfn4r2zyqNhb0L5/8ArsazH4QfAuyLNHBv94f7lc2LsTyutD7LhP4xhBuoyJLnS86gYd3RQjEZ5g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oppo.com; dmarc=pass action=none header.from=oppo.com; dkim=pass header.d=oppo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oppo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3OrDzgu8AS1QKRIzR1AKKi8ZBS9DAvpuhxDPK3L6pxs=; b=iYZiAyupP7Ai877TFLLb66R6nPJT8UUO8hkRXlk0vYU75JnuJv43+VczrWicrqCGcUMCDjZJNtNMX3VKrfx4QJkl9MoUaLW8B6yMZoCa7HySo4zSC1we+xozrzJaTg0kRZedF7lj98w60qUHuiczCIZiAMFvbxbEJPuhO3aY9GY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oppo.com; Received: from SEZPR02MB7967.apcprd02.prod.outlook.com (2603:1096:101:22a::14) by SEZPR02MB5591.apcprd02.prod.outlook.com (2603:1096:101:38::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15; Wed, 11 Dec 2024 00:14:47 +0000 Received: from SEZPR02MB7967.apcprd02.prod.outlook.com ([fe80::5723:5b88:ed4c:d49b]) by SEZPR02MB7967.apcprd02.prod.outlook.com ([fe80::5723:5b88:ed4c:d49b%3]) with mapi id 15.20.8230.016; Wed, 11 Dec 2024 00:14:47 +0000 To: jaegeuk@kernel.org, chao@kernel.org Date: Wed, 11 Dec 2024 08:14:06 +0800 Message-Id: <20241211001404.4120186-2-weilongping@oppo.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241211001404.4120186-1-weilongping@oppo.com> References: <20241211001404.4120186-1-weilongping@oppo.com> X-ClientProxiedBy: SI1PR02CA0028.apcprd02.prod.outlook.com (2603:1096:4:1f4::6) To SEZPR02MB7967.apcprd02.prod.outlook.com (2603:1096:101:22a::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR02MB7967:EE_|SEZPR02MB5591:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b7de6a9-4ecb-46c4-da64-08dd1978d258 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|366016|52116014|38350700014; X-Microsoft-Antispam-Message-Info: fifuSQ7xm8mrOvQ1QT0H598EoiHlu26umblrqFsi2aICDKBinFDxAWglu52YAH/2SPp2ED7Y6k121KyiHhl4AnM14K/f2YyQx5Io+nbuqcuJ9hQlytabDSEy29fOwNKOekq0VVrk1dlhb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TxAV5yhfYwB+vSWz5G3TNtHnzuXRIA0raD7L50Au/mdkgX0G8OyiauSaW/REqDtCKhEVTyNc979+pBixkFBWT1BfyaJghPrpEhEOXgfz1x6EP/VqMzPyYdf4lDaQvcFfopiMESO8keIcQFawGKvJ7OXuMTjEaPhSKnSVzzyuXpK0qBhJvTdvyPqKWTEVxBt0x4aH4w8IrQagHYw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SEZPR02MB7967.apcprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(52116014)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sXcnNaPKs+jAlEq5i88ij6y6UkILfXfLp8v6jdEUC2/CFLXne0nEu2yvUAZgRc5+ECxv0HwubcaTKyj8ECnmLlLcjPmfxpK1HUL/Gzec8+FWU6pMz/5zixRG3xZo3BQKv9KrOB/cG2vruWC7Eb+NOSOVLIY5zBc6jNPfrBk9m1hvHmxUyFzvw/cnnx50lCJC6dloAzz0i5d3RX/67LvEM+nDVCPK7AvNebIJZI+FDCkX2ml74XOssR9M0kTydqSGIXUJEzmuGTT6Ka3SgrX9eCOKXX4Hr1avbvfe/CQ41RXWKcnb7sX8kz5qPNpOyGElevCyb73hvF0JOCDnF7YjGDrIEDDRHVJQIpHyb6N0Zg5MpIrTm3VtxS/KgTG/MFfxlB1el4qMkIG/AZvfNYrCH4kOej8xtvPa4Cd/oSzvLAoM+SmGIsFI5kh84cfGUlIBY6c9FGEtPpz7uu1qEovDZ+nsjClKNxBuGfXcuNVYfb4AUXu+aKraSf/nOtNUJG85dQk76I95Traw+jTqUzA79aZ0oBHgXyk/Ql3lFgE9W/MeUZB8o92x4A9uFqYlI9JCxVB5N77nMPnHyshJ/KdVQjiQaYWhdc3fUZy8hBMtrVsu2/0SiFLmOdpisWxPxJt2FiQXGhfKHO+YUXr00kTZKIYc8id3L0Y+c2jjrPp05W1UAGRW7KLTBjg/zdwlLGJmMOQQHIHjQPzuqLVy9REKHGziVMPc6pLgtGJplievRMTFSdmY6iqYg2xemzC3F6BlB/UmBwSnl9bez/4iX//GTesChlYviDFnPQdQOSgSG4KcBFDrHKHuXw0MpzRHNHFNjVuMOS2pZZVbK6JDKvxop2vcvxHdJxUUFlOWzOH6vYm67NKV5CkKvrgJhLVqDuw3A+tKPxgxMNTNydFvwbdV4rI4Y7Ww2dzh6LgODk7Z9JtTMurvPJMbzZIDDyfG+9E/houVJXPZDWYtSShvmsWi6L+xTaY66AOumwEGb/n1uzDHCbn7rS+40aDRz+uHfBDDgQuF2pTcx/YVs4h5wSHx/jjX/rdGK0weCy3FVZ7MDcPoM3Vp4QSYwR4e35g8TeI+VtLrCun4OBmmBDjDIS5SuQ6DU0lYRjZXWK4RKpzGUuGcfyt97iodUg8/acPQMBytKtU8bzWc1wfknqZjr/oefxI4xBB+8dNezvDWO8x0rj8DAXvPduyve2hnOy5K9NH6bIuf0294IXUXkCGGIKSVahTl25GuUZR/dELRFER7Y1aZIKP7rcll4zctM1bEnLtCkYvOZFXQhU+vCO/szm/D7dUbqzOxmHcc0qn4hVzjmjLAZPS2V8/9xMs2roKLT5nosmiHen07anEq0G/kC1Ahjyqz/317sdOl3VHnyIBAF9n3H60KSdm3GeKnAhAttsBhEKQQ3rMlyEspQOvYTZ3WAof+GxvxQcS4plvduFyYDioM/RiCR2RzlTUwCrHi83OM+vGJNRq9l9a62JoGu8ijPXJ9taUrGNI43YZCkyZanEHVrJbpe6x3xSAjwRnU1eyH0I9uW6OrqcqciVhHlVz5sdYrFKwtubPVhXb6fNRGcPcEameG7S4DfVky4vw09FyJFjLz749GCqgWujBk7VIiOw== X-OriginatorOrg: oppo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3b7de6a9-4ecb-46c4-da64-08dd1978d258 X-MS-Exchange-CrossTenant-AuthSource: SEZPR02MB7967.apcprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Dec 2024 00:14:47.4627 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f1905eb1-c353-41c5-9516-62b4a54b5ee6 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: G1UYbBoYwI+5gGNVNMWL8+B49ap3b0U00xrAYCHGGkxlNOBBTcehjgDYBVjsmWiUjF9LUv71UINBMapBQ/Wy1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEZPR02MB5591 X-Headers-End: 1tLANR-0002RU-DI Subject: [f2fs-dev] [PATCH v2 2/2] f2fs-tools: add HAVE_PREAD and HAVE_PWRITE 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: LongPing Wei via Linux-f2fs-devel From: LongPing Wei Reply-To: LongPing Wei Cc: panglu2022@gmail.com, LongPing Wei , linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This patch will enable pread and pwrite support on Android platform. Signed-off-by: LongPing Wei Reviewed-by: Sheng Yong Reviewed-by: Chao Yu --- include/android_config.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/android_config.h b/include/android_config.h index f5cd4de..b11e2e4 100644 --- a/include/android_config.h +++ b/include/android_config.h @@ -36,6 +36,8 @@ #define HAVE_FSTAT64 1 #define HAVE_GETMNTENT 1 #define HAVE_MEMSET 1 +#define HAVE_PREAD 1 +#define HAVE_PWRITE 1 #define HAVE_SELINUX_ANDROID_H 1 #define HAVE_SETMNTENT 1 #define HAVE_SPARSE_SPARSE_H 1