]> Pileus Git - ~andy/linux/blobdiff - fs/afs/write.c
new helper: file_inode(file)
[~andy/linux] / fs / afs / write.c
index 9aa52d93c73c4860b285be7d0c685512f511f576..7e03eadb40c0a71d1dfd3971f8136abae2bb7822 100644 (file)
@@ -120,7 +120,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping,
                    struct page **pagep, void **fsdata)
 {
        struct afs_writeback *candidate, *wb;
-       struct afs_vnode *vnode = AFS_FS_I(file->f_dentry->d_inode);
+       struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
        struct page *page;
        struct key *key = file->private_data;
        unsigned from = pos & (PAGE_CACHE_SIZE - 1);
@@ -245,7 +245,7 @@ int afs_write_end(struct file *file, struct address_space *mapping,
                  loff_t pos, unsigned len, unsigned copied,
                  struct page *page, void *fsdata)
 {
-       struct afs_vnode *vnode = AFS_FS_I(file->f_dentry->d_inode);
+       struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
        loff_t i_size, maybe_i_size;
 
        _enter("{%x:%u},{%lx}",
@@ -627,8 +627,7 @@ void afs_pages_written_back(struct afs_vnode *vnode, struct afs_call *call)
 ssize_t afs_file_write(struct kiocb *iocb, const struct iovec *iov,
                       unsigned long nr_segs, loff_t pos)
 {
-       struct dentry *dentry = iocb->ki_filp->f_path.dentry;
-       struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode);
+       struct afs_vnode *vnode = AFS_FS_I(file_inode(iocb->ki_filp));
        ssize_t result;
        size_t count = iov_length(iov, nr_segs);