aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/inode.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2007-05-09 05:33:45 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-09 15:30:50 -0400
commit416351f28d2b31d15ff73e9aff699b2163704c95 (patch)
tree4b43838415b2cb95dfc66f9bc5fdb36b0f245e6c /fs/afs/inode.c
parentef71c15c46a053818f7e69098ebb052b31ffa56b (diff)
AFS: AFS fixups
Make some miscellaneous changes to the AFS filesystem: (1) Assert RCU barriers on module exit to make sure RCU has finished with callbacks in this module. (2) Correctly handle the AFS server returning a zero-length read. (3) Split out data zapping calls into one function (afs_zap_data). (4) Rename some afs_file_*() functions to afs_*() where they apply to non-regular files too. (5) Be consistent about the presentation of volume ID:vnode ID in debugging output. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/afs/inode.c')
-rw-r--r--fs/afs/inode.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index c184a4ee5995..9c984cc42cc9 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -125,7 +125,7 @@ struct inode *afs_iget(struct super_block *sb, struct key *key,
125 struct inode *inode; 125 struct inode *inode;
126 int ret; 126 int ret;
127 127
128 _enter(",{%u,%u,%u},,", fid->vid, fid->vnode, fid->unique); 128 _enter(",{%x:%u.%u},,", fid->vid, fid->vnode, fid->unique);
129 129
130 as = sb->s_fs_info; 130 as = sb->s_fs_info;
131 data.volume = as->volume; 131 data.volume = as->volume;
@@ -204,6 +204,19 @@ bad_inode:
204} 204}
205 205
206/* 206/*
207 * mark the data attached to an inode as obsolete due to a write on the server
208 * - might also want to ditch all the outstanding writes and dirty pages
209 */
210void afs_zap_data(struct afs_vnode *vnode)
211{
212 kenter("zap data {%x:%u}", vnode->fid.vid, vnode->fid.vnode);
213
214 /* nuke all the non-dirty pages that aren't locked, mapped or being
215 * written back */
216 invalidate_remote_inode(&vnode->vfs_inode);
217}
218
219/*
207 * validate a vnode/inode 220 * validate a vnode/inode
208 * - there are several things we need to check 221 * - there are several things we need to check
209 * - parent dir data changes (rm, rmdir, rename, mkdir, create, link, 222 * - parent dir data changes (rm, rmdir, rename, mkdir, create, link,
@@ -258,10 +271,8 @@ int afs_validate(struct afs_vnode *vnode, struct key *key)
258 271
259 /* if the vnode's data version number changed then its contents are 272 /* if the vnode's data version number changed then its contents are
260 * different */ 273 * different */
261 if (test_and_clear_bit(AFS_VNODE_ZAP_DATA, &vnode->flags)) { 274 if (test_and_clear_bit(AFS_VNODE_ZAP_DATA, &vnode->flags))
262 _debug("zap data {%x:%d}", vnode->fid.vid, vnode->fid.vnode); 275 afs_zap_data(vnode);
263 invalidate_remote_inode(&vnode->vfs_inode);
264 }
265 276
266 clear_bit(AFS_VNODE_MODIFIED, &vnode->flags); 277 clear_bit(AFS_VNODE_MODIFIED, &vnode->flags);
267 mutex_unlock(&vnode->validate_lock); 278 mutex_unlock(&vnode->validate_lock);
@@ -278,7 +289,7 @@ error_unlock:
278/* 289/*
279 * read the attributes of an inode 290 * read the attributes of an inode
280 */ 291 */
281int afs_inode_getattr(struct vfsmount *mnt, struct dentry *dentry, 292int afs_getattr(struct vfsmount *mnt, struct dentry *dentry,
282 struct kstat *stat) 293 struct kstat *stat)
283{ 294{
284 struct inode *inode; 295 struct inode *inode;
@@ -301,7 +312,7 @@ void afs_clear_inode(struct inode *inode)
301 312
302 vnode = AFS_FS_I(inode); 313 vnode = AFS_FS_I(inode);
303 314
304 _enter("{%x:%d.%d} v=%u x=%u t=%u }", 315 _enter("{%x:%u.%d} v=%u x=%u t=%u }",
305 vnode->fid.vid, 316 vnode->fid.vid,
306 vnode->fid.vnode, 317 vnode->fid.vnode,
307 vnode->fid.unique, 318 vnode->fid.unique,