Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3402142rwe; Mon, 29 Aug 2022 10:58:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR5bgbWJjQiR99RcDmzfs4sJ8w1Bf3SulFPZ9C9sxq3XanmNecv8uihtPez5VNSPuKMTh7vD X-Received: by 2002:a17:906:8cb0:b0:730:d6f3:279e with SMTP id qr48-20020a1709068cb000b00730d6f3279emr15242853ejc.25.1661795905199; Mon, 29 Aug 2022 10:58:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661795905; cv=none; d=google.com; s=arc-20160816; b=I+jTJjyQQJMuWQl7EiPOzRRoTln+LTGvUqxtd3wCYqUIh2b0A+vjKsRL3K1ectQ0dc 7kRrBav7rJpMlP/pN8jt40bYhv50sG24FlMbVyvTtPZmVZxs5IlEHTcdcsC/HML0KKHV ntznsTSvA7MFhXSTKvLAUROaxoUS/MT8CI9ECWG/zvqXsFkk640qx+CI+cpv+JFlnV3G GXune7nmzMRCYCGHmJ51H9e29gDaZB1H7OBAPV0YDkgUszhP6VE0XNeBSq2BPc4+j1zp grdh+Hvjvk9U4d3mZ235h8wB4VVNHH3A6blGKDimg3jK4WXHkhcu8rKX+2pi/GyWrZXB 3AuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hVRyfTirpYxfGUIRfDPUg3N2h8ebpPIjEfmYSPqpEi8=; b=yxRDA19uUsrUsaAqQzHpn89VHHQ8TVXZJEpjyHsoEPjk5uZpuG9hfU2OGwBDpxQ1rM MDpPuLwLK0eImAiQvAzwJ1k6YUg8kSYD+gAuDzTQOILw9cm5I8tlHO2CvcHHk0NOMr7P mujPIxV+fjeKPrWy7o3IXUslPpsaf8q1owQVlKr+GsN/7APob4jECiXp0VznNhEqmb0p QHkbl5lUhqd8sNm5IS/1TTEix3QdR2qWOe/oTqapjcthnzJLMO1ahghnwggEVwFk9o9J f/jXfB4MTctcuktodtplhwVBsz/OE6qRb30HvoDREC0lL1YxcEgdsTTk/9gnrR+zK4Q9 bFQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="C7UlN/rx"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs30-20020a1709072d1e00b0073d87835a30si7765143ejc.961.2022.08.29.10.57.59; Mon, 29 Aug 2022 10:58:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="C7UlN/rx"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbiH2RnJ (ORCPT + 99 others); Mon, 29 Aug 2022 13:43:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbiH2RnI (ORCPT ); Mon, 29 Aug 2022 13:43:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E420B99B69; Mon, 29 Aug 2022 10:43:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 806C76130F; Mon, 29 Aug 2022 17:43:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9874AC433C1; Mon, 29 Aug 2022 17:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661794986; bh=cxPPEBu+h0eaOoH6XNEDFwMgVRSEBxa1GviI21BIVfs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C7UlN/rxD1A07hajY7oNwvf4lBdkN65KxQB1PgDkV11i2ewgJZBMX2GpgYHrDAsTy Oln4C1jZ/ElA2r8VlroJ3K03byLr/6Am5E58SrcKgBrWqbzl70Gns18A6A38kusjJv 6TxtKkFiWv2KEifYCjR7FYeB3c+69CN7AwLymixPQ/MDrVmUKfE7Aij5o89rj+NRG9 Si3LhZdBnIymBkFvxm/nm/0b6yK3L+URLZaYy/jBTOo8RtodYDoOC3yFMeWb11eTac wu3UH/FJDlPjhCmTOCt/B8QvlZq5enC/ZWKX/3pvfn9OVCww54CR/COe0N8aRbvF/P LI7nY9FXequHw== Date: Mon, 29 Aug 2022 10:43:04 -0700 From: Jaegeuk Kim To: Eric Biggers Cc: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org, linux-api@vger.kernel.org, linux-fscrypt@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Keith Busch Subject: Re: [PATCH v5 7/8] f2fs: support STATX_DIOALIGN Message-ID: References: <20220827065851.135710-1-ebiggers@kernel.org> <20220827065851.135710-8-ebiggers@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220827065851.135710-8-ebiggers@kernel.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On 08/26, Eric Biggers wrote: > From: Eric Biggers > > Add support for STATX_DIOALIGN to f2fs, so that direct I/O alignment > restrictions are exposed to userspace in a generic way. > > Signed-off-by: Eric Biggers Acked-by: Jaegeuk Kim > --- > fs/f2fs/file.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c > index 8e11311db21060..79177050732803 100644 > --- a/fs/f2fs/file.c > +++ b/fs/f2fs/file.c > @@ -847,6 +847,24 @@ int f2fs_getattr(struct user_namespace *mnt_userns, const struct path *path, > stat->btime.tv_nsec = fi->i_crtime.tv_nsec; > } > > + /* > + * Return the DIO alignment restrictions if requested. We only return > + * this information when requested, since on encrypted files it might > + * take a fair bit of work to get if the file wasn't opened recently. > + * > + * f2fs sometimes supports DIO reads but not DIO writes. STATX_DIOALIGN > + * cannot represent that, so in that case we report no DIO support. > + */ > + if ((request_mask & STATX_DIOALIGN) && S_ISREG(inode->i_mode)) { > + unsigned int bsize = i_blocksize(inode); > + > + stat->result_mask |= STATX_DIOALIGN; > + if (!f2fs_force_buffered_io(inode, WRITE)) { > + stat->dio_mem_align = bsize; > + stat->dio_offset_align = bsize; > + } > + } > + > flags = fi->i_flags; > if (flags & F2FS_COMPR_FL) > stat->attributes |= STATX_ATTR_COMPRESSED; > -- > 2.37.2