diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-06-11 17:55:50 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-07-09 12:09:03 -0400 |
commit | b7eaefaa8722fd98e5c2632640d1abd2b0c83e84 (patch) | |
tree | 58547b04f1286e65081536fbf37c60ddbc66244a | |
parent | cc0dd2d1052aede2946ad1338a8f6f5d5c604740 (diff) |
NFS: Add debugging facility for NFS aops
Recent work in fs/nfs/file.c neglected to add appropriate trace debugging
for the NFS client's address space operations.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/file.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 202408d96ee8..6c447a37edef 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -335,6 +335,11 @@ static int nfs_write_begin(struct file *file, struct address_space *mapping, | |||
335 | struct page *page; | 335 | struct page *page; |
336 | index = pos >> PAGE_CACHE_SHIFT; | 336 | index = pos >> PAGE_CACHE_SHIFT; |
337 | 337 | ||
338 | dfprintk(PAGECACHE, "NFS: write_begin(%s/%s(%ld), %u@%lld)\n", | ||
339 | file->f_path.dentry->d_parent->d_name.name, | ||
340 | file->f_path.dentry->d_name.name, | ||
341 | mapping->host->i_ino, len, (long long) pos); | ||
342 | |||
338 | page = __grab_cache_page(mapping, index); | 343 | page = __grab_cache_page(mapping, index); |
339 | if (!page) | 344 | if (!page) |
340 | return -ENOMEM; | 345 | return -ENOMEM; |
@@ -355,6 +360,11 @@ static int nfs_write_end(struct file *file, struct address_space *mapping, | |||
355 | unsigned offset = pos & (PAGE_CACHE_SIZE - 1); | 360 | unsigned offset = pos & (PAGE_CACHE_SIZE - 1); |
356 | int status; | 361 | int status; |
357 | 362 | ||
363 | dfprintk(PAGECACHE, "NFS: write_end(%s/%s(%ld), %u@%lld)\n", | ||
364 | file->f_path.dentry->d_parent->d_name.name, | ||
365 | file->f_path.dentry->d_name.name, | ||
366 | mapping->host->i_ino, len, (long long) pos); | ||
367 | |||
358 | /* | 368 | /* |
359 | * Zero any uninitialised parts of the page, and then mark the page | 369 | * Zero any uninitialised parts of the page, and then mark the page |
360 | * as up to date if it turns out that we're extending the file. | 370 | * as up to date if it turns out that we're extending the file. |
@@ -389,6 +399,8 @@ static int nfs_write_end(struct file *file, struct address_space *mapping, | |||
389 | 399 | ||
390 | static void nfs_invalidate_page(struct page *page, unsigned long offset) | 400 | static void nfs_invalidate_page(struct page *page, unsigned long offset) |
391 | { | 401 | { |
402 | dfprintk(PAGECACHE, "NFS: invalidate_page(%p, %lu)\n", page, offset); | ||
403 | |||
392 | if (offset != 0) | 404 | if (offset != 0) |
393 | return; | 405 | return; |
394 | /* Cancel any unstarted writes on this page */ | 406 | /* Cancel any unstarted writes on this page */ |
@@ -397,13 +409,20 @@ static void nfs_invalidate_page(struct page *page, unsigned long offset) | |||
397 | 409 | ||
398 | static int nfs_release_page(struct page *page, gfp_t gfp) | 410 | static int nfs_release_page(struct page *page, gfp_t gfp) |
399 | { | 411 | { |
412 | dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page); | ||
413 | |||
400 | /* If PagePrivate() is set, then the page is not freeable */ | 414 | /* If PagePrivate() is set, then the page is not freeable */ |
401 | return 0; | 415 | return 0; |
402 | } | 416 | } |
403 | 417 | ||
404 | static int nfs_launder_page(struct page *page) | 418 | static int nfs_launder_page(struct page *page) |
405 | { | 419 | { |
406 | return nfs_wb_page(page->mapping->host, page); | 420 | struct inode *inode = page->mapping->host; |
421 | |||
422 | dfprintk(PAGECACHE, "NFS: launder_page(%ld, %llu)\n", | ||
423 | inode->i_ino, (long long)page_offset(page)); | ||
424 | |||
425 | return nfs_wb_page(inode, page); | ||
407 | } | 426 | } |
408 | 427 | ||
409 | const struct address_space_operations nfs_file_aops = { | 428 | const struct address_space_operations nfs_file_aops = { |
@@ -423,13 +442,19 @@ const struct address_space_operations nfs_file_aops = { | |||
423 | static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct page *page) | 442 | static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct page *page) |
424 | { | 443 | { |
425 | struct file *filp = vma->vm_file; | 444 | struct file *filp = vma->vm_file; |
445 | struct dentry *dentry = filp->f_path.dentry; | ||
426 | unsigned pagelen; | 446 | unsigned pagelen; |
427 | int ret = -EINVAL; | 447 | int ret = -EINVAL; |
428 | struct address_space *mapping; | 448 | struct address_space *mapping; |
429 | 449 | ||
450 | dfprintk(PAGECACHE, "NFS: vm_page_mkwrite(%s/%s(%ld), offset %lld)\n", | ||
451 | dentry->d_parent->d_name.name, dentry->d_name.name, | ||
452 | filp->f_mapping->host->i_ino, | ||
453 | (long long)page_offset(page)); | ||
454 | |||
430 | lock_page(page); | 455 | lock_page(page); |
431 | mapping = page->mapping; | 456 | mapping = page->mapping; |
432 | if (mapping != vma->vm_file->f_path.dentry->d_inode->i_mapping) | 457 | if (mapping != dentry->d_inode->i_mapping) |
433 | goto out_unlock; | 458 | goto out_unlock; |
434 | 459 | ||
435 | ret = 0; | 460 | ret = 0; |