Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp4077957rdh; Fri, 29 Sep 2023 10:19:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFukdB9/xaLEywzcT+zDAMqYSTZSV0LGVu7rnY8yFFvdurqmVBsHbieYIs0/CpiFinoRl6A X-Received: by 2002:a05:6a21:99a0:b0:13e:9dba:ea43 with SMTP id ve32-20020a056a2199a000b0013e9dbaea43mr7612507pzb.2.1696007998093; Fri, 29 Sep 2023 10:19:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696007998; cv=pass; d=google.com; s=arc-20160816; b=oqd3kiTtvFCpIGUXsY8ShmV+aWdq7m3K/tLw/6YAjYUdoNSkZrcXzNLxuG+AtPH86e gJJsp8mZdniV1xe3PjcVAtWKYAtlvPpAsqMWuhKYnFhHj3jSbyuqkLNWTW/4sPV+6EUP spI1mPVv7TLohFR00U7tIHUYnTS5MnnCl1mZjQWMsQ4fFfreaGXixzPPe8FwglsnDKG8 pns9BTCcEmENMG2wfjLpSA4VXb1tkQ464QhZPvq/xgz25L2R0zEwkNYtwOECY77EQfQv Emo9XI4nIilqoEpyEb6JEuMoaCpzCm1jB4sb07DuBkSXFgSqyI3W1spaNI0JUzg6w/4y +eMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=KtPTSzdcV8V8QQwAZsysfSVzMBIG6Bu0nf5IFfytxI8=; fh=9G5Rk7kYUUbC45w/ckn1HonTVf1z24D2/EBItJKwYlU=; b=gV0+BzY47a3sQm+CMTcFsGe5STh0JIHieH/nxPUnoxDyJmWYckikKHlt49ul4A8nhk H+mPOVIne6WH1aC3ntmIBKnJWyAGZkbqOzRhicFFC1a2Wu+CXA3orcrE0tqUDaL7ddPi n9xHv7qQdDj1HHCxHBZUGMWKPECQTymmbenjK1nSPJ3m85PJZq3v5S95HvjCqskT5qCM 7vcmswxqpVTbl+IJ0/xV3dDCIlSa0Ia0k7axvbsUNaGGKvUN8/s8Q25Fkj4hVodNU47Y 0jiqukvCgZalx4xM1vgTeYTY05Pbwrk0g4FDPoTat/ioQQkn8l4RCg3pp5rQ2/vdwqBF Mlaw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=fbAcyR22; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=seTKJA7i; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id k33-20020a634b61000000b00578f23273a3si22093339pgl.738.2023.09.29.10.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 10:19:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=fbAcyR22; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=seTKJA7i; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 57BAA8177E2D; Fri, 29 Sep 2023 03:30:33 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233085AbjI2K3M (ORCPT + 99 others); Fri, 29 Sep 2023 06:29:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233094AbjI2K2t (ORCPT ); Fri, 29 Sep 2023 06:28:49 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DA46CCC; Fri, 29 Sep 2023 03:28:33 -0700 (PDT) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38SK9Tna022482; Fri, 29 Sep 2023 10:28:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=KtPTSzdcV8V8QQwAZsysfSVzMBIG6Bu0nf5IFfytxI8=; b=fbAcyR22Gc1LEJvKVpaHJe3Q6/hoqm/NKgqPAJ3VFwxbJBIB59xVdwgcDDi1EIb0crK0 6j9u1L1oAo8Mx4E2k0yPeFiFvSVU3HR+ybXL6KHV0t2agnJriPaFry5lhLiyec6EjJ0I 3MscpDiFFU33v+B6zCiUWEtj5Y6+EPRdDxfM/U5+1wYL0t+6eo6Dsy2Bg+HnvOIO8BQm 4B5dtKbL0h0rJ6j7u6xkUwnzSVWDfKTJTyiffLaxm5/3m+BCvTU1rT565m5Jl/flPJpq KiJscQQ3PidyT9p/ddnrrIxaw+mU9Op7I7OfBLKd7sW1lfQwnBXFpy1akJ0+LpkPf9iP Fg== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3t9qwbpbqe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Sep 2023 10:28:08 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 38TAGM2H015792; Fri, 29 Sep 2023 10:28:06 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2173.outbound.protection.outlook.com [104.47.57.173]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3t9pfh4vku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 29 Sep 2023 10:28:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kYQT0UCer5IyodTj3Rer5D3z9gJ+fvYvnAXgV1t9tu8BP7XbQtf2En5rr1dGAc1DOYPHfs/dL2wTuJ/f4PS6BSdMKQgDvuEvPuG04FboMz1ePWbtswvz1f25nEHq7pclz9LPiAeEvM/1YNDU8jgVSX7ayPv9/dktezprQc/LoxFHQYY9M7GBBZ33IUmxQ4TnH5D/EdprQBUyrIf3B/xkg997u/2wVcu64be66OyEWrF6o2wbK+Wr13vb8GGwuLq6V7BgmTPnqp3YEKtzWea4ExvU+MayT3QhdFRTGf/owM86mv5aHvA2tEJounlD7tDPGtlBLBYuT158MWE1Y95Jvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=KtPTSzdcV8V8QQwAZsysfSVzMBIG6Bu0nf5IFfytxI8=; b=IISIWmrpMBGdYk6kcfik9ScQUebdswEZxAH2u4o1To0wR2z9WOFqHGz03eFkx+kkxscmQTyZVZs45d6No9mYE5PDKVt1hz4p13qVTomG7/Yc3SsDFW7zk/SiIFHZY6dpSPSdOJ+Is4Vm34LFNWIUZWD0JRBnQFhZs2sfQL2+DLVSu/EDa9OrzoRmyetC13NK+8aIWCw2Vsw1t5Qxc87QNdiHV7oOQm0V2I6adlKc3oWV0cgKVSQMQgvrBuxDQtPDVH0cku9kddnNbALpCFLc/Jjif/fgbO+pNz97zrow8bh00SNB/kQAPgB73lYMwaRYM8Q7/PPTZu3vacMF1X6t/Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KtPTSzdcV8V8QQwAZsysfSVzMBIG6Bu0nf5IFfytxI8=; b=seTKJA7iNTc9HVamUYyHNfw7HLcZhQPxRSJYz2bhFM77d+tNF40PhK1gmS8vP5u2WLDghSRFURDdxn5ZeLsiw5plki9ewWEsMlSxapOCxsvIy8kmcEvf2gV085iz6N6URNRtg29Iz6f/Bne/q5hF+gJDA6Adc3S1tyw77u5Y9n8= Received: from DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) by PH7PR10MB6153.namprd10.prod.outlook.com (2603:10b6:510:1f7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Fri, 29 Sep 2023 10:28:04 +0000 Received: from DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::ebfd:c49c:6b8:6fce]) by DM6PR10MB4313.namprd10.prod.outlook.com ([fe80::ebfd:c49c:6b8:6fce%7]) with mapi id 15.20.6813.027; Fri, 29 Sep 2023 10:28:04 +0000 From: John Garry To: axboe@kernel.dk, kbusch@kernel.org, hch@lst.de, sagi@grimberg.me, jejb@linux.ibm.com, martin.petersen@oracle.com, djwong@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, chandan.babu@oracle.com, dchinner@redhat.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, tytso@mit.edu, jbongio@google.com, linux-api@vger.kernel.org, Prasad Singamsetty , John Garry Subject: [PATCH 04/21] fs: Add RWF_ATOMIC and IOCB_ATOMIC flags for atomic write support Date: Fri, 29 Sep 2023 10:27:09 +0000 Message-Id: <20230929102726.2985188-5-john.g.garry@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230929102726.2985188-1-john.g.garry@oracle.com> References: <20230929102726.2985188-1-john.g.garry@oracle.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH7PR10CA0001.namprd10.prod.outlook.com (2603:10b6:510:23d::23) To DM6PR10MB4313.namprd10.prod.outlook.com (2603:10b6:5:212::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR10MB4313:EE_|PH7PR10MB6153:EE_ X-MS-Office365-Filtering-Correlation-Id: 2caefeab-1db7-4013-d4b5-08dbc0d6c3e5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9XojNLjQp2KOQcAocMMe8sZveVdkIUVfR7l1kS0pLwLGm0sj9TNH7IgItiEfzsbW0hwBPda6pEZs3JD3rRWwGlfzuv5FMZwWmOR6M/RJcrqI6g1bUOsLLH0z7DqoIlBexi1ZwTCMEytsqZ1WL3OPcZQeHbv15tBmr21xliorQEpZl0tO1b1v74QOa3xT0Q1eNVsLTt58Iy3l53HnERdXBL9jrZ8ireZpWp6vJd5c1WBwcrbNSQtKlWr/eid7buzWfGHUV5M8yxxhIJjSDRQzbSo6omvoOavA287w28p6rOBRg/oWtMq2cywHfNnjBZrOgMFu3P4uSD3x/U3hUpvjUmmyqFRNIIaEcYnaVJ//GVY3VjLvy0cFfg6NFc4zjVOJ4qoRFltO5iHIG12R3c+G3gAYQX1w4xoKm40zNTfGaebWKcL4Zs3va0uHDjKzoj+RQfnvEUZHMEneTq3bU4Arlqnd+OXmHQHxKe6OeZdFuhw4Yp8r+xS2i/1QXn8TB1l5zKDwP+bm/MwBFbIK0j4nkvw8BgFhfKu05zQco5wIeE3U9TH+rvhoTM6Ob2yERVKINhuYDIpv2vNh7SQ1h27OOO4CNh/iZrNS3b1iYEv5Sx4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR10MB4313.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(136003)(39860400002)(366004)(346002)(376002)(396003)(230922051799003)(186009)(64100799003)(1800799009)(451199024)(6506007)(6512007)(921005)(107886003)(1076003)(26005)(2616005)(8936002)(54906003)(4326008)(36756003)(103116003)(66556008)(7416002)(2906002)(5660300002)(41300700001)(66946007)(86362001)(316002)(8676002)(66476007)(478600001)(38100700002)(6486002)(83380400001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?WIdeYez5Uw+UAKTrFEnomzrdo66dNnWBhwAP1CvfJb4zLoS+WvzvueuflCgo?= =?us-ascii?Q?aHb981xbWXSUlmjz11QkC5JbSZV1sVZThWst8NpavaPhn0WZU5vJEWAfCKUK?= =?us-ascii?Q?q+FPZHaGjhfRDT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?us-ascii?Q?pT7refFlJjP2ET6CNPFtFfyrfWIul2r4YqgQfS4kp0x6ptgHERy3iBGrZh6D?= =?us-ascii?Q?1kTuZsQeQy0MmN4iOtdFvrLtEV6rbdLkBY9PPoOLnXLc34b+WXkQrcXXAiMx?= =?us-ascii?Q?kLdZsYrfxvsN+GsCgMJq6y8M80UJ0Rg4g3g1HsnOFBDWdlvHbcWAL6yADbrF?= =?us-ascii?Q?rWBiX9qrj/Rdt1NvMV+IgU8P1nsgAOz9glmAxbsRu0ZdS4lo+uTetVDvkO4Q?= =?us-ascii?Q?jE0JCYcxnZggGLNSZmYrp+XUPPIwfxaFyEqGNoZYodvZeWDE8VIejsaIfcIZ?= =?us-ascii?Q?SpQPtha/ryUyCC2uy44jlkHfX0IxUceEB4v5HXi3Oip98Q3uGyxbQkkcToJq?= =?us-ascii?Q?Dh86CbzS4KGOwjxVgTfvtPPq1Y7HXrMETRm4qiX0/hIcaZ7UEshX2RVK/sRd?= =?us-ascii?Q?hVlE+JEuAsmixfzHd2XIZUjN+qdmvocu1jIWIm2z2+MdGcuOqdVUeaagHo/N?= =?us-ascii?Q?vpWs0MW6fuB8JgDandY0CHiwN9Na8PHXx6s+0WIgX7Yf+8GEtPmVePpe63fd?= =?us-ascii?Q?fbowJN36INMLiPUopDbW7oDIme4VdpoS+luIJzhRR+xOyYwIr5X2wJ7JAg9N?= =?us-ascii?Q?JA=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: =?us-ascii?Q?fwzMv9JcOmV/uMdFDZGcDqpTF5evxOQCqYsWfZKnczierXtTYGpRChHQzpxI?= =?us-ascii?Q?ojUjilwvnhzm3KdgK5xWfkr7R2CwBx/Dr1TKsrBxG7wHOO/X77M9xsAKLa45?= =?us-ascii?Q?PNXHZ0SCpkNpTtfzzOHXhoKURL6QjaGbBAuEcFIaqkApx7QkkK6Kde89mSJM?= =?us-ascii?Q?sK6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VS3SK2pV6/RThz55?= =?us-ascii?Q?fvF/E+iXj+zAxOejIhNgf7r0zvhDGg=3D=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2caefeab-1db7-4013-d4b5-08dbc0d6c3e5 X-MS-Exchange-CrossTenant-AuthSource: DM6PR10MB4313.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2023 10:28:04.6919 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /H1OEu1u3OWtgisvEf3u6ziR8hG9z5qbkMp/okR00K3I5OmkiUUj7sGKwscMqqVA387xDwN+kRcFVDckANa4oA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB6153 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-29_08,2023-09-28_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxscore=0 malwarescore=0 suspectscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309290089 X-Proofpoint-GUID: q17oT2fE9g3F2plciu8-Fk2NJ9yyT5FA X-Proofpoint-ORIG-GUID: q17oT2fE9g3F2plciu8-Fk2NJ9yyT5FA X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 29 Sep 2023 03:30:34 -0700 (PDT) From: Prasad Singamsetty Userspace may add flag RWF_ATOMIC to pwritev2() to indicate that the write is to be issued with torn write prevention, according to special alignment and length rules. Torn write prevention means that for a power or any other HW failure, all or none of the data will be committed to storage, but never a mix of old and new. For any syscall interface utilizing struct iocb, add IOCB_ATOMIC for iocb->ki_flags field to indicate the same. A call to statx will give the relevant atomic write info: - atomic_write_unit_min - atomic_write_unit_max Both values are a power-of-2. Applications can avail of atomic write feature by ensuring that the total length of a write is a power-of-2 in size and also sized between atomic_write_unit_min and atomic_write_unit_max, inclusive. Applications must ensure that the write is at a naturally-aligned offset in the file wrt the total write length. Signed-off-by: Prasad Singamsetty Signed-off-by: John Garry --- include/linux/fs.h | 1 + include/uapi/linux/fs.h | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/linux/fs.h b/include/linux/fs.h index b528f063e8ff..898952dee8eb 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -328,6 +328,7 @@ enum rw_hint { #define IOCB_SYNC (__force int) RWF_SYNC #define IOCB_NOWAIT (__force int) RWF_NOWAIT #define IOCB_APPEND (__force int) RWF_APPEND +#define IOCB_ATOMIC (__force int) RWF_ATOMIC /* non-RWF related bits - start at 16 */ #define IOCB_EVENTFD (1 << 16) diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index b7b56871029c..e3b4f5bc6860 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -301,8 +301,11 @@ typedef int __bitwise __kernel_rwf_t; /* per-IO O_APPEND */ #define RWF_APPEND ((__force __kernel_rwf_t)0x00000010) +/* Atomic Write */ +#define RWF_ATOMIC ((__force __kernel_rwf_t)0x00000020) + /* mask of flags supported by the kernel */ #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT |\ - RWF_APPEND) + RWF_APPEND | RWF_ATOMIC) #endif /* _UAPI_LINUX_FS_H */ -- 2.31.1