Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp867719rdb; Tue, 30 Jan 2024 00:26:01 -0800 (PST) X-Google-Smtp-Source: AGHT+IHJgUBOYJI85yXDxyxohf7ZNywrU6rCD9XTH4hP7F/PNKwtlGpZiPAErHVNx2rUM7Yf/Z9P X-Received: by 2002:a17:90b:70f:b0:293:e300:97ef with SMTP id s15-20020a17090b070f00b00293e30097efmr5371357pjz.16.1706603161259; Tue, 30 Jan 2024 00:26:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706603161; cv=pass; d=google.com; s=arc-20160816; b=bet3YoSP9m3eYpvZ9jHn7Bzxjk31Yt5wWKHT2kA3bl26UBLxIbJt3w6XApShAImH9p x1ZN+wJ4eJm6/uYThY4s9VzMaZHGgIvwE/2m5YBsx2Nxjfts23FRm1K6OAokw9sJR0Ph 9nhU94A+aw/VdRZdOsewfDXa/6cu44ub0ClVUQXPE+hMLkzseufhb9mi52+a94fSCHAe /upNJ4scXphU/N1JHImA40uwr0kdtcfu7qIG6AMk0UFQ543iX+bh24MD1XgceVNVcPcB PeLThsNLGsAtm3o7YqskS6bmfXOaCI1kSQPevRfO8NqyAzBbLpqjQwpzt/gdXNJoUzO1 64rg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=GSBTAZkaFdXUfRVUNreI/1jKCmLOFtHTsR2KRB8G0ow=; fh=Dk305f9xd/mXvI4Xk50RrI85sYdneBYagoj2h78w+Ao=; b=nH0ZrhwtLj2CBhhNkzRyeMkLe1sbw8VYbviqvqqMsqaC21+8m+NRzEpbiklHwQWFiI gEdISRlX5hQeMdh+/qY+6JXdFweFoqKPoDh87CCwaMsSw7EQFUyn432K/sePPVR+HEvP 8uPAwmzxPPbxdapaVRxulEjBo67i89ZglI+u24QBhVfndZbIw/+PAHhq9ypAJm3KRmjl hA4lcTZgAbg7EBy8KFSoWq6Xw34yA26Ut7XVQj8H9QSCVvB2hXmHhwYr6VL48x2qroy/ i/zETw+k7mY1nyQ22CAPykuncx7pIsTGgFWwsIT8frM80jCoO+J/f3GzrrrdFRtGZ3EB UAJg== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-ext4+bounces-1021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1021-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id ch5-20020a17090af40500b00290c6b287a6si8991042pjb.56.2024.01.30.00.26.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 00:26:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=lst.de); spf=pass (google.com: domain of linux-ext4+bounces-1021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1021-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 7101828E5A4 for ; Tue, 30 Jan 2024 08:13:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E13FD54BF7; Tue, 30 Jan 2024 08:12:57 +0000 (UTC) X-Original-To: linux-ext4@vger.kernel.org Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A80957867; Tue, 30 Jan 2024 08:12:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.95.11.211 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706602377; cv=none; b=eRYJcyEbSnJ4zH+TwT0kyJZFyLEgOAHTmlcweiRkdCtOp+IpDBBsLla3Ms+ey3HeR22lgMOEIT22YgUWwRN+tYI4rQugjNyzJOXAveK5CzSk6xT5qDjz5dAW6pA2qWJb1z5rGHC6zLOtuS/n7whsiBqMhyJrRXhbNIjHzoobvGg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706602377; c=relaxed/simple; bh=jls7YOQ72GLvgQHm/mAzjhvRVz1wnpo0H1H1andnvhg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZaFTCZlKXJzlm1foyZPoOQnRSekVa2ZcgVSvXUJIyK+DSOTIV4DZFNMxeC4AubSFsadsG4fqlmS6henuQDyRgH6LJP2MNEA95u2C57nZaRBi9qyM2ZH1OcgW1qQQpvsrs32EzgLXRPzehgbDOHMJiZQhm5GLyh+KIkQ4QMFqkR0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de; spf=pass smtp.mailfrom=lst.de; arc=none smtp.client-ip=213.95.11.211 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lst.de Received: by verein.lst.de (Postfix, from userid 2407) id 7F53968C4E; Tue, 30 Jan 2024 09:12:52 +0100 (CET) Date: Tue, 30 Jan 2024 09:12:52 +0100 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org Subject: Re: [PATCH 1/3] fs: Introduce buffered_write_operations Message-ID: <20240130081252.GC22621@lst.de> References: <20240130055414.2143959-1-willy@infradead.org> <20240130055414.2143959-2-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240130055414.2143959-2-willy@infradead.org> User-Agent: Mutt/1.5.17 (2007-11-01) > +struct buffered_write_operations { > + int (*write_begin)(struct file *, struct address_space *mapping, > + loff_t pos, size_t len, struct folio **foliop, > + void **fsdata); > + int (*write_end)(struct file *, struct address_space *mapping, > + loff_t pos, size_t len, size_t copied, > + struct folio *folio, void **fsdata); > +}; Should write_begin simply return the folio or an ERR_PTR instead of the return by reference? I also wonder if the fsdata paramter should go away - if a fs needs to pass forth and back fsdata, generic/filemap_perform_write is probably the wrong abstraction for it. Otherwise this looks sane to me.