aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/fsclient.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/fsclient.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/fsclient.c')
-rw-r--r--fs/afs/fsclient.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c
index e54e6c2ad343..1e65fee36413 100644
--- a/fs/afs/fsclient.c
+++ b/fs/afs/fsclient.c
@@ -206,7 +206,7 @@ int afs_fs_fetch_file_status(struct afs_server *server,
206 struct afs_call *call; 206 struct afs_call *call;
207 __be32 *bp; 207 __be32 *bp;
208 208
209 _enter(",%x,{%x:%d},,", 209 _enter(",%x,{%x:%u},,",
210 key_serial(key), vnode->fid.vid, vnode->fid.vnode); 210 key_serial(key), vnode->fid.vid, vnode->fid.vnode);
211 211
212 call = afs_alloc_flat_call(&afs_RXFSFetchStatus, 16, (21 + 3 + 6) * 4); 212 call = afs_alloc_flat_call(&afs_RXFSFetchStatus, 16, (21 + 3 + 6) * 4);
@@ -265,25 +265,20 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call,
265 call->offset = 0; 265 call->offset = 0;
266 call->unmarshall++; 266 call->unmarshall++;
267 267
268 if (call->count < PAGE_SIZE) {
269 page = call->reply3;
270 buffer = kmap_atomic(page, KM_USER0);
271 memset(buffer + PAGE_SIZE - call->count, 0,
272 call->count);
273 kunmap_atomic(buffer, KM_USER0);
274 }
275
276 /* extract the returned data */ 268 /* extract the returned data */
277 case 2: 269 case 2:
278 _debug("extract data"); 270 _debug("extract data");
279 page = call->reply3; 271 if (call->count > 0) {
280 buffer = kmap_atomic(page, KM_USER0); 272 page = call->reply3;
281 ret = afs_extract_data(call, skb, last, buffer, call->count); 273 buffer = kmap_atomic(page, KM_USER0);
282 kunmap_atomic(buffer, KM_USER0); 274 ret = afs_extract_data(call, skb, last, buffer,
283 switch (ret) { 275 call->count);
284 case 0: break; 276 kunmap_atomic(buffer, KM_USER0);
285 case -EAGAIN: return 0; 277 switch (ret) {
286 default: return ret; 278 case 0: break;
279 case -EAGAIN: return 0;
280 default: return ret;
281 }
287 } 282 }
288 283
289 call->offset = 0; 284 call->offset = 0;
@@ -318,6 +313,14 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call,
318 if (!last) 313 if (!last)
319 return 0; 314 return 0;
320 315
316 if (call->count < PAGE_SIZE) {
317 _debug("clear");
318 page = call->reply3;
319 buffer = kmap_atomic(page, KM_USER0);
320 memset(buffer + call->count, 0, PAGE_SIZE - call->count);
321 kunmap_atomic(buffer, KM_USER0);
322 }
323
321 _leave(" = 0 [done]"); 324 _leave(" = 0 [done]");
322 return 0; 325 return 0;
323} 326}