Re: [PATCH v2 6/6] ceph: convert ceph_readpages to ceph_readahead

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

also, you don't need that '(int)' cast -- can be just:

	int got = (uintptr_t)priv;



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux