[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a07c64e179e30c0962094eea5d1282977c4a4d90.camel@kernel.org>
Date: Mon, 16 Oct 2023 11:44:54 -0400
From: Jeff Layton <jlayton@...nel.org>
To: David Howells <dhowells@...hat.com>,
Steve French <smfrench@...il.com>
Cc: Matthew Wilcox <willy@...radead.org>,
Marc Dionne <marc.dionne@...istor.com>,
Paulo Alcantara <pc@...guebit.com>,
Ronnie Sahlberg <lsahlber@...hat.com>,
Shyam Prasad N <sprasad@...rosoft.com>,
Tom Talpey <tom@...pey.com>,
Dominique Martinet <asmadeus@...ewreck.org>,
Ilya Dryomov <idryomov@...il.com>,
Christian Brauner <christian@...uner.io>,
linux-afs@...ts.infradead.org, linux-cifs@...r.kernel.org,
linux-nfs@...r.kernel.org, ceph-devel@...r.kernel.org,
v9fs@...ts.linux.dev, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-cachefs@...hat.com
Subject: Re: [RFC PATCH 03/53] netfs: Note nonblockingness in the
netfs_io_request struct
On Fri, 2023-10-13 at 16:56 +0100, David Howells wrote:
> Allow O_NONBLOCK to be noted in the netfs_io_request struct. Also add a
> flag, NETFS_RREQ_BLOCKED to record if we did block.
>
> Signed-off-by: David Howells <dhowells@...hat.com>
> cc: Jeff Layton <jlayton@...nel.org>
> cc: linux-cachefs@...hat.com
> cc: linux-fsdevel@...r.kernel.org
> cc: linux-mm@...ck.org
> ---
> fs/netfs/objects.c | 2 ++
> include/linux/netfs.h | 2 ++
> 2 files changed, 4 insertions(+)
>
> diff --git a/fs/netfs/objects.c b/fs/netfs/objects.c
> index 85f428fc52e6..e41f9fc9bdd2 100644
> --- a/fs/netfs/objects.c
> +++ b/fs/netfs/objects.c
> @@ -37,6 +37,8 @@ struct netfs_io_request *netfs_alloc_request(struct address_space *mapping,
> INIT_LIST_HEAD(&rreq->subrequests);
> refcount_set(&rreq->ref, 1);
> __set_bit(NETFS_RREQ_IN_PROGRESS, &rreq->flags);
> + if (file && file->f_flags & O_NONBLOCK)
> + __set_bit(NETFS_RREQ_NONBLOCK, &rreq->flags);
> if (rreq->netfs_ops->init_request) {
> ret = rreq->netfs_ops->init_request(rreq, file);
> if (ret < 0) {
> diff --git a/include/linux/netfs.h b/include/linux/netfs.h
> index 282511090ead..b92e982ac4a0 100644
> --- a/include/linux/netfs.h
> +++ b/include/linux/netfs.h
> @@ -205,6 +205,8 @@ struct netfs_io_request {
> #define NETFS_RREQ_DONT_UNLOCK_FOLIOS 3 /* Don't unlock the folios on completion */
> #define NETFS_RREQ_FAILED 4 /* The request failed */
> #define NETFS_RREQ_IN_PROGRESS 5 /* Unlocked when the request completes */
> +#define NETFS_RREQ_NONBLOCK 6 /* Don't block if possible (O_NONBLOCK) */
> +#define NETFS_RREQ_BLOCKED 7 /* We blocked */
> const struct netfs_request_ops *netfs_ops;
> };
>
>
I'd prefer to see this patch squashed in with the first patches that
actually check for these flags. I can't look at this patch alone and
tell how it'll be used.
--
Jeff Layton <jlayton@...nel.org>
Powered by blists - more mailing lists