From: David Sterba Date: Mon, 23 Jan 2023 16:44:47 +0100 Subject: [Cluster-devel] [PATCH 7/7] mm: return an ERR_PTR from __filemap_get_folio In-Reply-To: <20230121065755.1140136-8-hch@lst.de> References: <20230121065755.1140136-1-hch@lst.de> <20230121065755.1140136-8-hch@lst.de> Message-ID: <20230123154447.GP11562@twin.jikos.cz> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Sat, Jan 21, 2023 at 07:57:55AM +0100, Christoph Hellwig wrote: > Instead of returning NULL for all errors, distinguish between: > > - no entry found and not asked to allocated (-ENOENT) > - failed to allocate memory (-ENOMEM) > - would block (-EAGAIN) > > so that callers don't have to guess the error based on the passed > in flags. > > Also pass through the error through the direct callers: > filemap_get_folio, filemap_lock_folio filemap_grab_folio > and filemap_get_incore_folio. > > Signed-off-by: Christoph Hellwig > --- > fs/afs/dir.c | 10 +++++----- > fs/afs/dir_edit.c | 2 +- > fs/afs/write.c | 4 ++-- For > fs/btrfs/disk-io.c | 2 +- Acked-by: David Sterba