Commit 6da24bc9cfc645c619992e39aab09747164c9f14

Authored by Chuck Lever
Committed by Trond Myklebust
1 parent b7eaefaa87

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>

Showing 3 changed files with 43 additions and 30 deletions Side-by-side Diff

... ... @@ -133,7 +133,7 @@
133 133 {
134 134 int res;
135 135  
136   - dfprintk(VFS, "NFS: open dir(%s/%s)\n",
  136 + dfprintk(FILE, "NFS: open dir(%s/%s)\n",
137 137 filp->f_path.dentry->d_parent->d_name.name,
138 138 filp->f_path.dentry->d_name.name);
139 139  
... ... @@ -531,7 +531,7 @@
531 531 struct nfs_fattr fattr;
532 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 535 dentry->d_parent->d_name.name, dentry->d_name.name,
536 536 (long long)filp->f_pos);
537 537 nfs_inc_stats(inode, NFSIOS_VFSGETDENTS);
... ... @@ -598,7 +598,7 @@
598 598 unlock_kernel();
599 599 if (res > 0)
600 600 res = 0;
601   - dfprintk(VFS, "NFS: readdir(%s/%s) returns %ld\n",
  601 + dfprintk(FILE, "NFS: readdir(%s/%s) returns %ld\n",
602 602 dentry->d_parent->d_name.name, dentry->d_name.name,
603 603 res);
604 604 return res;
... ... @@ -609,7 +609,7 @@
609 609 struct dentry *dentry = filp->f_path.dentry;
610 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 613 dentry->d_parent->d_name.name,
614 614 dentry->d_name.name,
615 615 offset, origin);
... ... @@ -640,7 +640,7 @@
640 640 */
641 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 644 dentry->d_parent->d_name.name, dentry->d_name.name,
645 645 datasync);
646 646  
... ... @@ -890,7 +890,7 @@
890 890 count = iov_length(iov, nr_segs);
891 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 894 file->f_path.dentry->d_parent->d_name.name,
895 895 file->f_path.dentry->d_name.name,
896 896 count, (long long) pos);
... ... @@ -947,7 +947,7 @@
947 947 count = iov_length(iov, nr_segs);
948 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 951 file->f_path.dentry->d_parent->d_name.name,
952 952 file->f_path.dentry->d_name.name,
953 953 count, (long long) pos);
... ... @@ -119,7 +119,7 @@
119 119 {
120 120 int res;
121 121  
122   - dfprintk(VFS, "NFS: open file(%s/%s)\n",
  122 + dprintk("NFS: open file(%s/%s)\n",
123 123 filp->f_path.dentry->d_parent->d_name.name,
124 124 filp->f_path.dentry->d_name.name);
125 125  
126 126  
... ... @@ -137,9 +137,15 @@
137 137 static int
138 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 146 /* Ensure that dirty pages are flushed out with the right creds */
141 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 149 nfs_inc_stats(inode, NFSIOS_VFSRELEASE);
144 150 return NFS_PROTO(inode)->file_release(inode, filp);
145 151 }
... ... @@ -174,7 +180,7 @@
174 180  
175 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 184 filp->f_path.dentry->d_parent->d_name.name,
179 185 filp->f_path.dentry->d_name.name,
180 186 offset, origin);
181 187  
182 188  
... ... @@ -216,16 +222,18 @@
216 222  
217 223 /*
218 224 * Flush all dirty pages, and check for write errors.
219   - *
220 225 */
221 226 static int
222 227 nfs_file_flush(struct file *file, fl_owner_t id)
223 228 {
224 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 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 238 if ((file->f_mode & FMODE_WRITE) == 0)
231 239 return 0;
... ... @@ -250,7 +258,7 @@
250 258 if (iocb->ki_filp->f_flags & O_DIRECT)
251 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 262 dentry->d_parent->d_name.name, dentry->d_name.name,
255 263 (unsigned long) count, (unsigned long) pos);
256 264  
... ... @@ -270,7 +278,7 @@
270 278 struct inode *inode = dentry->d_inode;
271 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 282 dentry->d_parent->d_name.name, dentry->d_name.name,
275 283 (unsigned long) count, (unsigned long long) *ppos);
276 284  
... ... @@ -287,7 +295,7 @@
287 295 struct inode *inode = dentry->d_inode;
288 296 int status;
289 297  
290   - dfprintk(VFS, "nfs: mmap(%s/%s)\n",
  298 + dprintk("NFS: mmap(%s/%s)\n",
291 299 dentry->d_parent->d_name.name, dentry->d_name.name);
292 300  
293 301 status = nfs_revalidate_mapping(inode, file->f_mapping);
... ... @@ -310,7 +318,7 @@
310 318 struct nfs_open_context *ctx = nfs_file_open_context(file);
311 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 322 dentry->d_parent->d_name.name, dentry->d_name.name,
315 323 datasync);
316 324  
317 325  
... ... @@ -502,9 +510,9 @@
502 510 if (iocb->ki_filp->f_flags & O_DIRECT)
503 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 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 517 result = -EBUSY;
510 518 if (IS_SWAPFILE(inode))
511 519  
512 520  
... ... @@ -649,13 +657,15 @@
649 657 */
650 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 661 int ret = -ENOLCK;
654 662  
655   - dprintk("NFS: nfs_lock(f=%s/%ld, t=%x, fl=%x, r=%Ld:%Ld)\n",
656   - inode->i_sb->s_id, inode->i_ino,
  663 + dprintk("NFS: lock(%s/%s, t=%x, fl=%x, r=%lld:%lld)\n",
  664 + filp->f_path.dentry->d_parent->d_name.name,
  665 + filp->f_path.dentry->d_name.name,
657 666 fl->fl_type, fl->fl_flags,
658 667 (long long)fl->fl_start, (long long)fl->fl_end);
  668 +
659 669 nfs_inc_stats(inode, NFSIOS_VFSLOCK);
660 670  
661 671 /* No mandatory locks over NFS */
... ... @@ -683,9 +693,9 @@
683 693 */
684 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",
687   - filp->f_path.dentry->d_inode->i_sb->s_id,
688   - filp->f_path.dentry->d_inode->i_ino,
  696 + dprintk("NFS: flock(%s/%s, t=%x, fl=%x)\n",
  697 + filp->f_path.dentry->d_parent->d_name.name,
  698 + filp->f_path.dentry->d_name.name,
689 699 fl->fl_type, fl->fl_flags);
690 700  
691 701 /*
692 702  
... ... @@ -708,13 +718,16 @@
708 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 725 static int nfs_setlease(struct file *file, long arg, struct file_lock **fl)
712 726 {
713   - /*
714   - * There is no protocol support for leases, so we have no way
715   - * to implement them correctly in the face of opens by other
716   - * clients.
717   - */
  727 + dprintk("NFS: setlease(%s/%s, arg=%ld)\n",
  728 + file->f_path.dentry->d_parent->d_name.name,
  729 + file->f_path.dentry->d_name.name, arg);
  730 +
718 731 return -EINVAL;
719 732 }