Merge tag 'folio-5.18d' of git://git.infradead.org/users/willy/pagecache
[linux-2.6-microblaze.git] / fs / ceph / cache.c
index 7d22850..ddea999 100644 (file)
@@ -29,26 +29,25 @@ void ceph_fscache_register_inode_cookie(struct inode *inode)
        if (!(inode->i_state & I_NEW))
                return;
 
-       WARN_ON_ONCE(ci->fscache);
+       WARN_ON_ONCE(ci->netfs_ctx.cache);
 
-       ci->fscache = fscache_acquire_cookie(fsc->fscache, 0,
-                                            &ci->i_vino, sizeof(ci->i_vino),
-                                            &ci->i_version, sizeof(ci->i_version),
-                                            i_size_read(inode));
+       ci->netfs_ctx.cache =
+               fscache_acquire_cookie(fsc->fscache, 0,
+                                      &ci->i_vino, sizeof(ci->i_vino),
+                                      &ci->i_version, sizeof(ci->i_version),
+                                      i_size_read(inode));
 }
 
-void ceph_fscache_unregister_inode_cookie(struct ceph_inode_infoci)
+void ceph_fscache_unregister_inode_cookie(struct ceph_inode_info *ci)
 {
-       struct fscache_cookie *cookie = ci->fscache;
-
-       fscache_relinquish_cookie(cookie, false);
+       fscache_relinquish_cookie(ceph_fscache_cookie(ci), false);
 }
 
 void ceph_fscache_use_cookie(struct inode *inode, bool will_modify)
 {
        struct ceph_inode_info *ci = ceph_inode(inode);
 
-       fscache_use_cookie(ci->fscache, will_modify);
+       fscache_use_cookie(ceph_fscache_cookie(ci), will_modify);
 }
 
 void ceph_fscache_unuse_cookie(struct inode *inode, bool update)
@@ -58,9 +57,10 @@ void ceph_fscache_unuse_cookie(struct inode *inode, bool update)
        if (update) {
                loff_t i_size = i_size_read(inode);
 
-               fscache_unuse_cookie(ci->fscache, &ci->i_version, &i_size);
+               fscache_unuse_cookie(ceph_fscache_cookie(ci),
+                                    &ci->i_version, &i_size);
        } else {
-               fscache_unuse_cookie(ci->fscache, NULL, NULL);
+               fscache_unuse_cookie(ceph_fscache_cookie(ci), NULL, NULL);
        }
 }
 
@@ -69,14 +69,14 @@ void ceph_fscache_update(struct inode *inode)
        struct ceph_inode_info *ci = ceph_inode(inode);
        loff_t i_size = i_size_read(inode);
 
-       fscache_update_cookie(ci->fscache, &ci->i_version, &i_size);
+       fscache_update_cookie(ceph_fscache_cookie(ci), &ci->i_version, &i_size);
 }
 
 void ceph_fscache_invalidate(struct inode *inode, bool dio_write)
 {
        struct ceph_inode_info *ci = ceph_inode(inode);
 
-       fscache_invalidate(ceph_inode(inode)->fscache,
+       fscache_invalidate(ceph_fscache_cookie(ci),
                           &ci->i_version, i_size_read(inode),
                           dio_write ? FSCACHE_INVAL_DIO_WRITE : 0);
 }