diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2008-06-11 17:55:58 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-07-09 12:09:04 -0400 |
commit | 6da24bc9cfc645c619992e39aab09747164c9f14 (patch) | |
tree | a2d092a395d219db6b251d4d7f481ca0f9f7ecb0 /fs/nfs | |
parent | b7eaefaa8722fd98e5c2632640d1abd2b0c83e84 (diff) |
NFS: Use NFSDBG_FILE for all fops
Clean up: some fops use NFSDBG_FILE, some use NFSDBG_VFS. Let's use
NFSDBG_FILE for all fops, and consistently report file names instead
of inode numbers.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/dir.c | 10 | ||||
-rw-r--r-- | fs/nfs/direct.c | 4 | ||||
-rw-r--r-- | fs/nfs/file.c | 59 |
3 files changed, 43 insertions, 30 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index c962233c094a..b1940660502f 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -133,7 +133,7 @@ nfs_opendir(struct inode *inode, struct file *filp) | |||
133 | { | 133 | { |
134 | int res; | 134 | int res; |
135 | 135 | ||
136 | dfprintk(VFS, "NFS: open dir(%s/%s)\n", | 136 | dfprintk(FILE, "NFS: open dir(%s/%s)\n", |
137 | filp->f_path.dentry->d_parent->d_name.name, | 137 | filp->f_path.dentry->d_parent->d_name.name, |
138 | filp->f_path.dentry->d_name.name); | 138 | filp->f_path.dentry->d_name.name); |
139 | 139 | ||
@@ -531,7 +531,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
531 | struct nfs_fattr fattr; | 531 | struct nfs_fattr fattr; |
532 | long res; | 532 | long res; |
533 | 533 | ||
534 | dfprintk(VFS, "NFS: readdir(%s/%s) starting at cookie %Lu\n", | 534 | dfprintk(FILE, "NFS: readdir(%s/%s) starting at cookie %llu\n", |
535 | dentry->d_parent->d_name.name, dentry->d_name.name, | 535 | dentry->d_parent->d_name.name, dentry->d_name.name, |
536 | (long long)filp->f_pos); | 536 | (long long)filp->f_pos); |
537 | nfs_inc_stats(inode, NFSIOS_VFSGETDENTS); | 537 | nfs_inc_stats(inode, NFSIOS_VFSGETDENTS); |
@@ -598,7 +598,7 @@ out: | |||
598 | unlock_kernel(); | 598 | unlock_kernel(); |
599 | if (res > 0) | 599 | if (res > 0) |
600 | res = 0; | 600 | res = 0; |
601 | dfprintk(VFS, "NFS: readdir(%s/%s) returns %ld\n", | 601 | dfprintk(FILE, "NFS: readdir(%s/%s) returns %ld\n", |
602 | dentry->d_parent->d_name.name, dentry->d_name.name, | 602 | dentry->d_parent->d_name.name, dentry->d_name.name, |
603 | res); | 603 | res); |
604 | return res; | 604 | return res; |
@@ -609,7 +609,7 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin) | |||
609 | struct dentry *dentry = filp->f_path.dentry; | 609 | struct dentry *dentry = filp->f_path.dentry; |
610 | struct inode *inode = dentry->d_inode; | 610 | struct inode *inode = dentry->d_inode; |
611 | 611 | ||
612 | dfprintk(VFS, "NFS: llseek dir(%s/%s, %lld, %d)\n", | 612 | dfprintk(FILE, "NFS: llseek dir(%s/%s, %lld, %d)\n", |
613 | dentry->d_parent->d_name.name, | 613 | dentry->d_parent->d_name.name, |
614 | dentry->d_name.name, | 614 | dentry->d_name.name, |
615 | offset, origin); | 615 | offset, origin); |
@@ -640,7 +640,7 @@ out: | |||
640 | */ | 640 | */ |
641 | static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync) | 641 | static int nfs_fsync_dir(struct file *filp, struct dentry *dentry, int datasync) |
642 | { | 642 | { |
643 | dfprintk(VFS, "NFS: fsync dir(%s/%s) datasync %d\n", | 643 | dfprintk(FILE, "NFS: fsync dir(%s/%s) datasync %d\n", |
644 | dentry->d_parent->d_name.name, dentry->d_name.name, | 644 | dentry->d_parent->d_name.name, dentry->d_name.name, |
645 | datasync); | 645 | datasync); |
646 | 646 | ||
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 4757a2b326a1..08f6b040d289 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -890,7 +890,7 @@ ssize_t nfs_file_direct_read(struct kiocb *iocb, const struct iovec *iov, | |||
890 | count = iov_length(iov, nr_segs); | 890 | count = iov_length(iov, nr_segs); |
891 | nfs_add_stats(mapping->host, NFSIOS_DIRECTREADBYTES, count); | 891 | nfs_add_stats(mapping->host, NFSIOS_DIRECTREADBYTES, count); |
892 | 892 | ||
893 | dprintk("nfs: direct read(%s/%s, %zd@%Ld)\n", | 893 | dfprintk(FILE, "NFS: direct read(%s/%s, %zd@%Ld)\n", |
894 | file->f_path.dentry->d_parent->d_name.name, | 894 | file->f_path.dentry->d_parent->d_name.name, |
895 | file->f_path.dentry->d_name.name, | 895 | file->f_path.dentry->d_name.name, |
896 | count, (long long) pos); | 896 | count, (long long) pos); |
@@ -947,7 +947,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov, | |||
947 | count = iov_length(iov, nr_segs); | 947 | count = iov_length(iov, nr_segs); |
948 | nfs_add_stats(mapping->host, NFSIOS_DIRECTWRITTENBYTES, count); | 948 | nfs_add_stats(mapping->host, NFSIOS_DIRECTWRITTENBYTES, count); |
949 | 949 | ||
950 | dfprintk(VFS, "nfs: direct write(%s/%s, %zd@%Ld)\n", | 950 | dfprintk(FILE, "NFS: direct write(%s/%s, %zd@%Ld)\n", |
951 | file->f_path.dentry->d_parent->d_name.name, | 951 | file->f_path.dentry->d_parent->d_name.name, |
952 | file->f_path.dentry->d_name.name, | 952 | file->f_path.dentry->d_name.name, |
953 | count, (long long) pos); | 953 | count, (long long) pos); |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 6c447a37edef..78b26f875eee 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -119,7 +119,7 @@ nfs_file_open(struct inode *inode, struct file *filp) | |||
119 | { | 119 | { |
120 | int res; | 120 | int res; |
121 | 121 | ||
122 | dfprintk(VFS, "NFS: open file(%s/%s)\n", | 122 | dprintk("NFS: open file(%s/%s)\n", |
123 | filp->f_path.dentry->d_parent->d_name.name, | 123 | filp->f_path.dentry->d_parent->d_name.name, |
124 | filp->f_path.dentry->d_name.name); | 124 | filp->f_path.dentry->d_name.name); |
125 | 125 | ||
@@ -137,9 +137,15 @@ nfs_file_open(struct inode *inode, struct file *filp) | |||
137 | static int | 137 | static int |
138 | nfs_file_release(struct inode *inode, struct file *filp) | 138 | nfs_file_release(struct inode *inode, struct file *filp) |
139 | { | 139 | { |
140 | struct dentry *dentry = filp->f_path.dentry; | ||
141 | |||
142 | dprintk("NFS: release(%s/%s)\n", | ||
143 | dentry->d_parent->d_name.name, | ||
144 | dentry->d_name.name); | ||
145 | |||
140 | /* Ensure that dirty pages are flushed out with the right creds */ | 146 | /* Ensure that dirty pages are flushed out with the right creds */ |
141 | if (filp->f_mode & FMODE_WRITE) | 147 | if (filp->f_mode & FMODE_WRITE) |
142 | nfs_wb_all(filp->f_path.dentry->d_inode); | 148 | nfs_wb_all(dentry->d_inode); |
143 | nfs_inc_stats(inode, NFSIOS_VFSRELEASE); | 149 | nfs_inc_stats(inode, NFSIOS_VFSRELEASE); |
144 | return NFS_PROTO(inode)->file_release(inode, filp); | 150 | return NFS_PROTO(inode)->file_release(inode, filp); |
145 | } | 151 | } |
@@ -174,7 +180,7 @@ force_reval: | |||
174 | 180 | ||
175 | static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin) | 181 | static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin) |
176 | { | 182 | { |
177 | dfprintk(VFS, "NFS: llseek file(%s/%s, %lld, %d)\n", | 183 | dprintk("NFS: llseek file(%s/%s, %lld, %d)\n", |
178 | filp->f_path.dentry->d_parent->d_name.name, | 184 | filp->f_path.dentry->d_parent->d_name.name, |
179 | filp->f_path.dentry->d_name.name, | 185 | filp->f_path.dentry->d_name.name, |
180 | offset, origin); | 186 | offset, origin); |
@@ -216,16 +222,18 @@ static int nfs_do_fsync(struct nfs_open_context *ctx, struct inode *inode) | |||
216 | 222 | ||
217 | /* | 223 | /* |
218 | * Flush all dirty pages, and check for write errors. | 224 | * Flush all dirty pages, and check for write errors. |
219 | * | ||
220 | */ | 225 | */ |
221 | static int | 226 | static int |
222 | nfs_file_flush(struct file *file, fl_owner_t id) | 227 | nfs_file_flush(struct file *file, fl_owner_t id) |
223 | { | 228 | { |
224 | struct nfs_open_context *ctx = nfs_file_open_context(file); | 229 | struct nfs_open_context *ctx = nfs_file_open_context(file); |
225 | struct inode *inode = file->f_path.dentry->d_inode; | 230 | struct dentry *dentry = file->f_path.dentry; |
231 | struct inode *inode = dentry->d_inode; | ||
226 | int status; | 232 | int status; |
227 | 233 | ||
228 | dfprintk(VFS, "nfs: flush(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino); | 234 | dprintk("NFS: flush(%s/%s)\n", |
235 | dentry->d_parent->d_name.name, | ||
236 | dentry->d_name.name); | ||
229 | 237 | ||
230 | if ((file->f_mode & FMODE_WRITE) == 0) | 238 | if ((file->f_mode & FMODE_WRITE) == 0) |
231 | return 0; | 239 | return 0; |
@@ -250,7 +258,7 @@ nfs_file_read(struct kiocb *iocb, const struct iovec *iov, | |||
250 | if (iocb->ki_filp->f_flags & O_DIRECT) | 258 | if (iocb->ki_filp->f_flags & O_DIRECT) |
251 | return nfs_file_direct_read(iocb, iov, nr_segs, pos); | 259 | return nfs_file_direct_read(iocb, iov, nr_segs, pos); |
252 | 260 | ||
253 | dfprintk(VFS, "nfs: read(%s/%s, %lu@%lu)\n", | 261 | dprintk("NFS: read(%s/%s, %lu@%lu)\n", |
254 | dentry->d_parent->d_name.name, dentry->d_name.name, | 262 | dentry->d_parent->d_name.name, dentry->d_name.name, |
255 | (unsigned long) count, (unsigned long) pos); | 263 | (unsigned long) count, (unsigned long) pos); |
256 | 264 | ||
@@ -270,7 +278,7 @@ nfs_file_splice_read(struct file *filp, loff_t *ppos, | |||
270 | struct inode *inode = dentry->d_inode; | 278 | struct inode *inode = dentry->d_inode; |
271 | ssize_t res; | 279 | ssize_t res; |
272 | 280 | ||
273 | dfprintk(VFS, "nfs: splice_read(%s/%s, %lu@%Lu)\n", | 281 | dprintk("NFS: splice_read(%s/%s, %lu@%Lu)\n", |
274 | dentry->d_parent->d_name.name, dentry->d_name.name, | 282 | dentry->d_parent->d_name.name, dentry->d_name.name, |
275 | (unsigned long) count, (unsigned long long) *ppos); | 283 | (unsigned long) count, (unsigned long long) *ppos); |
276 | 284 | ||
@@ -287,7 +295,7 @@ nfs_file_mmap(struct file * file, struct vm_area_struct * vma) | |||
287 | struct inode *inode = dentry->d_inode; | 295 | struct inode *inode = dentry->d_inode; |
288 | int status; | 296 | int status; |
289 | 297 | ||
290 | dfprintk(VFS, "nfs: mmap(%s/%s)\n", | 298 | dprintk("NFS: mmap(%s/%s)\n", |
291 | dentry->d_parent->d_name.name, dentry->d_name.name); | 299 | dentry->d_parent->d_name.name, dentry->d_name.name); |
292 | 300 | ||
293 | status = nfs_revalidate_mapping(inode, file->f_mapping); | 301 | status = nfs_revalidate_mapping(inode, file->f_mapping); |
@@ -310,7 +318,7 @@ nfs_file_fsync(struct file *file, struct dentry *dentry, int datasync) | |||
310 | struct nfs_open_context *ctx = nfs_file_open_context(file); | 318 | struct nfs_open_context *ctx = nfs_file_open_context(file); |
311 | struct inode *inode = dentry->d_inode; | 319 | struct inode *inode = dentry->d_inode; |
312 | 320 | ||
313 | dfprintk(VFS, "NFS: fsync file(%s/%s) datasync %d\n", | 321 | dprintk("NFS: fsync file(%s/%s) datasync %d\n", |
314 | dentry->d_parent->d_name.name, dentry->d_name.name, | 322 | dentry->d_parent->d_name.name, dentry->d_name.name, |
315 | datasync); | 323 | datasync); |
316 | 324 | ||
@@ -502,9 +510,9 @@ static ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov, | |||
502 | if (iocb->ki_filp->f_flags & O_DIRECT) | 510 | if (iocb->ki_filp->f_flags & O_DIRECT) |
503 | return nfs_file_direct_write(iocb, iov, nr_segs, pos); | 511 | return nfs_file_direct_write(iocb, iov, nr_segs, pos); |
504 | 512 | ||
505 | dfprintk(VFS, "nfs: write(%s/%s(%ld), %lu@%Ld)\n", | 513 | dprintk("NFS: write(%s/%s, %lu@%Ld)\n", |
506 | dentry->d_parent->d_name.name, dentry->d_name.name, | 514 | dentry->d_parent->d_name.name, dentry->d_name.name, |
507 | inode->i_ino, (unsigned long) count, (long long) pos); | 515 | (unsigned long) count, (long long) pos); |
508 | 516 | ||
509 | result = -EBUSY; | 517 | result = -EBUSY; |
510 | if (IS_SWAPFILE(inode)) | 518 | if (IS_SWAPFILE(inode)) |
@@ -649,13 +657,15 @@ out: | |||
649 | */ | 657 | */ |
650 | static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl) | 658 | static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl) |
651 | { | 659 | { |
652 | struct inode * inode = filp->f_mapping->host; | 660 | struct inode *inode = filp->f_mapping->host; |
653 | int ret = -ENOLCK; | 661 | int ret = -ENOLCK; |
654 | 662 | ||
655 | dprintk("NFS: nfs_lock(f=%s/%ld, t=%x, fl=%x, r=%Ld:%Ld)\n", | 663 | dprintk("NFS: lock(%s/%s, t=%x, fl=%x, r=%lld:%lld)\n", |
656 | inode->i_sb->s_id, inode->i_ino, | 664 | filp->f_path.dentry->d_parent->d_name.name, |
665 | filp->f_path.dentry->d_name.name, | ||
657 | fl->fl_type, fl->fl_flags, | 666 | fl->fl_type, fl->fl_flags, |
658 | (long long)fl->fl_start, (long long)fl->fl_end); | 667 | (long long)fl->fl_start, (long long)fl->fl_end); |
668 | |||
659 | nfs_inc_stats(inode, NFSIOS_VFSLOCK); | 669 | nfs_inc_stats(inode, NFSIOS_VFSLOCK); |
660 | 670 | ||
661 | /* No mandatory locks over NFS */ | 671 | /* No mandatory locks over NFS */ |
@@ -683,9 +693,9 @@ out_err: | |||
683 | */ | 693 | */ |
684 | static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) | 694 | static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) |
685 | { | 695 | { |
686 | dprintk("NFS: nfs_flock(f=%s/%ld, t=%x, fl=%x)\n", | 696 | dprintk("NFS: flock(%s/%s, t=%x, fl=%x)\n", |
687 | filp->f_path.dentry->d_inode->i_sb->s_id, | 697 | filp->f_path.dentry->d_parent->d_name.name, |
688 | filp->f_path.dentry->d_inode->i_ino, | 698 | filp->f_path.dentry->d_name.name, |
689 | fl->fl_type, fl->fl_flags); | 699 | fl->fl_type, fl->fl_flags); |
690 | 700 | ||
691 | /* | 701 | /* |
@@ -708,12 +718,15 @@ static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) | |||
708 | return do_setlk(filp, cmd, fl); | 718 | return do_setlk(filp, cmd, fl); |
709 | } | 719 | } |
710 | 720 | ||
721 | /* | ||
722 | * There is no protocol support for leases, so we have no way to implement | ||
723 | * them correctly in the face of opens by other clients. | ||
724 | */ | ||
711 | static int nfs_setlease(struct file *file, long arg, struct file_lock **fl) | 725 | static int nfs_setlease(struct file *file, long arg, struct file_lock **fl) |
712 | { | 726 | { |
713 | /* | 727 | dprintk("NFS: setlease(%s/%s, arg=%ld)\n", |
714 | * There is no protocol support for leases, so we have no way | 728 | file->f_path.dentry->d_parent->d_name.name, |
715 | * to implement them correctly in the face of opens by other | 729 | file->f_path.dentry->d_name.name, arg); |
716 | * clients. | 730 | |
717 | */ | ||
718 | return -EINVAL; | 731 | return -EINVAL; |
719 | } | 732 | } |