void cifs_fscache_release_client_cookie(struct TCP_Server_Info *server) { cFYI(1, "CIFS: release client cookie (0x%p/0x%p)", server, server->fscache); fscache_relinquish_cookie(server->fscache, 0); server->fscache = NULL; }
void v9fs_cache_session_put_cookie(struct v9fs_session_info *v9ses) { p9_debug(P9_DEBUG_FSC, "session %p put cookie %p\n", v9ses, v9ses->fscache); fscache_relinquish_cookie(v9ses->fscache, 0); v9ses->fscache = NULL; }
/* * Dispose of a per-client cookie */ void nfs_fscache_release_client_cookie(struct nfs_client *clp) { // dfprintk(FSCACHE, "NFS: releasing client cookie (0x%p/0x%p)\n", ; fscache_relinquish_cookie(clp->fscache, 0); clp->fscache = NULL; }
void cifs_fscache_release_inode_cookie(struct inode *inode) { struct cifsInodeInfo *cifsi = CIFS_I(inode); if (cifsi->fscache) { cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache); fscache_relinquish_cookie(cifsi->fscache, 0); cifsi->fscache = NULL; } }
/* * Release a per-inode cookie. */ void nfs_fscache_release_inode_cookie(struct inode *inode) { struct nfs_inode *nfsi = NFS_I(inode); // dfprintk(FSCACHE, "NFS: clear cookie (0x%p/0x%p)\n", ; fscache_relinquish_cookie(nfsi->fscache, 0); nfsi->fscache = NULL; }
/* * Retire a per-inode cookie, destroying the data attached to it. */ void nfs_fscache_zap_inode_cookie(struct inode *inode) { struct nfs_inode *nfsi = NFS_I(inode); // dfprintk(FSCACHE, "NFS: zapping cookie (0x%p/0x%p)\n", ; fscache_relinquish_cookie(nfsi->fscache, 1); nfsi->fscache = NULL; }
static void cifs_fscache_disable_inode_cookie(struct inode *inode) { struct cifsInodeInfo *cifsi = CIFS_I(inode); if (cifsi->fscache) { cFYI(1, "CIFS disabling inode cookie (0x%p)", cifsi->fscache); fscache_relinquish_cookie(cifsi->fscache, 1); cifsi->fscache = NULL; } }
static void cifs_fscache_disable_inode_cookie(struct inode *inode) { struct cifsInodeInfo *cifsi = CIFS_I(inode); if (cifsi->fscache) { cFYI(1, "%s: (0x%p)", __func__, cifsi->fscache); fscache_uncache_all_inode_pages(cifsi->fscache, inode); fscache_relinquish_cookie(cifsi->fscache, 1); cifsi->fscache = NULL; } }
void v9fs_cache_inode_put_cookie(struct inode *inode) { struct v9fs_inode *v9inode = V9FS_I(inode); if (!v9inode->fscache) return; P9_DPRINTK(P9_DEBUG_FSC, "inode %p put cookie %p", inode, v9inode->fscache); fscache_relinquish_cookie(v9inode->fscache, 0); v9inode->fscache = NULL; }
void v9fs_cache_inode_flush_cookie(struct inode *inode) { struct v9fs_inode *v9inode = V9FS_I(inode); if (!v9inode->fscache) return; p9_debug(P9_DEBUG_FSC, "inode %p flush cookie %p\n", inode, v9inode->fscache); fscache_relinquish_cookie(v9inode->fscache, 1); v9inode->fscache = NULL; }
/* * Release a per-inode cookie. */ void nfs_fscache_clear_inode(struct inode *inode) { struct nfs_fscache_inode_auxdata auxdata; struct nfs_inode *nfsi = NFS_I(inode); struct fscache_cookie *cookie = nfs_i_fscache(inode); dfprintk(FSCACHE, "NFS: clear cookie (0x%p/0x%p)\n", nfsi, cookie); memset(&auxdata, 0, sizeof(auxdata)); auxdata.mtime = timespec64_to_timespec(nfsi->vfs_inode.i_mtime); auxdata.ctime = timespec64_to_timespec(nfsi->vfs_inode.i_ctime); fscache_relinquish_cookie(cookie, &auxdata, false); nfsi->fscache = NULL; }
/* * clear an AFS inode */ void afs_evict_inode(struct inode *inode) { struct afs_permits *permits; struct afs_vnode *vnode; vnode = AFS_FS_I(inode); _enter("{%x:%u.%d} v=%u x=%u t=%u }", vnode->fid.vid, vnode->fid.vnode, vnode->fid.unique, vnode->cb_version, vnode->cb_expiry, vnode->cb_type); _debug("CLEAR INODE %p", inode); ASSERTCMP(inode->i_ino, ==, vnode->fid.vnode); truncate_inode_pages_final(&inode->i_data); clear_inode(inode); afs_give_up_callback(vnode); if (vnode->server) { spin_lock(&vnode->server->fs_lock); rb_erase(&vnode->server_rb, &vnode->server->fs_vnodes); spin_unlock(&vnode->server->fs_lock); afs_put_server(vnode->server); vnode->server = NULL; } ASSERT(list_empty(&vnode->writebacks)); ASSERT(!vnode->cb_promised); #ifdef CONFIG_AFS_FSCACHE fscache_relinquish_cookie(vnode->cache, 0); vnode->cache = NULL; #endif mutex_lock(&vnode->permits_lock); permits = vnode->permits; rcu_assign_pointer(vnode->permits, NULL); mutex_unlock(&vnode->permits_lock); if (permits) call_rcu(&permits->rcu, afs_zap_permits); _leave(""); }
/* * release a per-superblock cookie */ void nfs_fscache_release_super_cookie(struct super_block *sb) { struct nfs_server *nfss = NFS_SB(sb); // dfprintk(FSCACHE, "NFS: releasing superblock cookie (0x%p/0x%p)\n", ; fscache_relinquish_cookie(nfss->fscache, 0); nfss->fscache = NULL; if (nfss->fscache_key) { spin_lock(&nfs_fscache_keys_lock); rb_erase(&nfss->fscache_key->node, &nfs_fscache_keys); spin_unlock(&nfs_fscache_keys_lock); kfree(nfss->fscache_key); nfss->fscache_key = NULL; } }
/* * Deactivate a cell. */ static void afs_deactivate_cell(struct afs_net *net, struct afs_cell *cell) { _enter("%s", cell->name); afs_proc_cell_remove(cell); mutex_lock(&net->proc_cells_lock); hlist_del_rcu(&cell->proc_link); afs_dynroot_rmdir(net, cell); mutex_unlock(&net->proc_cells_lock); #ifdef CONFIG_AFS_FSCACHE fscache_relinquish_cookie(cell->cache, NULL, false); cell->cache = NULL; #endif _leave(""); }
void cifs_fscache_reset_inode_cookie(struct inode *inode) { struct cifsInodeInfo *cifsi = CIFS_I(inode); struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); struct fscache_cookie *old = cifsi->fscache; if (cifsi->fscache) { /* retire the current fscache cache and get a new one */ fscache_relinquish_cookie(cifsi->fscache, 1); cifsi->fscache = fscache_acquire_cookie( cifs_sb_master_tcon(cifs_sb)->fscache, &cifs_fscache_inode_object_def, cifsi); cFYI(1, "CIFS: new cookie 0x%p oldcookie 0x%p", cifsi->fscache, old); } }
/* * destroy a volume record */ void afs_put_volume(struct afs_volume *volume) { struct afs_vlocation *vlocation; int loop; if (!volume) return; _enter("%p", volume); ASSERTCMP(atomic_read(&volume->usage), >, 0); vlocation = volume->vlocation; /* to prevent a race, the decrement and the dequeue must be effectively * atomic */ down_write(&vlocation->cell->vl_sem); if (likely(!atomic_dec_and_test(&volume->usage))) { up_write(&vlocation->cell->vl_sem); _leave(""); return; } vlocation->vols[volume->type] = NULL; up_write(&vlocation->cell->vl_sem); /* finish cleaning up the volume */ #ifdef CONFIG_AFS_FSCACHE fscache_relinquish_cookie(volume->cache, 0); #endif afs_put_vlocation(vlocation); for (loop = volume->nservers - 1; loop >= 0; loop--) afs_put_server(volume->servers[loop]); bdi_destroy(&volume->bdi); kfree(volume); _leave(" [destroyed]"); }
/* * Replace a per-inode cookie due to revalidation detecting a file having * changed on the server. */ void nfs_fscache_reset_inode_cookie(struct inode *inode) { struct nfs_inode *nfsi = NFS_I(inode); struct nfs_server *nfss = NFS_SERVER(inode); struct fscache_cookie *old = nfsi->fscache; nfs_fscache_inode_lock(inode); if (nfsi->fscache) { /* retire the current fscache cache and get a new one */ fscache_relinquish_cookie(nfsi->fscache, 1); nfsi->fscache = fscache_acquire_cookie( nfss->nfs_client->fscache, &nfs_fscache_inode_object_def, nfsi); // dfprintk(FSCACHE, // "NFS: revalidation new cookie (0x%p/0x%p/0x%p/0x%p)\n", ; } nfs_fscache_inode_unlock(inode); }
/* * clear an AFS inode */ void afs_evict_inode(struct inode *inode) { struct afs_vnode *vnode; vnode = AFS_FS_I(inode); _enter("{%x:%u.%d}", vnode->fid.vid, vnode->fid.vnode, vnode->fid.unique); _debug("CLEAR INODE %p", inode); ASSERTCMP(inode->i_ino, ==, vnode->fid.vnode); truncate_inode_pages_final(&inode->i_data); clear_inode(inode); if (vnode->cb_interest) { afs_put_cb_interest(afs_i2net(inode), vnode->cb_interest); vnode->cb_interest = NULL; } while (!list_empty(&vnode->wb_keys)) { struct afs_wb_key *wbk = list_entry(vnode->wb_keys.next, struct afs_wb_key, vnode_link); list_del(&wbk->vnode_link); afs_put_wb_key(wbk); } #ifdef CONFIG_AFS_FSCACHE fscache_relinquish_cookie(vnode->cache, 0); vnode->cache = NULL; #endif afs_put_permits(vnode->permit_cache); _leave(""); }
void v9fs_cache_inode_reset_cookie(struct inode *inode) { struct v9fs_inode *v9inode = V9FS_I(inode); struct v9fs_session_info *v9ses; struct fscache_cookie *old; if (!v9inode->fscache) return; old = v9inode->fscache; spin_lock(&v9inode->fscache_lock); fscache_relinquish_cookie(v9inode->fscache, 1); v9ses = v9fs_inode2v9ses(inode); v9inode->fscache = fscache_acquire_cookie(v9ses->fscache, &v9fs_cache_inode_index_def, v9inode); p9_debug(P9_DEBUG_FSC, "inode %p revalidating cookie old %p new %p\n", inode, old, v9inode->fscache); spin_unlock(&v9inode->fscache_lock); }
/* * inode retrieval */ struct inode *afs_iget(struct super_block *sb, struct key *key, struct afs_fid *fid, struct afs_file_status *status, struct afs_callback *cb) { struct afs_iget_data data = { .fid = *fid }; struct afs_super_info *as; struct afs_vnode *vnode; struct inode *inode; int ret; _enter(",{%x:%u.%u},,", fid->vid, fid->vnode, fid->unique); as = sb->s_fs_info; data.volume = as->volume; inode = iget5_locked(sb, fid->vnode, afs_iget5_test, afs_iget5_set, &data); if (!inode) { _leave(" = -ENOMEM"); return ERR_PTR(-ENOMEM); } _debug("GOT INODE %p { vl=%x vn=%x, u=%x }", inode, fid->vid, fid->vnode, fid->unique); vnode = AFS_FS_I(inode); /* deal with an existing inode */ if (!(inode->i_state & I_NEW)) { _leave(" = %p", inode); return inode; } if (!status) { /* it's a remotely extant inode */ set_bit(AFS_VNODE_CB_BROKEN, &vnode->flags); ret = afs_vnode_fetch_status(vnode, NULL, key); if (ret < 0) goto bad_inode; } else { /* it's an inode we just created */ memcpy(&vnode->status, status, sizeof(vnode->status)); if (!cb) { /* it's a symlink we just created (the fileserver * didn't give us a callback) */ vnode->cb_version = 0; vnode->cb_expiry = 0; vnode->cb_type = 0; vnode->cb_expires = get_seconds(); } else { vnode->cb_version = cb->version; vnode->cb_expiry = cb->expiry; vnode->cb_type = cb->type; vnode->cb_expires = vnode->cb_expiry + get_seconds(); } } /* set up caching before mapping the status, as map-status reads the * first page of symlinks to see if they're really mountpoints */ inode->i_size = vnode->status.size; #ifdef CONFIG_AFS_FSCACHE vnode->cache = fscache_acquire_cookie(vnode->volume->cache, &afs_vnode_cache_index_def, vnode, true); #endif ret = afs_inode_map_status(vnode, key); if (ret < 0) goto bad_inode; /* success */ clear_bit(AFS_VNODE_UNSET, &vnode->flags); inode->i_flags |= S_NOATIME; unlock_new_inode(inode); _leave(" = %p [CB { v=%u t=%u }]", inode, vnode->cb_version, vnode->cb_type); return inode; /* failure */ bad_inode: #ifdef CONFIG_AFS_FSCACHE fscache_relinquish_cookie(vnode->cache, 0); vnode->cache = NULL; #endif iget_failed(inode); _leave(" = %d [bad]", ret); return ERR_PTR(ret); }
void cifs_fscache_release_super_cookie(struct cifsTconInfo *tcon) { cFYI(1, "CIFS: releasing superblock cookie (0x%p)", tcon->fscache); fscache_relinquish_cookie(tcon->fscache, 0); tcon->fscache = NULL; }
void cifs_fscache_release_super_cookie(struct cifs_tcon *tcon) { cFYI(1, "%s: (0x%p)", __func__, tcon->fscache); fscache_relinquish_cookie(tcon->fscache, 0); tcon->fscache = NULL; }