aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/file.c')
-rw-r--r--fs/nfs/file.c59
1 files changed, 36 insertions, 23 deletions
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)
137static int 137static int
138nfs_file_release(struct inode *inode, struct file *filp) 138nfs_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
175static loff_t nfs_file_llseek(struct file *filp, loff_t offset, int origin) 181static 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 */
221static int 226static int
222nfs_file_flush(struct file *file, fl_owner_t id) 227nfs_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 */
650static int nfs_lock(struct file *filp, int cmd, struct file_lock *fl) 658static 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 */
684static int nfs_flock(struct file *filp, int cmd, struct file_lock *fl) 694static 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 */
711static int nfs_setlease(struct file *file, long arg, struct file_lock **fl) 725static 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}