diff options
Diffstat (limited to 'fs/nfs/file.c')
-rw-r--r-- | fs/nfs/file.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 5595b32c0915..c664bb921425 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -208,7 +208,7 @@ static int nfs_do_fsync(struct nfs_open_context *ctx, struct inode *inode) | |||
208 | static int | 208 | static int |
209 | nfs_file_flush(struct file *file, fl_owner_t id) | 209 | nfs_file_flush(struct file *file, fl_owner_t id) |
210 | { | 210 | { |
211 | struct nfs_open_context *ctx = (struct nfs_open_context *)file->private_data; | 211 | struct nfs_open_context *ctx = nfs_file_open_context(file); |
212 | struct inode *inode = file->f_path.dentry->d_inode; | 212 | struct inode *inode = file->f_path.dentry->d_inode; |
213 | int status; | 213 | int status; |
214 | 214 | ||
@@ -296,7 +296,7 @@ nfs_file_mmap(struct file * file, struct vm_area_struct * vma) | |||
296 | static int | 296 | static int |
297 | nfs_fsync(struct file *file, struct dentry *dentry, int datasync) | 297 | nfs_fsync(struct file *file, struct dentry *dentry, int datasync) |
298 | { | 298 | { |
299 | struct nfs_open_context *ctx = (struct nfs_open_context *)file->private_data; | 299 | struct nfs_open_context *ctx = nfs_file_open_context(file); |
300 | struct inode *inode = dentry->d_inode; | 300 | struct inode *inode = dentry->d_inode; |
301 | 301 | ||
302 | dfprintk(VFS, "nfs: fsync(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino); | 302 | dfprintk(VFS, "nfs: fsync(%s/%ld)\n", inode->i_sb->s_id, inode->i_ino); |
@@ -395,7 +395,7 @@ static int nfs_need_sync_write(struct file *filp, struct inode *inode) | |||
395 | 395 | ||
396 | if (IS_SYNC(inode) || (filp->f_flags & O_SYNC)) | 396 | if (IS_SYNC(inode) || (filp->f_flags & O_SYNC)) |
397 | return 1; | 397 | return 1; |
398 | ctx = filp->private_data; | 398 | ctx = nfs_file_open_context(filp); |
399 | if (test_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags)) | 399 | if (test_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags)) |
400 | return 1; | 400 | return 1; |
401 | return 0; | 401 | return 0; |
@@ -438,7 +438,7 @@ static ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov, | |||
438 | result = generic_file_aio_write(iocb, iov, nr_segs, pos); | 438 | result = generic_file_aio_write(iocb, iov, nr_segs, pos); |
439 | /* Return error values for O_SYNC and IS_SYNC() */ | 439 | /* Return error values for O_SYNC and IS_SYNC() */ |
440 | if (result >= 0 && nfs_need_sync_write(iocb->ki_filp, inode)) { | 440 | if (result >= 0 && nfs_need_sync_write(iocb->ki_filp, inode)) { |
441 | int err = nfs_do_fsync(iocb->ki_filp->private_data, inode); | 441 | int err = nfs_do_fsync(nfs_file_open_context(iocb->ki_filp), inode); |
442 | if (err < 0) | 442 | if (err < 0) |
443 | result = err; | 443 | result = err; |
444 | } | 444 | } |