[Linux-cachefs] [PATCH 1/2] ceph: conversion to new fscache API

David Howells dhowells at redhat.com
Mon Nov 29 16:46:36 UTC 2021


Jeff Layton <jlayton at kernel.org> wrote:

> +void ceph_fscache_unregister_inode_cookie(struct ceph_inode_info* ci)
>  {
> -	return fscache_register_netfs(&ceph_cache_netfs);
> +	struct fscache_cookie* cookie = xchg(&ci->fscache, NULL);
> +
> +	fscache_relinquish_cookie(cookie, false);
>  }

xchg() should be excessive there.  This is only called from
ceph_evict_inode().  Also, if you're going to reset the pointer, it might be
worth poisoning it rather than nulling it.

David




More information about the Linux-cachefs mailing list