Merge branch 'parisc-4.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/deller...
[cascardo/linux.git] / fs / nfs / inode.c
index 2d82708..f734562 100644 (file)
@@ -501,7 +501,7 @@ EXPORT_SYMBOL_GPL(nfs_fhget);
 int
 nfs_setattr(struct dentry *dentry, struct iattr *attr)
 {
-       struct inode *inode = dentry->d_inode;
+       struct inode *inode = d_inode(dentry);
        struct nfs_fattr *fattr;
        int error = -ENOMEM;
 
@@ -625,7 +625,7 @@ static void nfs_request_parent_use_readdirplus(struct dentry *dentry)
        struct dentry *parent;
 
        parent = dget_parent(dentry);
-       nfs_force_use_readdirplus(parent->d_inode);
+       nfs_force_use_readdirplus(d_inode(parent));
        dput(parent);
 }
 
@@ -641,7 +641,7 @@ static bool nfs_need_revalidate_inode(struct inode *inode)
 
 int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
 {
-       struct inode *inode = dentry->d_inode;
+       struct inode *inode = d_inode(dentry);
        int need_atime = NFS_I(inode)->cache_validity & NFS_INO_INVALID_ATIME;
        int err = 0;
 
@@ -713,7 +713,7 @@ static struct nfs_lock_context *__nfs_find_lock_context(struct nfs_open_context
 struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx)
 {
        struct nfs_lock_context *res, *new = NULL;
-       struct inode *inode = ctx->dentry->d_inode;
+       struct inode *inode = d_inode(ctx->dentry);
 
        spin_lock(&inode->i_lock);
        res = __nfs_find_lock_context(ctx);
@@ -741,7 +741,7 @@ EXPORT_SYMBOL_GPL(nfs_get_lock_context);
 void nfs_put_lock_context(struct nfs_lock_context *l_ctx)
 {
        struct nfs_open_context *ctx = l_ctx->open_context;
-       struct inode *inode = ctx->dentry->d_inode;
+       struct inode *inode = d_inode(ctx->dentry);
 
        if (!atomic_dec_and_lock(&l_ctx->count, &inode->i_lock))
                return;
@@ -768,7 +768,7 @@ void nfs_close_context(struct nfs_open_context *ctx, int is_sync)
                return;
        if (!is_sync)
                return;
-       inode = ctx->dentry->d_inode;
+       inode = d_inode(ctx->dentry);
        if (!list_empty(&NFS_I(inode)->open_files))
                return;
        server = NFS_SERVER(inode);
@@ -815,7 +815,7 @@ EXPORT_SYMBOL_GPL(get_nfs_open_context);
 
 static void __put_nfs_open_context(struct nfs_open_context *ctx, int is_sync)
 {
-       struct inode *inode = ctx->dentry->d_inode;
+       struct inode *inode = d_inode(ctx->dentry);
        struct super_block *sb = ctx->dentry->d_sb;
 
        if (!list_empty(&ctx->list)) {
@@ -847,7 +847,7 @@ EXPORT_SYMBOL_GPL(put_nfs_open_context);
  */
 void nfs_inode_attach_open_context(struct nfs_open_context *ctx)
 {
-       struct inode *inode = ctx->dentry->d_inode;
+       struct inode *inode = d_inode(ctx->dentry);
        struct nfs_inode *nfsi = NFS_I(inode);
 
        spin_lock(&inode->i_lock);
@@ -890,7 +890,7 @@ static void nfs_file_clear_open_context(struct file *filp)
        struct nfs_open_context *ctx = nfs_file_open_context(filp);
 
        if (ctx) {
-               struct inode *inode = ctx->dentry->d_inode;
+               struct inode *inode = d_inode(ctx->dentry);
 
                filp->private_data = NULL;
                spin_lock(&inode->i_lock);
@@ -1837,7 +1837,7 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
 struct inode *nfs_alloc_inode(struct super_block *sb)
 {
        struct nfs_inode *nfsi;
-       nfsi = (struct nfs_inode *)kmem_cache_alloc(nfs_inode_cachep, GFP_KERNEL);
+       nfsi = kmem_cache_alloc(nfs_inode_cachep, GFP_KERNEL);
        if (!nfsi)
                return NULL;
        nfsi->flags = 0UL;