16 #include <linux/kernel.h>
17 #include <linux/module.h>
21 #include <linux/sched.h>
34 static int afs_inode_map_status(
struct afs_vnode *vnode,
struct key *
key)
38 _debug(
"FS: ft=%d lk=%d sz=%llu ver=%Lu mod=%hu",
41 (
unsigned long long) vnode->
status.size,
42 vnode->
status.data_version,
45 switch (vnode->
status.type) {
61 printk(
"kAFS: AFS vnode with undefined type\n");
65 #ifdef CONFIG_AFS_FSCACHE
67 fscache_attr_changed(vnode->cache);
99 static int afs_iget5_test(
struct inode *inode,
void *opaque)
103 return inode->
i_ino == data->
fid.vnode &&
112 static int afs_iget5_autocell_test(
struct inode *inode,
void *opaque)
120 static int afs_iget5_set(
struct inode *inode,
void *opaque)
123 struct afs_vnode *vnode = AFS_FS_I(inode);
137 int namesz,
struct key *key)
147 AFS_FS_I(dir)->
fid.vid, AFS_FS_I(dir)->
fid.vnode,
148 namesz, namesz, dev_name ?:
"");
158 afs_iget5_autocell_test, afs_iget5_set,
165 _debug(
"GOT INODE %p { ino=%lu, vl=%x, vn=%x, u=%x }",
169 vnode = AFS_FS_I(inode);
220 _debug(
"GOT INODE %p { vl=%x vn=%x, u=%x }",
223 vnode = AFS_FS_I(inode);
259 #ifdef CONFIG_AFS_FSCACHE
260 vnode->cache = fscache_acquire_cookie(vnode->
volume->cache,
265 ret = afs_inode_map_status(vnode, key);
278 #ifdef CONFIG_AFS_FSCACHE
279 fscache_relinquish_cookie(vnode->cache, 0);
283 _leave(
" = %d [bad]", ret);
299 invalidate_remote_inode(&vnode->
vfs_inode);
317 _enter(
"{v={%x:%u} fl=%lx},%x",
326 _debug(
"callback expired");
352 _debug(
"file already deleted");
400 return generic_drop_inode(inode);
411 vnode = AFS_FS_I(inode);
413 _enter(
"{%x:%u.%d} v=%u x=%u t=%u }",
421 _debug(
"CLEAR INODE %p", inode);
431 spin_lock(&vnode->
server->fs_lock);
433 spin_unlock(&vnode->
server->fs_lock);
441 #ifdef CONFIG_AFS_FSCACHE
442 fscache_relinquish_cookie(vnode->cache, 0);
465 _enter(
"{%x:%u},{n=%s},%x",
471 _leave(
" = 0 [unsupported]");
482 key = attr->
ia_file->private_data;