From: Jeff Layton <jlayton@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: dhowells@redhat.com, idryomov@gmail.com, xiubli@redhat.com,
ceph-devel@vger.kernel.org, linux-cachefs@redhat.com,
linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH v2 6/6] ceph: convert ceph_readpages to ceph_readahead
Date: Wed, 17 Feb 2021 10:46:35 -0500 [thread overview]
Message-ID: <c15e08fdf282b7775e0c3cc7f9139659836a065f.camel@kernel.org> (raw)
In-Reply-To: <20210217151548.GL2858050@casper.infradead.org>
On Wed, 2021-02-17 at 15:15 +0000, Matthew Wilcox wrote:
> On Wed, Feb 17, 2021 at 07:58:45AM -0500, Jeff Layton wrote:
> > +static void ceph_readahead_cleanup(struct address_space *mapping, void *priv)
> > {
> > + struct inode *inode = mapping->host;
> > struct ceph_inode_info *ci = ceph_inode(inode);
> > + int got = (int)(uintptr_t)priv;
> >
> >
> >
> >
> > if (got)
> > ceph_put_cap_refs(ci, got);
> > }
> > +const struct netfs_read_request_ops ceph_readahead_netfs_ops = {
> > + .init_rreq = ceph_init_rreq,
> > + .is_cache_enabled = ceph_is_cache_enabled,
> > + .begin_cache_operation = ceph_begin_cache_operation,
> > + .issue_op = ceph_netfs_issue_op,
> > + .expand_readahead = ceph_netfs_expand_readahead,
> > + .clamp_length = ceph_netfs_clamp_length,
> > + .cleanup = ceph_readahead_cleanup,
> > +};
>
> It looks to me like this netfs_read_request_ops is the same as the
> ceph_readpage_netfs_ops except for the addition of ceph_readahead_cleanup.
> If so, since readpage passes NULL as 'priv', the two read_request_ops
> can be the same ... right?
>
Yeah. I can also do the same for the write_begin one. The only
difference there is check_write_begin op, and it's only called in the
write_begin helper.
> also, you don't need that '(int)' cast -- can be just:
>
> int got = (uintptr_t)priv;
Got it, fixed. I'll do some testing with this and re-post in a few days
if it all looks good.
Thanks!
--
Jeff Layton <jlayton@kernel.org>
prev parent reply other threads:[~2021-02-17 15:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210217125845.10319-1-jlayton@kernel.org>
2021-02-17 12:58 ` [PATCH v2 1/6] ceph: disable old fscache readpage handling Jeff Layton
2021-02-19 5:09 ` Xiubo Li
2021-02-22 14:47 ` Jeff Layton
2021-02-17 12:58 ` [PATCH v2 2/6] ceph: rework PageFsCache handling Jeff Layton
2021-02-17 14:38 ` Matthew Wilcox
2021-02-17 14:59 ` Jeff Layton
2021-02-17 12:58 ` [PATCH v2 3/6] ceph: fix fscache invalidation Jeff Layton
2021-02-17 12:58 ` [PATCH v2 4/6] ceph: convert readpage to fscache read helper Jeff Layton
2021-02-17 12:58 ` [PATCH v2 5/6] ceph: plug write_begin into " Jeff Layton
2021-02-17 12:58 ` [PATCH v2 6/6] ceph: convert ceph_readpages to ceph_readahead Jeff Layton
2021-02-17 15:15 ` Matthew Wilcox
2021-02-17 15:46 ` Jeff Layton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c15e08fdf282b7775e0c3cc7f9139659836a065f.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=ceph-devel@vger.kernel.org \
--cc=dhowells@redhat.com \
--cc=idryomov@gmail.com \
--cc=linux-cachefs@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=willy@infradead.org \
--cc=xiubli@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).