aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-26 18:48:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-26 20:22:07 -0400
commit9ec3a646fe09970f801ab15e0f1694060b9f19af (patch)
tree697058ca7e1671eda180a3ccc62445686fbc1a31 /fs/nfs
parentc8b3fd0ce313443731e8fd6d5a541085eb465f99 (diff)
parent3cab989afd8d8d1bc3d99fef0e7ed87c31e7b647 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull fourth vfs update from Al Viro: "d_inode() annotations from David Howells (sat in for-next since before the beginning of merge window) + four assorted fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: RCU pathwalk breakage when running into a symlink overmounting something fix I_DIO_WAKEUP definition direct-io: only inc/dec inode->i_dio_count for file systems fs/9p: fix readdir() VFS: assorted d_backing_inode() annotations VFS: fs/inode.c helpers: d_inode() annotations VFS: fs/cachefiles: d_backing_inode() annotations VFS: fs library helpers: d_inode() annotations VFS: assorted weird filesystems: d_inode() annotations VFS: normal filesystems (and lustre): d_inode() annotations VFS: security/: d_inode() annotations VFS: security/: d_backing_inode() annotations VFS: net/: d_inode() annotations VFS: net/unix: d_backing_inode() annotations VFS: kernel/: d_inode() annotations VFS: audit: d_backing_inode() annotations VFS: Fix up some ->d_inode accesses in the chelsio driver VFS: Cachefiles should perform fs modifications on the top layer only VFS: AF_UNIX sockets should call mknod on the top layer only
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/dir.c59
-rw-r--r--fs/nfs/direct.c14
-rw-r--r--fs/nfs/getroot.c4
-rw-r--r--fs/nfs/inode.c18
-rw-r--r--fs/nfs/namespace.c10
-rw-r--r--fs/nfs/nfs3acl.c2
-rw-r--r--fs/nfs/nfs3proc.c12
-rw-r--r--fs/nfs/nfs4client.c2
-rw-r--r--fs/nfs/nfs4file.c4
-rw-r--r--fs/nfs/nfs4namespace.c4
-rw-r--r--fs/nfs/nfs4proc.c60
-rw-r--r--fs/nfs/nfs4state.c4
-rw-r--r--fs/nfs/nfs4trace.h4
-rw-r--r--fs/nfs/pagelist.c2
-rw-r--r--fs/nfs/pnfs.h4
-rw-r--r--fs/nfs/proc.c4
-rw-r--r--fs/nfs/read.c2
-rw-r--r--fs/nfs/super.c6
-rw-r--r--fs/nfs/symlink.c2
-rw-r--r--fs/nfs/unlink.c20
-rw-r--r--fs/nfs/write.c8
21 files changed, 122 insertions, 123 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index c19e16f0b2d0..1e51ecd61854 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -416,15 +416,14 @@ int nfs_same_file(struct dentry *dentry, struct nfs_entry *entry)
416{ 416{
417 struct nfs_inode *nfsi; 417 struct nfs_inode *nfsi;
418 418
419 if (dentry->d_inode == NULL) 419 if (d_really_is_negative(dentry))
420 goto different; 420 return 0;
421 421
422 nfsi = NFS_I(dentry->d_inode); 422 nfsi = NFS_I(d_inode(dentry));
423 if (entry->fattr->fileid == nfsi->fileid) 423 if (entry->fattr->fileid == nfsi->fileid)
424 return 1; 424 return 1;
425 if (nfs_compare_fh(entry->fh, &nfsi->fh) == 0) 425 if (nfs_compare_fh(entry->fh, &nfsi->fh) == 0)
426 return 1; 426 return 1;
427different:
428 return 0; 427 return 0;
429} 428}
430 429
@@ -473,7 +472,7 @@ void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry)
473 struct qstr filename = QSTR_INIT(entry->name, entry->len); 472 struct qstr filename = QSTR_INIT(entry->name, entry->len);
474 struct dentry *dentry; 473 struct dentry *dentry;
475 struct dentry *alias; 474 struct dentry *alias;
476 struct inode *dir = parent->d_inode; 475 struct inode *dir = d_inode(parent);
477 struct inode *inode; 476 struct inode *inode;
478 int status; 477 int status;
479 478
@@ -497,9 +496,9 @@ void nfs_prime_dcache(struct dentry *parent, struct nfs_entry *entry)
497 goto out; 496 goto out;
498 if (nfs_same_file(dentry, entry)) { 497 if (nfs_same_file(dentry, entry)) {
499 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); 498 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
500 status = nfs_refresh_inode(dentry->d_inode, entry->fattr); 499 status = nfs_refresh_inode(d_inode(dentry), entry->fattr);
501 if (!status) 500 if (!status)
502 nfs_setsecurity(dentry->d_inode, entry->fattr, entry->label); 501 nfs_setsecurity(d_inode(dentry), entry->fattr, entry->label);
503 goto out; 502 goto out;
504 } else { 503 } else {
505 d_invalidate(dentry); 504 d_invalidate(dentry);
@@ -870,7 +869,7 @@ static bool nfs_dir_mapping_need_revalidate(struct inode *dir)
870static int nfs_readdir(struct file *file, struct dir_context *ctx) 869static int nfs_readdir(struct file *file, struct dir_context *ctx)
871{ 870{
872 struct dentry *dentry = file->f_path.dentry; 871 struct dentry *dentry = file->f_path.dentry;
873 struct inode *inode = dentry->d_inode; 872 struct inode *inode = d_inode(dentry);
874 nfs_readdir_descriptor_t my_desc, 873 nfs_readdir_descriptor_t my_desc,
875 *desc = &my_desc; 874 *desc = &my_desc;
876 struct nfs_open_dir_context *dir_ctx = file->private_data; 875 struct nfs_open_dir_context *dir_ctx = file->private_data;
@@ -1118,15 +1117,15 @@ static int nfs_lookup_revalidate(struct dentry *dentry, unsigned int flags)
1118 1117
1119 if (flags & LOOKUP_RCU) { 1118 if (flags & LOOKUP_RCU) {
1120 parent = ACCESS_ONCE(dentry->d_parent); 1119 parent = ACCESS_ONCE(dentry->d_parent);
1121 dir = ACCESS_ONCE(parent->d_inode); 1120 dir = d_inode_rcu(parent);
1122 if (!dir) 1121 if (!dir)
1123 return -ECHILD; 1122 return -ECHILD;
1124 } else { 1123 } else {
1125 parent = dget_parent(dentry); 1124 parent = dget_parent(dentry);
1126 dir = parent->d_inode; 1125 dir = d_inode(parent);
1127 } 1126 }
1128 nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE); 1127 nfs_inc_stats(dir, NFSIOS_DENTRYREVALIDATE);
1129 inode = dentry->d_inode; 1128 inode = d_inode(dentry);
1130 1129
1131 if (!inode) { 1130 if (!inode) {
1132 if (nfs_neg_need_reval(dir, dentry, flags)) { 1131 if (nfs_neg_need_reval(dir, dentry, flags)) {
@@ -1242,7 +1241,7 @@ out_error:
1242} 1241}
1243 1242
1244/* 1243/*
1245 * A weaker form of d_revalidate for revalidating just the dentry->d_inode 1244 * A weaker form of d_revalidate for revalidating just the d_inode(dentry)
1246 * when we don't really care about the dentry name. This is called when a 1245 * when we don't really care about the dentry name. This is called when a
1247 * pathwalk ends on a dentry that was not found via a normal lookup in the 1246 * pathwalk ends on a dentry that was not found via a normal lookup in the
1248 * parent dir (e.g.: ".", "..", procfs symlinks or mountpoint traversals). 1247 * parent dir (e.g.: ".", "..", procfs symlinks or mountpoint traversals).
@@ -1253,7 +1252,7 @@ out_error:
1253static int nfs_weak_revalidate(struct dentry *dentry, unsigned int flags) 1252static int nfs_weak_revalidate(struct dentry *dentry, unsigned int flags)
1254{ 1253{
1255 int error; 1254 int error;
1256 struct inode *inode = dentry->d_inode; 1255 struct inode *inode = d_inode(dentry);
1257 1256
1258 /* 1257 /*
1259 * I believe we can only get a negative dentry here in the case of a 1258 * I believe we can only get a negative dentry here in the case of a
@@ -1287,7 +1286,7 @@ static int nfs_dentry_delete(const struct dentry *dentry)
1287 dentry, dentry->d_flags); 1286 dentry, dentry->d_flags);
1288 1287
1289 /* Unhash any dentry with a stale inode */ 1288 /* Unhash any dentry with a stale inode */
1290 if (dentry->d_inode != NULL && NFS_STALE(dentry->d_inode)) 1289 if (d_really_is_positive(dentry) && NFS_STALE(d_inode(dentry)))
1291 return 1; 1290 return 1;
1292 1291
1293 if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { 1292 if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
@@ -1491,7 +1490,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
1491 int err; 1490 int err;
1492 1491
1493 /* Expect a negative dentry */ 1492 /* Expect a negative dentry */
1494 BUG_ON(dentry->d_inode); 1493 BUG_ON(d_inode(dentry));
1495 1494
1496 dfprintk(VFS, "NFS: atomic_open(%s/%lu), %pd\n", 1495 dfprintk(VFS, "NFS: atomic_open(%s/%lu), %pd\n",
1497 dir->i_sb->s_id, dir->i_ino, dentry); 1496 dir->i_sb->s_id, dir->i_ino, dentry);
@@ -1587,7 +1586,7 @@ static int nfs4_lookup_revalidate(struct dentry *dentry, unsigned int flags)
1587 if (NFS_SB(dentry->d_sb)->caps & NFS_CAP_ATOMIC_OPEN_V1) 1586 if (NFS_SB(dentry->d_sb)->caps & NFS_CAP_ATOMIC_OPEN_V1)
1588 goto no_open; 1587 goto no_open;
1589 1588
1590 inode = dentry->d_inode; 1589 inode = d_inode(dentry);
1591 1590
1592 /* We can't create new files in nfs_open_revalidate(), so we 1591 /* We can't create new files in nfs_open_revalidate(), so we
1593 * optimize away revalidation of negative dentries. 1592 * optimize away revalidation of negative dentries.
@@ -1598,12 +1597,12 @@ static int nfs4_lookup_revalidate(struct dentry *dentry, unsigned int flags)
1598 1597
1599 if (flags & LOOKUP_RCU) { 1598 if (flags & LOOKUP_RCU) {
1600 parent = ACCESS_ONCE(dentry->d_parent); 1599 parent = ACCESS_ONCE(dentry->d_parent);
1601 dir = ACCESS_ONCE(parent->d_inode); 1600 dir = d_inode_rcu(parent);
1602 if (!dir) 1601 if (!dir)
1603 return -ECHILD; 1602 return -ECHILD;
1604 } else { 1603 } else {
1605 parent = dget_parent(dentry); 1604 parent = dget_parent(dentry);
1606 dir = parent->d_inode; 1605 dir = d_inode(parent);
1607 } 1606 }
1608 if (!nfs_neg_need_reval(dir, dentry, flags)) 1607 if (!nfs_neg_need_reval(dir, dentry, flags))
1609 ret = 1; 1608 ret = 1;
@@ -1643,14 +1642,14 @@ int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fhandle,
1643 struct nfs4_label *label) 1642 struct nfs4_label *label)
1644{ 1643{
1645 struct dentry *parent = dget_parent(dentry); 1644 struct dentry *parent = dget_parent(dentry);
1646 struct inode *dir = parent->d_inode; 1645 struct inode *dir = d_inode(parent);
1647 struct inode *inode; 1646 struct inode *inode;
1648 int error = -EACCES; 1647 int error = -EACCES;
1649 1648
1650 d_drop(dentry); 1649 d_drop(dentry);
1651 1650
1652 /* We may have been initialized further down */ 1651 /* We may have been initialized further down */
1653 if (dentry->d_inode) 1652 if (d_really_is_positive(dentry))
1654 goto out; 1653 goto out;
1655 if (fhandle->size == 0) { 1654 if (fhandle->size == 0) {
1656 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, NULL); 1655 error = NFS_PROTO(dir)->lookup(dir, &dentry->d_name, fhandle, fattr, NULL);
@@ -1768,7 +1767,7 @@ EXPORT_SYMBOL_GPL(nfs_mkdir);
1768 1767
1769static void nfs_dentry_handle_enoent(struct dentry *dentry) 1768static void nfs_dentry_handle_enoent(struct dentry *dentry)
1770{ 1769{
1771 if (dentry->d_inode != NULL && !d_unhashed(dentry)) 1770 if (d_really_is_positive(dentry) && !d_unhashed(dentry))
1772 d_delete(dentry); 1771 d_delete(dentry);
1773} 1772}
1774 1773
@@ -1780,13 +1779,13 @@ int nfs_rmdir(struct inode *dir, struct dentry *dentry)
1780 dir->i_sb->s_id, dir->i_ino, dentry); 1779 dir->i_sb->s_id, dir->i_ino, dentry);
1781 1780
1782 trace_nfs_rmdir_enter(dir, dentry); 1781 trace_nfs_rmdir_enter(dir, dentry);
1783 if (dentry->d_inode) { 1782 if (d_really_is_positive(dentry)) {
1784 nfs_wait_on_sillyrename(dentry); 1783 nfs_wait_on_sillyrename(dentry);
1785 error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name); 1784 error = NFS_PROTO(dir)->rmdir(dir, &dentry->d_name);
1786 /* Ensure the VFS deletes this inode */ 1785 /* Ensure the VFS deletes this inode */
1787 switch (error) { 1786 switch (error) {
1788 case 0: 1787 case 0:
1789 clear_nlink(dentry->d_inode); 1788 clear_nlink(d_inode(dentry));
1790 break; 1789 break;
1791 case -ENOENT: 1790 case -ENOENT:
1792 nfs_dentry_handle_enoent(dentry); 1791 nfs_dentry_handle_enoent(dentry);
@@ -1808,8 +1807,8 @@ EXPORT_SYMBOL_GPL(nfs_rmdir);
1808 */ 1807 */
1809static int nfs_safe_remove(struct dentry *dentry) 1808static int nfs_safe_remove(struct dentry *dentry)
1810{ 1809{
1811 struct inode *dir = dentry->d_parent->d_inode; 1810 struct inode *dir = d_inode(dentry->d_parent);
1812 struct inode *inode = dentry->d_inode; 1811 struct inode *inode = d_inode(dentry);
1813 int error = -EBUSY; 1812 int error = -EBUSY;
1814 1813
1815 dfprintk(VFS, "NFS: safe_remove(%pd2)\n", dentry); 1814 dfprintk(VFS, "NFS: safe_remove(%pd2)\n", dentry);
@@ -1853,7 +1852,7 @@ int nfs_unlink(struct inode *dir, struct dentry *dentry)
1853 if (d_count(dentry) > 1) { 1852 if (d_count(dentry) > 1) {
1854 spin_unlock(&dentry->d_lock); 1853 spin_unlock(&dentry->d_lock);
1855 /* Start asynchronous writeout of the inode */ 1854 /* Start asynchronous writeout of the inode */
1856 write_inode_now(dentry->d_inode, 0); 1855 write_inode_now(d_inode(dentry), 0);
1857 error = nfs_sillyrename(dir, dentry); 1856 error = nfs_sillyrename(dir, dentry);
1858 goto out; 1857 goto out;
1859 } 1858 }
@@ -1931,7 +1930,7 @@ int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
1931 * No big deal if we can't add this page to the page cache here. 1930 * No big deal if we can't add this page to the page cache here.
1932 * READLINK will get the missing page from the server if needed. 1931 * READLINK will get the missing page from the server if needed.
1933 */ 1932 */
1934 if (!add_to_page_cache_lru(page, dentry->d_inode->i_mapping, 0, 1933 if (!add_to_page_cache_lru(page, d_inode(dentry)->i_mapping, 0,
1935 GFP_KERNEL)) { 1934 GFP_KERNEL)) {
1936 SetPageUptodate(page); 1935 SetPageUptodate(page);
1937 unlock_page(page); 1936 unlock_page(page);
@@ -1950,7 +1949,7 @@ EXPORT_SYMBOL_GPL(nfs_symlink);
1950int 1949int
1951nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry) 1950nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
1952{ 1951{
1953 struct inode *inode = old_dentry->d_inode; 1952 struct inode *inode = d_inode(old_dentry);
1954 int error; 1953 int error;
1955 1954
1956 dfprintk(VFS, "NFS: link(%pd2 -> %pd2)\n", 1955 dfprintk(VFS, "NFS: link(%pd2 -> %pd2)\n",
@@ -1997,8 +1996,8 @@ EXPORT_SYMBOL_GPL(nfs_link);
1997int nfs_rename(struct inode *old_dir, struct dentry *old_dentry, 1996int nfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1998 struct inode *new_dir, struct dentry *new_dentry) 1997 struct inode *new_dir, struct dentry *new_dentry)
1999{ 1998{
2000 struct inode *old_inode = old_dentry->d_inode; 1999 struct inode *old_inode = d_inode(old_dentry);
2001 struct inode *new_inode = new_dentry->d_inode; 2000 struct inode *new_inode = d_inode(new_dentry);
2002 struct dentry *dentry = NULL, *rehash = NULL; 2001 struct dentry *dentry = NULL, *rehash = NULL;
2003 struct rpc_task *task; 2002 struct rpc_task *task;
2004 int error = -EBUSY; 2003 int error = -EBUSY;
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 682f65fe09b5..b2cbc3a6cdd9 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -386,7 +386,7 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq, bool write)
386 if (write) 386 if (write)
387 nfs_zap_mapping(inode, inode->i_mapping); 387 nfs_zap_mapping(inode, inode->i_mapping);
388 388
389 inode_dio_done(inode); 389 inode_dio_end(inode);
390 390
391 if (dreq->iocb) { 391 if (dreq->iocb) {
392 long res = (long) dreq->error; 392 long res = (long) dreq->error;
@@ -403,8 +403,8 @@ static void nfs_direct_complete(struct nfs_direct_req *dreq, bool write)
403static void nfs_direct_readpage_release(struct nfs_page *req) 403static void nfs_direct_readpage_release(struct nfs_page *req)
404{ 404{
405 dprintk("NFS: direct read done (%s/%llu %d@%lld)\n", 405 dprintk("NFS: direct read done (%s/%llu %d@%lld)\n",
406 req->wb_context->dentry->d_inode->i_sb->s_id, 406 d_inode(req->wb_context->dentry)->i_sb->s_id,
407 (unsigned long long)NFS_FILEID(req->wb_context->dentry->d_inode), 407 (unsigned long long)NFS_FILEID(d_inode(req->wb_context->dentry)),
408 req->wb_bytes, 408 req->wb_bytes,
409 (long long)req_offset(req)); 409 (long long)req_offset(req));
410 nfs_release_request(req); 410 nfs_release_request(req);
@@ -486,7 +486,7 @@ static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq,
486 &nfs_direct_read_completion_ops); 486 &nfs_direct_read_completion_ops);
487 get_dreq(dreq); 487 get_dreq(dreq);
488 desc.pg_dreq = dreq; 488 desc.pg_dreq = dreq;
489 atomic_inc(&inode->i_dio_count); 489 inode_dio_begin(inode);
490 490
491 while (iov_iter_count(iter)) { 491 while (iov_iter_count(iter)) {
492 struct page **pagevec; 492 struct page **pagevec;
@@ -538,7 +538,7 @@ static ssize_t nfs_direct_read_schedule_iovec(struct nfs_direct_req *dreq,
538 * generic layer handle the completion. 538 * generic layer handle the completion.
539 */ 539 */
540 if (requested_bytes == 0) { 540 if (requested_bytes == 0) {
541 inode_dio_done(inode); 541 inode_dio_end(inode);
542 nfs_direct_req_release(dreq); 542 nfs_direct_req_release(dreq);
543 return result < 0 ? result : -EIO; 543 return result < 0 ? result : -EIO;
544 } 544 }
@@ -872,7 +872,7 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
872 &nfs_direct_write_completion_ops); 872 &nfs_direct_write_completion_ops);
873 desc.pg_dreq = dreq; 873 desc.pg_dreq = dreq;
874 get_dreq(dreq); 874 get_dreq(dreq);
875 atomic_inc(&inode->i_dio_count); 875 inode_dio_begin(inode);
876 876
877 NFS_I(inode)->write_io += iov_iter_count(iter); 877 NFS_I(inode)->write_io += iov_iter_count(iter);
878 while (iov_iter_count(iter)) { 878 while (iov_iter_count(iter)) {
@@ -928,7 +928,7 @@ static ssize_t nfs_direct_write_schedule_iovec(struct nfs_direct_req *dreq,
928 * generic layer handle the completion. 928 * generic layer handle the completion.
929 */ 929 */
930 if (requested_bytes == 0) { 930 if (requested_bytes == 0) {
931 inode_dio_done(inode); 931 inode_dio_end(inode);
932 nfs_direct_req_release(dreq); 932 nfs_direct_req_release(dreq);
933 return result < 0 ? result : -EIO; 933 return result < 0 ? result : -EIO;
934 } 934 }
diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 9ac3846cb59e..a608ffd28acc 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -56,11 +56,11 @@ static int nfs_superblock_set_dummy_root(struct super_block *sb, struct inode *i
56 * This again causes shrink_dcache_for_umount_subtree() to 56 * This again causes shrink_dcache_for_umount_subtree() to
57 * Oops, since the test for IS_ROOT() will fail. 57 * Oops, since the test for IS_ROOT() will fail.
58 */ 58 */
59 spin_lock(&sb->s_root->d_inode->i_lock); 59 spin_lock(&d_inode(sb->s_root)->i_lock);
60 spin_lock(&sb->s_root->d_lock); 60 spin_lock(&sb->s_root->d_lock);
61 hlist_del_init(&sb->s_root->d_u.d_alias); 61 hlist_del_init(&sb->s_root->d_u.d_alias);
62 spin_unlock(&sb->s_root->d_lock); 62 spin_unlock(&sb->s_root->d_lock);
63 spin_unlock(&sb->s_root->d_inode->i_lock); 63 spin_unlock(&d_inode(sb->s_root)->i_lock);
64 } 64 }
65 return 0; 65 return 0;
66} 66}
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index d42dff6d5e98..3689e95da79a 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -495,7 +495,7 @@ EXPORT_SYMBOL_GPL(nfs_fhget);
495int 495int
496nfs_setattr(struct dentry *dentry, struct iattr *attr) 496nfs_setattr(struct dentry *dentry, struct iattr *attr)
497{ 497{
498 struct inode *inode = dentry->d_inode; 498 struct inode *inode = d_inode(dentry);
499 struct nfs_fattr *fattr; 499 struct nfs_fattr *fattr;
500 int error = -ENOMEM; 500 int error = -ENOMEM;
501 501
@@ -621,7 +621,7 @@ static void nfs_request_parent_use_readdirplus(struct dentry *dentry)
621 struct dentry *parent; 621 struct dentry *parent;
622 622
623 parent = dget_parent(dentry); 623 parent = dget_parent(dentry);
624 nfs_force_use_readdirplus(parent->d_inode); 624 nfs_force_use_readdirplus(d_inode(parent));
625 dput(parent); 625 dput(parent);
626} 626}
627 627
@@ -637,7 +637,7 @@ static bool nfs_need_revalidate_inode(struct inode *inode)
637 637
638int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) 638int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
639{ 639{
640 struct inode *inode = dentry->d_inode; 640 struct inode *inode = d_inode(dentry);
641 int need_atime = NFS_I(inode)->cache_validity & NFS_INO_INVALID_ATIME; 641 int need_atime = NFS_I(inode)->cache_validity & NFS_INO_INVALID_ATIME;
642 int err = 0; 642 int err = 0;
643 643
@@ -708,7 +708,7 @@ static struct nfs_lock_context *__nfs_find_lock_context(struct nfs_open_context
708struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx) 708struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx)
709{ 709{
710 struct nfs_lock_context *res, *new = NULL; 710 struct nfs_lock_context *res, *new = NULL;
711 struct inode *inode = ctx->dentry->d_inode; 711 struct inode *inode = d_inode(ctx->dentry);
712 712
713 spin_lock(&inode->i_lock); 713 spin_lock(&inode->i_lock);
714 res = __nfs_find_lock_context(ctx); 714 res = __nfs_find_lock_context(ctx);
@@ -736,7 +736,7 @@ EXPORT_SYMBOL_GPL(nfs_get_lock_context);
736void nfs_put_lock_context(struct nfs_lock_context *l_ctx) 736void nfs_put_lock_context(struct nfs_lock_context *l_ctx)
737{ 737{
738 struct nfs_open_context *ctx = l_ctx->open_context; 738 struct nfs_open_context *ctx = l_ctx->open_context;
739 struct inode *inode = ctx->dentry->d_inode; 739 struct inode *inode = d_inode(ctx->dentry);
740 740
741 if (!atomic_dec_and_lock(&l_ctx->count, &inode->i_lock)) 741 if (!atomic_dec_and_lock(&l_ctx->count, &inode->i_lock))
742 return; 742 return;
@@ -763,7 +763,7 @@ void nfs_close_context(struct nfs_open_context *ctx, int is_sync)
763 return; 763 return;
764 if (!is_sync) 764 if (!is_sync)
765 return; 765 return;
766 inode = ctx->dentry->d_inode; 766 inode = d_inode(ctx->dentry);
767 if (!list_empty(&NFS_I(inode)->open_files)) 767 if (!list_empty(&NFS_I(inode)->open_files))
768 return; 768 return;
769 server = NFS_SERVER(inode); 769 server = NFS_SERVER(inode);
@@ -810,7 +810,7 @@ EXPORT_SYMBOL_GPL(get_nfs_open_context);
810 810
811static void __put_nfs_open_context(struct nfs_open_context *ctx, int is_sync) 811static void __put_nfs_open_context(struct nfs_open_context *ctx, int is_sync)
812{ 812{
813 struct inode *inode = ctx->dentry->d_inode; 813 struct inode *inode = d_inode(ctx->dentry);
814 struct super_block *sb = ctx->dentry->d_sb; 814 struct super_block *sb = ctx->dentry->d_sb;
815 815
816 if (!list_empty(&ctx->list)) { 816 if (!list_empty(&ctx->list)) {
@@ -842,7 +842,7 @@ EXPORT_SYMBOL_GPL(put_nfs_open_context);
842 */ 842 */
843void nfs_inode_attach_open_context(struct nfs_open_context *ctx) 843void nfs_inode_attach_open_context(struct nfs_open_context *ctx)
844{ 844{
845 struct inode *inode = ctx->dentry->d_inode; 845 struct inode *inode = d_inode(ctx->dentry);
846 struct nfs_inode *nfsi = NFS_I(inode); 846 struct nfs_inode *nfsi = NFS_I(inode);
847 847
848 spin_lock(&inode->i_lock); 848 spin_lock(&inode->i_lock);
@@ -885,7 +885,7 @@ static void nfs_file_clear_open_context(struct file *filp)
885 struct nfs_open_context *ctx = nfs_file_open_context(filp); 885 struct nfs_open_context *ctx = nfs_file_open_context(filp);
886 886
887 if (ctx) { 887 if (ctx) {
888 struct inode *inode = ctx->dentry->d_inode; 888 struct inode *inode = d_inode(ctx->dentry);
889 889
890 filp->private_data = NULL; 890 filp->private_data = NULL;
891 spin_lock(&inode->i_lock); 891 spin_lock(&inode->i_lock);
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
index b5a0afc3ee10..c8162c660c44 100644
--- a/fs/nfs/namespace.c
+++ b/fs/nfs/namespace.c
@@ -139,7 +139,7 @@ EXPORT_SYMBOL_GPL(nfs_path);
139struct vfsmount *nfs_d_automount(struct path *path) 139struct vfsmount *nfs_d_automount(struct path *path)
140{ 140{
141 struct vfsmount *mnt; 141 struct vfsmount *mnt;
142 struct nfs_server *server = NFS_SERVER(path->dentry->d_inode); 142 struct nfs_server *server = NFS_SERVER(d_inode(path->dentry));
143 struct nfs_fh *fh = NULL; 143 struct nfs_fh *fh = NULL;
144 struct nfs_fattr *fattr = NULL; 144 struct nfs_fattr *fattr = NULL;
145 145
@@ -180,16 +180,16 @@ out_nofree:
180static int 180static int
181nfs_namespace_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) 181nfs_namespace_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
182{ 182{
183 if (NFS_FH(dentry->d_inode)->size != 0) 183 if (NFS_FH(d_inode(dentry))->size != 0)
184 return nfs_getattr(mnt, dentry, stat); 184 return nfs_getattr(mnt, dentry, stat);
185 generic_fillattr(dentry->d_inode, stat); 185 generic_fillattr(d_inode(dentry), stat);
186 return 0; 186 return 0;
187} 187}
188 188
189static int 189static int
190nfs_namespace_setattr(struct dentry *dentry, struct iattr *attr) 190nfs_namespace_setattr(struct dentry *dentry, struct iattr *attr)
191{ 191{
192 if (NFS_FH(dentry->d_inode)->size != 0) 192 if (NFS_FH(d_inode(dentry))->size != 0)
193 return nfs_setattr(dentry, attr); 193 return nfs_setattr(dentry, attr);
194 return -EACCES; 194 return -EACCES;
195} 195}
@@ -279,7 +279,7 @@ struct vfsmount *nfs_submount(struct nfs_server *server, struct dentry *dentry,
279 struct dentry *parent = dget_parent(dentry); 279 struct dentry *parent = dget_parent(dentry);
280 280
281 /* Look it up again to get its attributes */ 281 /* Look it up again to get its attributes */
282 err = server->nfs_client->rpc_ops->lookup(parent->d_inode, &dentry->d_name, fh, fattr, NULL); 282 err = server->nfs_client->rpc_ops->lookup(d_inode(parent), &dentry->d_name, fh, fattr, NULL);
283 dput(parent); 283 dput(parent);
284 if (err != 0) 284 if (err != 0)
285 return ERR_PTR(err); 285 return ERR_PTR(err);
diff --git a/fs/nfs/nfs3acl.c b/fs/nfs/nfs3acl.c
index 658e586ca438..1ebe2fc7cda2 100644
--- a/fs/nfs/nfs3acl.c
+++ b/fs/nfs/nfs3acl.c
@@ -279,7 +279,7 @@ nfs3_list_one_acl(struct inode *inode, int type, const char *name, void *data,
279ssize_t 279ssize_t
280nfs3_listxattr(struct dentry *dentry, char *data, size_t size) 280nfs3_listxattr(struct dentry *dentry, char *data, size_t size)
281{ 281{
282 struct inode *inode = dentry->d_inode; 282 struct inode *inode = d_inode(dentry);
283 ssize_t result = 0; 283 ssize_t result = 0;
284 int error; 284 int error;
285 285
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 1f11d2533ee4..cb28cceefebe 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -120,7 +120,7 @@ static int
120nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, 120nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
121 struct iattr *sattr) 121 struct iattr *sattr)
122{ 122{
123 struct inode *inode = dentry->d_inode; 123 struct inode *inode = d_inode(dentry);
124 struct nfs3_sattrargs arg = { 124 struct nfs3_sattrargs arg = {
125 .fh = NFS_FH(inode), 125 .fh = NFS_FH(inode),
126 .sattr = sattr, 126 .sattr = sattr,
@@ -386,13 +386,13 @@ nfs3_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
386 * not sure this buys us anything (and I'd have 386 * not sure this buys us anything (and I'd have
387 * to revamp the NFSv3 XDR code) */ 387 * to revamp the NFSv3 XDR code) */
388 status = nfs3_proc_setattr(dentry, data->res.fattr, sattr); 388 status = nfs3_proc_setattr(dentry, data->res.fattr, sattr);
389 nfs_post_op_update_inode(dentry->d_inode, data->res.fattr); 389 nfs_post_op_update_inode(d_inode(dentry), data->res.fattr);
390 dprintk("NFS reply setattr (post-create): %d\n", status); 390 dprintk("NFS reply setattr (post-create): %d\n", status);
391 if (status != 0) 391 if (status != 0)
392 goto out_release_acls; 392 goto out_release_acls;
393 } 393 }
394 394
395 status = nfs3_proc_setacls(dentry->d_inode, acl, default_acl); 395 status = nfs3_proc_setacls(d_inode(dentry), acl, default_acl);
396 396
397out_release_acls: 397out_release_acls:
398 posix_acl_release(acl); 398 posix_acl_release(acl);
@@ -570,7 +570,7 @@ nfs3_proc_mkdir(struct inode *dir, struct dentry *dentry, struct iattr *sattr)
570 if (status != 0) 570 if (status != 0)
571 goto out_release_acls; 571 goto out_release_acls;
572 572
573 status = nfs3_proc_setacls(dentry->d_inode, acl, default_acl); 573 status = nfs3_proc_setacls(d_inode(dentry), acl, default_acl);
574 574
575out_release_acls: 575out_release_acls:
576 posix_acl_release(acl); 576 posix_acl_release(acl);
@@ -623,7 +623,7 @@ static int
623nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 623nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
624 u64 cookie, struct page **pages, unsigned int count, int plus) 624 u64 cookie, struct page **pages, unsigned int count, int plus)
625{ 625{
626 struct inode *dir = dentry->d_inode; 626 struct inode *dir = d_inode(dentry);
627 __be32 *verf = NFS_I(dir)->cookieverf; 627 __be32 *verf = NFS_I(dir)->cookieverf;
628 struct nfs3_readdirargs arg = { 628 struct nfs3_readdirargs arg = {
629 .fh = NFS_FH(dir), 629 .fh = NFS_FH(dir),
@@ -715,7 +715,7 @@ nfs3_proc_mknod(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
715 if (status != 0) 715 if (status != 0)
716 goto out_release_acls; 716 goto out_release_acls;
717 717
718 status = nfs3_proc_setacls(dentry->d_inode, acl, default_acl); 718 status = nfs3_proc_setacls(d_inode(dentry), acl, default_acl);
719 719
720out_release_acls: 720out_release_acls:
721 posix_acl_release(acl); 721 posix_acl_release(acl);
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 86d6214ea022..51c2dbd1e942 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -1130,7 +1130,7 @@ error:
1130 */ 1130 */
1131static int nfs_probe_destination(struct nfs_server *server) 1131static int nfs_probe_destination(struct nfs_server *server)
1132{ 1132{
1133 struct inode *inode = server->super->s_root->d_inode; 1133 struct inode *inode = d_inode(server->super->s_root);
1134 struct nfs_fattr *fattr; 1134 struct nfs_fattr *fattr;
1135 int error; 1135 int error;
1136 1136
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index 0181cde1d102..619eca34e70f 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -46,7 +46,7 @@ nfs4_file_open(struct inode *inode, struct file *filp)
46 openflags &= ~(O_CREAT|O_EXCL); 46 openflags &= ~(O_CREAT|O_EXCL);
47 47
48 parent = dget_parent(dentry); 48 parent = dget_parent(dentry);
49 dir = parent->d_inode; 49 dir = d_inode(parent);
50 50
51 ctx = alloc_nfs_open_context(filp->f_path.dentry, filp->f_mode); 51 ctx = alloc_nfs_open_context(filp->f_path.dentry, filp->f_mode);
52 err = PTR_ERR(ctx); 52 err = PTR_ERR(ctx);
@@ -74,7 +74,7 @@ nfs4_file_open(struct inode *inode, struct file *filp)
74 goto out_drop; 74 goto out_drop;
75 } 75 }
76 } 76 }
77 if (inode != dentry->d_inode) 77 if (inode != d_inode(dentry))
78 goto out_drop; 78 goto out_drop;
79 79
80 nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); 80 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c
index 3d83cb1fdc70..f592672373cb 100644
--- a/fs/nfs/nfs4namespace.c
+++ b/fs/nfs/nfs4namespace.c
@@ -375,7 +375,7 @@ static struct vfsmount *nfs_do_refmount(struct rpc_clnt *client, struct dentry *
375 dprintk("%s: getting locations for %pd2\n", 375 dprintk("%s: getting locations for %pd2\n",
376 __func__, dentry); 376 __func__, dentry);
377 377
378 err = nfs4_proc_fs_locations(client, parent->d_inode, &dentry->d_name, fs_locations, page); 378 err = nfs4_proc_fs_locations(client, d_inode(parent), &dentry->d_name, fs_locations, page);
379 dput(parent); 379 dput(parent);
380 if (err != 0 || 380 if (err != 0 ||
381 fs_locations->nlocations <= 0 || 381 fs_locations->nlocations <= 0 ||
@@ -396,7 +396,7 @@ struct vfsmount *nfs4_submount(struct nfs_server *server, struct dentry *dentry,
396{ 396{
397 rpc_authflavor_t flavor = server->client->cl_auth->au_flavor; 397 rpc_authflavor_t flavor = server->client->cl_auth->au_flavor;
398 struct dentry *parent = dget_parent(dentry); 398 struct dentry *parent = dget_parent(dentry);
399 struct inode *dir = parent->d_inode; 399 struct inode *dir = d_inode(parent);
400 struct qstr *name = &dentry->d_name; 400 struct qstr *name = &dentry->d_name;
401 struct rpc_clnt *client; 401 struct rpc_clnt *client;
402 struct vfsmount *mnt; 402 struct vfsmount *mnt;
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 627f37c44456..98e533f2c94a 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -293,7 +293,7 @@ static void nfs4_setup_readdir(u64 cookie, __be32 *verifier, struct dentry *dent
293 *p++ = xdr_one; /* bitmap length */ 293 *p++ = xdr_one; /* bitmap length */
294 *p++ = htonl(FATTR4_WORD0_FILEID); /* bitmap */ 294 *p++ = htonl(FATTR4_WORD0_FILEID); /* bitmap */
295 *p++ = htonl(8); /* attribute buffer length */ 295 *p++ = htonl(8); /* attribute buffer length */
296 p = xdr_encode_hyper(p, NFS_FILEID(dentry->d_inode)); 296 p = xdr_encode_hyper(p, NFS_FILEID(d_inode(dentry)));
297 } 297 }
298 298
299 *p++ = xdr_one; /* next */ 299 *p++ = xdr_one; /* next */
@@ -305,7 +305,7 @@ static void nfs4_setup_readdir(u64 cookie, __be32 *verifier, struct dentry *dent
305 *p++ = xdr_one; /* bitmap length */ 305 *p++ = xdr_one; /* bitmap length */
306 *p++ = htonl(FATTR4_WORD0_FILEID); /* bitmap */ 306 *p++ = htonl(FATTR4_WORD0_FILEID); /* bitmap */
307 *p++ = htonl(8); /* attribute buffer length */ 307 *p++ = htonl(8); /* attribute buffer length */
308 p = xdr_encode_hyper(p, NFS_FILEID(dentry->d_parent->d_inode)); 308 p = xdr_encode_hyper(p, NFS_FILEID(d_inode(dentry->d_parent)));
309 309
310 readdir->pgbase = (char *)p - (char *)start; 310 readdir->pgbase = (char *)p - (char *)start;
311 readdir->count -= readdir->pgbase; 311 readdir->count -= readdir->pgbase;
@@ -1004,7 +1004,7 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
1004 gfp_t gfp_mask) 1004 gfp_t gfp_mask)
1005{ 1005{
1006 struct dentry *parent = dget_parent(dentry); 1006 struct dentry *parent = dget_parent(dentry);
1007 struct inode *dir = parent->d_inode; 1007 struct inode *dir = d_inode(parent);
1008 struct nfs_server *server = NFS_SERVER(dir); 1008 struct nfs_server *server = NFS_SERVER(dir);
1009 struct nfs_seqid *(*alloc_seqid)(struct nfs_seqid_counter *, gfp_t); 1009 struct nfs_seqid *(*alloc_seqid)(struct nfs_seqid_counter *, gfp_t);
1010 struct nfs4_opendata *p; 1010 struct nfs4_opendata *p;
@@ -1057,7 +1057,7 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
1057 case NFS4_OPEN_CLAIM_FH: 1057 case NFS4_OPEN_CLAIM_FH:
1058 case NFS4_OPEN_CLAIM_DELEG_CUR_FH: 1058 case NFS4_OPEN_CLAIM_DELEG_CUR_FH:
1059 case NFS4_OPEN_CLAIM_DELEG_PREV_FH: 1059 case NFS4_OPEN_CLAIM_DELEG_PREV_FH:
1060 p->o_arg.fh = NFS_FH(dentry->d_inode); 1060 p->o_arg.fh = NFS_FH(d_inode(dentry));
1061 } 1061 }
1062 if (attrs != NULL && attrs->ia_valid != 0) { 1062 if (attrs != NULL && attrs->ia_valid != 0) {
1063 __u32 verf[2]; 1063 __u32 verf[2];
@@ -1794,7 +1794,7 @@ static const struct rpc_call_ops nfs4_open_confirm_ops = {
1794 */ 1794 */
1795static int _nfs4_proc_open_confirm(struct nfs4_opendata *data) 1795static int _nfs4_proc_open_confirm(struct nfs4_opendata *data)
1796{ 1796{
1797 struct nfs_server *server = NFS_SERVER(data->dir->d_inode); 1797 struct nfs_server *server = NFS_SERVER(d_inode(data->dir));
1798 struct rpc_task *task; 1798 struct rpc_task *task;
1799 struct rpc_message msg = { 1799 struct rpc_message msg = {
1800 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_CONFIRM], 1800 .rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_OPEN_CONFIRM],
@@ -1951,7 +1951,7 @@ static const struct rpc_call_ops nfs4_open_ops = {
1951 1951
1952static int nfs4_run_open_task(struct nfs4_opendata *data, int isrecover) 1952static int nfs4_run_open_task(struct nfs4_opendata *data, int isrecover)
1953{ 1953{
1954 struct inode *dir = data->dir->d_inode; 1954 struct inode *dir = d_inode(data->dir);
1955 struct nfs_server *server = NFS_SERVER(dir); 1955 struct nfs_server *server = NFS_SERVER(dir);
1956 struct nfs_openargs *o_arg = &data->o_arg; 1956 struct nfs_openargs *o_arg = &data->o_arg;
1957 struct nfs_openres *o_res = &data->o_res; 1957 struct nfs_openres *o_res = &data->o_res;
@@ -1998,7 +1998,7 @@ static int nfs4_run_open_task(struct nfs4_opendata *data, int isrecover)
1998 1998
1999static int _nfs4_recover_proc_open(struct nfs4_opendata *data) 1999static int _nfs4_recover_proc_open(struct nfs4_opendata *data)
2000{ 2000{
2001 struct inode *dir = data->dir->d_inode; 2001 struct inode *dir = d_inode(data->dir);
2002 struct nfs_openres *o_res = &data->o_res; 2002 struct nfs_openres *o_res = &data->o_res;
2003 int status; 2003 int status;
2004 2004
@@ -2067,7 +2067,7 @@ static int nfs4_opendata_access(struct rpc_cred *cred,
2067 */ 2067 */
2068static int _nfs4_proc_open(struct nfs4_opendata *data) 2068static int _nfs4_proc_open(struct nfs4_opendata *data)
2069{ 2069{
2070 struct inode *dir = data->dir->d_inode; 2070 struct inode *dir = d_inode(data->dir);
2071 struct nfs_server *server = NFS_SERVER(dir); 2071 struct nfs_server *server = NFS_SERVER(dir);
2072 struct nfs_openargs *o_arg = &data->o_arg; 2072 struct nfs_openargs *o_arg = &data->o_arg;
2073 struct nfs_openres *o_res = &data->o_res; 2073 struct nfs_openres *o_res = &data->o_res;
@@ -2314,7 +2314,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
2314 set_bit(NFS_STATE_POSIX_LOCKS, &state->flags); 2314 set_bit(NFS_STATE_POSIX_LOCKS, &state->flags);
2315 2315
2316 dentry = opendata->dentry; 2316 dentry = opendata->dentry;
2317 if (dentry->d_inode == NULL) { 2317 if (d_really_is_negative(dentry)) {
2318 /* FIXME: Is this d_drop() ever needed? */ 2318 /* FIXME: Is this d_drop() ever needed? */
2319 d_drop(dentry); 2319 d_drop(dentry);
2320 dentry = d_add_unique(dentry, igrab(state->inode)); 2320 dentry = d_add_unique(dentry, igrab(state->inode));
@@ -2325,7 +2325,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
2325 ctx->dentry = dget(dentry); 2325 ctx->dentry = dget(dentry);
2326 } 2326 }
2327 nfs_set_verifier(dentry, 2327 nfs_set_verifier(dentry,
2328 nfs_save_change_attribute(opendata->dir->d_inode)); 2328 nfs_save_change_attribute(d_inode(opendata->dir)));
2329 } 2329 }
2330 2330
2331 ret = nfs4_opendata_access(sp->so_cred, opendata, state, fmode, flags); 2331 ret = nfs4_opendata_access(sp->so_cred, opendata, state, fmode, flags);
@@ -2333,7 +2333,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata,
2333 goto out; 2333 goto out;
2334 2334
2335 ctx->state = state; 2335 ctx->state = state;
2336 if (dentry->d_inode == state->inode) { 2336 if (d_inode(dentry) == state->inode) {
2337 nfs_inode_attach_open_context(ctx); 2337 nfs_inode_attach_open_context(ctx);
2338 if (read_seqcount_retry(&sp->so_reclaim_seqcount, seq)) 2338 if (read_seqcount_retry(&sp->so_reclaim_seqcount, seq))
2339 nfs4_schedule_stateid_recovery(server, state); 2339 nfs4_schedule_stateid_recovery(server, state);
@@ -2374,10 +2374,10 @@ static int _nfs4_do_open(struct inode *dir,
2374 status = nfs4_recover_expired_lease(server); 2374 status = nfs4_recover_expired_lease(server);
2375 if (status != 0) 2375 if (status != 0)
2376 goto err_put_state_owner; 2376 goto err_put_state_owner;
2377 if (dentry->d_inode != NULL) 2377 if (d_really_is_positive(dentry))
2378 nfs4_return_incompatible_delegation(dentry->d_inode, fmode); 2378 nfs4_return_incompatible_delegation(d_inode(dentry), fmode);
2379 status = -ENOMEM; 2379 status = -ENOMEM;
2380 if (dentry->d_inode) 2380 if (d_really_is_positive(dentry))
2381 claim = NFS4_OPEN_CLAIM_FH; 2381 claim = NFS4_OPEN_CLAIM_FH;
2382 opendata = nfs4_opendata_alloc(dentry, sp, fmode, flags, sattr, 2382 opendata = nfs4_opendata_alloc(dentry, sp, fmode, flags, sattr,
2383 label, claim, GFP_KERNEL); 2383 label, claim, GFP_KERNEL);
@@ -2400,8 +2400,8 @@ static int _nfs4_do_open(struct inode *dir,
2400 } 2400 }
2401 opendata->o_arg.open_bitmap = &nfs4_pnfs_open_bitmap[0]; 2401 opendata->o_arg.open_bitmap = &nfs4_pnfs_open_bitmap[0];
2402 } 2402 }
2403 if (dentry->d_inode != NULL) 2403 if (d_really_is_positive(dentry))
2404 opendata->state = nfs4_get_open_state(dentry->d_inode, sp); 2404 opendata->state = nfs4_get_open_state(d_inode(dentry), sp);
2405 2405
2406 status = _nfs4_open_and_get_state(opendata, fmode, flags, ctx); 2406 status = _nfs4_open_and_get_state(opendata, fmode, flags, ctx);
2407 if (status != 0) 2407 if (status != 0)
@@ -3254,7 +3254,7 @@ static int
3254nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, 3254nfs4_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
3255 struct iattr *sattr) 3255 struct iattr *sattr)
3256{ 3256{
3257 struct inode *inode = dentry->d_inode; 3257 struct inode *inode = d_inode(dentry);
3258 struct rpc_cred *cred = NULL; 3258 struct rpc_cred *cred = NULL;
3259 struct nfs4_state *state = NULL; 3259 struct nfs4_state *state = NULL;
3260 struct nfs4_label *label = NULL; 3260 struct nfs4_label *label = NULL;
@@ -3871,13 +3871,13 @@ static int nfs4_proc_mkdir(struct inode *dir, struct dentry *dentry,
3871static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 3871static int _nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
3872 u64 cookie, struct page **pages, unsigned int count, int plus) 3872 u64 cookie, struct page **pages, unsigned int count, int plus)
3873{ 3873{
3874 struct inode *dir = dentry->d_inode; 3874 struct inode *dir = d_inode(dentry);
3875 struct nfs4_readdir_arg args = { 3875 struct nfs4_readdir_arg args = {
3876 .fh = NFS_FH(dir), 3876 .fh = NFS_FH(dir),
3877 .pages = pages, 3877 .pages = pages,
3878 .pgbase = 0, 3878 .pgbase = 0,
3879 .count = count, 3879 .count = count,
3880 .bitmask = NFS_SERVER(dentry->d_inode)->attr_bitmask, 3880 .bitmask = NFS_SERVER(d_inode(dentry))->attr_bitmask,
3881 .plus = plus, 3881 .plus = plus,
3882 }; 3882 };
3883 struct nfs4_readdir_res res; 3883 struct nfs4_readdir_res res;
@@ -3914,8 +3914,8 @@ static int nfs4_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
3914 do { 3914 do {
3915 err = _nfs4_proc_readdir(dentry, cred, cookie, 3915 err = _nfs4_proc_readdir(dentry, cred, cookie,
3916 pages, count, plus); 3916 pages, count, plus);
3917 trace_nfs4_readdir(dentry->d_inode, err); 3917 trace_nfs4_readdir(d_inode(dentry), err);
3918 err = nfs4_handle_exception(NFS_SERVER(dentry->d_inode), err, 3918 err = nfs4_handle_exception(NFS_SERVER(d_inode(dentry)), err,
3919 &exception); 3919 &exception);
3920 } while (exception.retry); 3920 } while (exception.retry);
3921 return err; 3921 return err;
@@ -4830,7 +4830,7 @@ nfs4_set_security_label(struct dentry *dentry, const void *buf, size_t buflen)
4830 struct nfs4_label ilabel, *olabel = NULL; 4830 struct nfs4_label ilabel, *olabel = NULL;
4831 struct nfs_fattr fattr; 4831 struct nfs_fattr fattr;
4832 struct rpc_cred *cred; 4832 struct rpc_cred *cred;
4833 struct inode *inode = dentry->d_inode; 4833 struct inode *inode = d_inode(dentry);
4834 int status; 4834 int status;
4835 4835
4836 if (!nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL)) 4836 if (!nfs_server_capable(inode, NFS_CAP_SECURITY_LABEL))
@@ -5670,7 +5670,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)
5670 data->rpc_status = task->tk_status; 5670 data->rpc_status = task->tk_status;
5671 switch (task->tk_status) { 5671 switch (task->tk_status) {
5672 case 0: 5672 case 0:
5673 renew_lease(NFS_SERVER(data->ctx->dentry->d_inode), 5673 renew_lease(NFS_SERVER(d_inode(data->ctx->dentry)),
5674 data->timestamp); 5674 data->timestamp);
5675 if (data->arg.new_lock) { 5675 if (data->arg.new_lock) {
5676 data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS); 5676 data->fl.fl_flags &= ~(FL_SLEEP | FL_ACCESS);
@@ -6112,7 +6112,7 @@ static int nfs4_xattr_set_nfs4_acl(struct dentry *dentry, const char *key,
6112 if (strcmp(key, "") != 0) 6112 if (strcmp(key, "") != 0)
6113 return -EINVAL; 6113 return -EINVAL;
6114 6114
6115 return nfs4_proc_set_acl(dentry->d_inode, buf, buflen); 6115 return nfs4_proc_set_acl(d_inode(dentry), buf, buflen);
6116} 6116}
6117 6117
6118static int nfs4_xattr_get_nfs4_acl(struct dentry *dentry, const char *key, 6118static int nfs4_xattr_get_nfs4_acl(struct dentry *dentry, const char *key,
@@ -6121,7 +6121,7 @@ static int nfs4_xattr_get_nfs4_acl(struct dentry *dentry, const char *key,
6121 if (strcmp(key, "") != 0) 6121 if (strcmp(key, "") != 0)
6122 return -EINVAL; 6122 return -EINVAL;
6123 6123
6124 return nfs4_proc_get_acl(dentry->d_inode, buf, buflen); 6124 return nfs4_proc_get_acl(d_inode(dentry), buf, buflen);
6125} 6125}
6126 6126
6127static size_t nfs4_xattr_list_nfs4_acl(struct dentry *dentry, char *list, 6127static size_t nfs4_xattr_list_nfs4_acl(struct dentry *dentry, char *list,
@@ -6130,7 +6130,7 @@ static size_t nfs4_xattr_list_nfs4_acl(struct dentry *dentry, char *list,
6130{ 6130{
6131 size_t len = sizeof(XATTR_NAME_NFSV4_ACL); 6131 size_t len = sizeof(XATTR_NAME_NFSV4_ACL);
6132 6132
6133 if (!nfs4_server_supports_acls(NFS_SERVER(dentry->d_inode))) 6133 if (!nfs4_server_supports_acls(NFS_SERVER(d_inode(dentry))))
6134 return 0; 6134 return 0;
6135 6135
6136 if (list && len <= list_len) 6136 if (list && len <= list_len)
@@ -6158,7 +6158,7 @@ static int nfs4_xattr_get_nfs4_label(struct dentry *dentry, const char *key,
6158 void *buf, size_t buflen, int type) 6158 void *buf, size_t buflen, int type)
6159{ 6159{
6160 if (security_ismaclabel(key)) 6160 if (security_ismaclabel(key))
6161 return nfs4_get_security_label(dentry->d_inode, buf, buflen); 6161 return nfs4_get_security_label(d_inode(dentry), buf, buflen);
6162 return -EOPNOTSUPP; 6162 return -EOPNOTSUPP;
6163} 6163}
6164 6164
@@ -6168,10 +6168,10 @@ static size_t nfs4_xattr_list_nfs4_label(struct dentry *dentry, char *list,
6168{ 6168{
6169 size_t len = 0; 6169 size_t len = 0;
6170 6170
6171 if (nfs_server_capable(dentry->d_inode, NFS_CAP_SECURITY_LABEL)) { 6171 if (nfs_server_capable(d_inode(dentry), NFS_CAP_SECURITY_LABEL)) {
6172 len = security_inode_listsecurity(dentry->d_inode, NULL, 0); 6172 len = security_inode_listsecurity(d_inode(dentry), NULL, 0);
6173 if (list && len <= list_len) 6173 if (list && len <= list_len)
6174 security_inode_listsecurity(dentry->d_inode, list, len); 6174 security_inode_listsecurity(d_inode(dentry), list, len);
6175 } 6175 }
6176 return len; 6176 return len;
6177} 6177}
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index f95e3b58bbc3..3b2b20534a3a 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1902,7 +1902,7 @@ static int nfs4_try_migration(struct nfs_server *server, struct rpc_cred *cred)
1902 goto out; 1902 goto out;
1903 } 1903 }
1904 1904
1905 inode = server->super->s_root->d_inode; 1905 inode = d_inode(server->super->s_root);
1906 result = nfs4_proc_get_locations(inode, locations, page, cred); 1906 result = nfs4_proc_get_locations(inode, locations, page, cred);
1907 if (result) { 1907 if (result) {
1908 dprintk("<-- %s: failed to retrieve fs_locations: %d\n", 1908 dprintk("<-- %s: failed to retrieve fs_locations: %d\n",
@@ -2021,7 +2021,7 @@ restart:
2021 2021
2022 rcu_read_unlock(); 2022 rcu_read_unlock();
2023 2023
2024 inode = server->super->s_root->d_inode; 2024 inode = d_inode(server->super->s_root);
2025 status = nfs4_proc_fsid_present(inode, cred); 2025 status = nfs4_proc_fsid_present(inode, cred);
2026 if (status != -NFS4ERR_MOVED) 2026 if (status != -NFS4ERR_MOVED)
2027 goto restart; /* wasn't this one */ 2027 goto restart; /* wasn't this one */
diff --git a/fs/nfs/nfs4trace.h b/fs/nfs/nfs4trace.h
index 1c32adbe728d..470af1a78bec 100644
--- a/fs/nfs/nfs4trace.h
+++ b/fs/nfs/nfs4trace.h
@@ -418,7 +418,7 @@ DECLARE_EVENT_CLASS(nfs4_open_event,
418 __entry->fileid = 0; 418 __entry->fileid = 0;
419 __entry->fhandle = 0; 419 __entry->fhandle = 0;
420 } 420 }
421 __entry->dir = NFS_FILEID(ctx->dentry->d_parent->d_inode); 421 __entry->dir = NFS_FILEID(d_inode(ctx->dentry->d_parent));
422 __assign_str(name, ctx->dentry->d_name.name); 422 __assign_str(name, ctx->dentry->d_name.name);
423 ), 423 ),
424 424
@@ -1110,7 +1110,7 @@ TRACE_EVENT(nfs4_layoutget,
1110 ), 1110 ),
1111 1111
1112 TP_fast_assign( 1112 TP_fast_assign(
1113 const struct inode *inode = ctx->dentry->d_inode; 1113 const struct inode *inode = d_inode(ctx->dentry);
1114 __entry->dev = inode->i_sb->s_dev; 1114 __entry->dev = inode->i_sb->s_dev;
1115 __entry->fileid = NFS_FILEID(inode); 1115 __entry->fileid = NFS_FILEID(inode);
1116 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode)); 1116 __entry->fhandle = nfs_fhandle_hash(NFS_FH(inode));
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index d57190a0d533..282b39369510 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -938,7 +938,7 @@ static bool nfs_can_coalesce_requests(struct nfs_page *prev,
938 if (prev) { 938 if (prev) {
939 if (!nfs_match_open_context(req->wb_context, prev->wb_context)) 939 if (!nfs_match_open_context(req->wb_context, prev->wb_context))
940 return false; 940 return false;
941 flctx = req->wb_context->dentry->d_inode->i_flctx; 941 flctx = d_inode(req->wb_context->dentry)->i_flctx;
942 if (flctx != NULL && 942 if (flctx != NULL &&
943 !(list_empty_careful(&flctx->flc_posix) && 943 !(list_empty_careful(&flctx->flc_posix) &&
944 list_empty_careful(&flctx->flc_flock)) && 944 list_empty_careful(&flctx->flc_flock)) &&
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index 635f0865671c..084c9144f86d 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -426,7 +426,7 @@ static inline bool
426pnfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg, 426pnfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg,
427 struct nfs_commit_info *cinfo, u32 ds_commit_idx) 427 struct nfs_commit_info *cinfo, u32 ds_commit_idx)
428{ 428{
429 struct inode *inode = req->wb_context->dentry->d_inode; 429 struct inode *inode = d_inode(req->wb_context->dentry);
430 struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld; 430 struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld;
431 431
432 if (lseg == NULL || ld->mark_request_commit == NULL) 432 if (lseg == NULL || ld->mark_request_commit == NULL)
@@ -438,7 +438,7 @@ pnfs_mark_request_commit(struct nfs_page *req, struct pnfs_layout_segment *lseg,
438static inline bool 438static inline bool
439pnfs_clear_request_commit(struct nfs_page *req, struct nfs_commit_info *cinfo) 439pnfs_clear_request_commit(struct nfs_page *req, struct nfs_commit_info *cinfo)
440{ 440{
441 struct inode *inode = req->wb_context->dentry->d_inode; 441 struct inode *inode = d_inode(req->wb_context->dentry);
442 struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld; 442 struct pnfs_layoutdriver_type *ld = NFS_SERVER(inode)->pnfs_curr_ld;
443 443
444 if (ld == NULL || ld->clear_request_commit == NULL) 444 if (ld == NULL || ld->clear_request_commit == NULL)
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index c63189acd052..b417bbcd9704 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -118,7 +118,7 @@ static int
118nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, 118nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr,
119 struct iattr *sattr) 119 struct iattr *sattr)
120{ 120{
121 struct inode *inode = dentry->d_inode; 121 struct inode *inode = d_inode(dentry);
122 struct nfs_sattrargs arg = { 122 struct nfs_sattrargs arg = {
123 .fh = NFS_FH(inode), 123 .fh = NFS_FH(inode),
124 .sattr = sattr 124 .sattr = sattr
@@ -487,7 +487,7 @@ static int
487nfs_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, 487nfs_proc_readdir(struct dentry *dentry, struct rpc_cred *cred,
488 u64 cookie, struct page **pages, unsigned int count, int plus) 488 u64 cookie, struct page **pages, unsigned int count, int plus)
489{ 489{
490 struct inode *dir = dentry->d_inode; 490 struct inode *dir = d_inode(dentry);
491 struct nfs_readdirargs arg = { 491 struct nfs_readdirargs arg = {
492 .fh = NFS_FH(dir), 492 .fh = NFS_FH(dir),
493 .cookie = cookie, 493 .cookie = cookie,
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index b8f5c63f77b2..a5b7427c3754 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -117,7 +117,7 @@ int nfs_readpage_async(struct nfs_open_context *ctx, struct inode *inode,
117 117
118static void nfs_readpage_release(struct nfs_page *req) 118static void nfs_readpage_release(struct nfs_page *req)
119{ 119{
120 struct inode *inode = req->wb_context->dentry->d_inode; 120 struct inode *inode = d_inode(req->wb_context->dentry);
121 121
122 dprintk("NFS: read done (%s/%llu %d@%lld)\n", inode->i_sb->s_id, 122 dprintk("NFS: read done (%s/%llu %d@%lld)\n", inode->i_sb->s_id,
123 (unsigned long long)NFS_FILEID(inode), req->wb_bytes, 123 (unsigned long long)NFS_FILEID(inode), req->wb_bytes,
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 322b2de02988..21f8f52bf37d 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -433,7 +433,7 @@ int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
433 struct nfs_server *server = NFS_SB(dentry->d_sb); 433 struct nfs_server *server = NFS_SB(dentry->d_sb);
434 unsigned char blockbits; 434 unsigned char blockbits;
435 unsigned long blockres; 435 unsigned long blockres;
436 struct nfs_fh *fh = NFS_FH(dentry->d_inode); 436 struct nfs_fh *fh = NFS_FH(d_inode(dentry));
437 struct nfs_fsstat res; 437 struct nfs_fsstat res;
438 int error = -ENOMEM; 438 int error = -ENOMEM;
439 439
@@ -447,7 +447,7 @@ int nfs_statfs(struct dentry *dentry, struct kstatfs *buf)
447 447
448 pd_dentry = dget_parent(dentry); 448 pd_dentry = dget_parent(dentry);
449 if (pd_dentry != NULL) { 449 if (pd_dentry != NULL) {
450 nfs_zap_caches(pd_dentry->d_inode); 450 nfs_zap_caches(d_inode(pd_dentry));
451 dput(pd_dentry); 451 dput(pd_dentry);
452 } 452 }
453 } 453 }
@@ -2526,7 +2526,7 @@ int nfs_clone_sb_security(struct super_block *s, struct dentry *mntroot,
2526 struct nfs_mount_info *mount_info) 2526 struct nfs_mount_info *mount_info)
2527{ 2527{
2528 /* clone any lsm security options from the parent to the new sb */ 2528 /* clone any lsm security options from the parent to the new sb */
2529 if (mntroot->d_inode->i_op != NFS_SB(s)->nfs_client->rpc_ops->dir_inode_ops) 2529 if (d_inode(mntroot)->i_op != NFS_SB(s)->nfs_client->rpc_ops->dir_inode_ops)
2530 return -ESTALE; 2530 return -ESTALE;
2531 return security_sb_clone_mnt_opts(mount_info->cloned->sb, s); 2531 return security_sb_clone_mnt_opts(mount_info->cloned->sb, s);
2532} 2532}
diff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c
index 05c9e02f4153..2d56200655fe 100644
--- a/fs/nfs/symlink.c
+++ b/fs/nfs/symlink.c
@@ -45,7 +45,7 @@ error:
45 45
46static void *nfs_follow_link(struct dentry *dentry, struct nameidata *nd) 46static void *nfs_follow_link(struct dentry *dentry, struct nameidata *nd)
47{ 47{
48 struct inode *inode = dentry->d_inode; 48 struct inode *inode = d_inode(dentry);
49 struct page *page; 49 struct page *page;
50 void *err; 50 void *err;
51 51
diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c
index de54129336c6..fa538b2ba251 100644
--- a/fs/nfs/unlink.c
+++ b/fs/nfs/unlink.c
@@ -143,7 +143,7 @@ static int nfs_do_call_unlink(struct dentry *parent, struct inode *dir, struct n
143 nfs_free_dname(data); 143 nfs_free_dname(data);
144 ret = nfs_copy_dname(alias, data); 144 ret = nfs_copy_dname(alias, data);
145 spin_lock(&alias->d_lock); 145 spin_lock(&alias->d_lock);
146 if (ret == 0 && alias->d_inode != NULL && 146 if (ret == 0 && d_really_is_positive(alias) &&
147 !(alias->d_flags & DCACHE_NFSFS_RENAMED)) { 147 !(alias->d_flags & DCACHE_NFSFS_RENAMED)) {
148 devname_garbage = alias->d_fsdata; 148 devname_garbage = alias->d_fsdata;
149 alias->d_fsdata = data; 149 alias->d_fsdata = data;
@@ -190,7 +190,7 @@ static int nfs_call_unlink(struct dentry *dentry, struct nfs_unlinkdata *data)
190 parent = dget_parent(dentry); 190 parent = dget_parent(dentry);
191 if (parent == NULL) 191 if (parent == NULL)
192 goto out_free; 192 goto out_free;
193 dir = parent->d_inode; 193 dir = d_inode(parent);
194 /* Non-exclusive lock protects against concurrent lookup() calls */ 194 /* Non-exclusive lock protects against concurrent lookup() calls */
195 spin_lock(&dir->i_lock); 195 spin_lock(&dir->i_lock);
196 if (atomic_inc_not_zero(&NFS_I(dir)->silly_count) == 0) { 196 if (atomic_inc_not_zero(&NFS_I(dir)->silly_count) == 0) {
@@ -210,21 +210,21 @@ out_free:
210 210
211void nfs_wait_on_sillyrename(struct dentry *dentry) 211void nfs_wait_on_sillyrename(struct dentry *dentry)
212{ 212{
213 struct nfs_inode *nfsi = NFS_I(dentry->d_inode); 213 struct nfs_inode *nfsi = NFS_I(d_inode(dentry));
214 214
215 wait_event(nfsi->waitqueue, atomic_read(&nfsi->silly_count) <= 1); 215 wait_event(nfsi->waitqueue, atomic_read(&nfsi->silly_count) <= 1);
216} 216}
217 217
218void nfs_block_sillyrename(struct dentry *dentry) 218void nfs_block_sillyrename(struct dentry *dentry)
219{ 219{
220 struct nfs_inode *nfsi = NFS_I(dentry->d_inode); 220 struct nfs_inode *nfsi = NFS_I(d_inode(dentry));
221 221
222 wait_event(nfsi->waitqueue, atomic_cmpxchg(&nfsi->silly_count, 1, 0) == 1); 222 wait_event(nfsi->waitqueue, atomic_cmpxchg(&nfsi->silly_count, 1, 0) == 1);
223} 223}
224 224
225void nfs_unblock_sillyrename(struct dentry *dentry) 225void nfs_unblock_sillyrename(struct dentry *dentry)
226{ 226{
227 struct inode *dir = dentry->d_inode; 227 struct inode *dir = d_inode(dentry);
228 struct nfs_inode *nfsi = NFS_I(dir); 228 struct nfs_inode *nfsi = NFS_I(dir);
229 struct nfs_unlinkdata *data; 229 struct nfs_unlinkdata *data;
230 230
@@ -367,8 +367,8 @@ static void nfs_async_rename_release(void *calldata)
367 struct nfs_renamedata *data = calldata; 367 struct nfs_renamedata *data = calldata;
368 struct super_block *sb = data->old_dir->i_sb; 368 struct super_block *sb = data->old_dir->i_sb;
369 369
370 if (data->old_dentry->d_inode) 370 if (d_really_is_positive(data->old_dentry))
371 nfs_mark_for_revalidate(data->old_dentry->d_inode); 371 nfs_mark_for_revalidate(d_inode(data->old_dentry));
372 372
373 dput(data->old_dentry); 373 dput(data->old_dentry);
374 dput(data->new_dentry); 374 dput(data->new_dentry);
@@ -529,10 +529,10 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry)
529 if (dentry->d_flags & DCACHE_NFSFS_RENAMED) 529 if (dentry->d_flags & DCACHE_NFSFS_RENAMED)
530 goto out; 530 goto out;
531 531
532 fileid = NFS_FILEID(dentry->d_inode); 532 fileid = NFS_FILEID(d_inode(dentry));
533 533
534 /* Return delegation in anticipation of the rename */ 534 /* Return delegation in anticipation of the rename */
535 NFS_PROTO(dentry->d_inode)->return_delegation(dentry->d_inode); 535 NFS_PROTO(d_inode(dentry))->return_delegation(d_inode(dentry));
536 536
537 sdentry = NULL; 537 sdentry = NULL;
538 do { 538 do {
@@ -554,7 +554,7 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry)
554 */ 554 */
555 if (IS_ERR(sdentry)) 555 if (IS_ERR(sdentry))
556 goto out; 556 goto out;
557 } while (sdentry->d_inode != NULL); /* need negative lookup */ 557 } while (d_inode(sdentry) != NULL); /* need negative lookup */
558 558
559 /* queue unlink first. Can't do this from rpc_release as it 559 /* queue unlink first. Can't do this from rpc_release as it
560 * has to allocate memory 560 * has to allocate memory
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 759931088094..3612b4622337 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -702,7 +702,7 @@ static void nfs_inode_add_request(struct inode *inode, struct nfs_page *req)
702 */ 702 */
703static void nfs_inode_remove_request(struct nfs_page *req) 703static void nfs_inode_remove_request(struct nfs_page *req)
704{ 704{
705 struct inode *inode = req->wb_context->dentry->d_inode; 705 struct inode *inode = d_inode(req->wb_context->dentry);
706 struct nfs_inode *nfsi = NFS_I(inode); 706 struct nfs_inode *nfsi = NFS_I(inode);
707 struct nfs_page *head; 707 struct nfs_page *head;
708 708
@@ -861,7 +861,7 @@ static void
861nfs_clear_request_commit(struct nfs_page *req) 861nfs_clear_request_commit(struct nfs_page *req)
862{ 862{
863 if (test_bit(PG_CLEAN, &req->wb_flags)) { 863 if (test_bit(PG_CLEAN, &req->wb_flags)) {
864 struct inode *inode = req->wb_context->dentry->d_inode; 864 struct inode *inode = d_inode(req->wb_context->dentry);
865 struct nfs_commit_info cinfo; 865 struct nfs_commit_info cinfo;
866 866
867 nfs_init_cinfo_from_inode(&cinfo, inode); 867 nfs_init_cinfo_from_inode(&cinfo, inode);
@@ -1591,7 +1591,7 @@ void nfs_init_commit(struct nfs_commit_data *data,
1591 struct nfs_commit_info *cinfo) 1591 struct nfs_commit_info *cinfo)
1592{ 1592{
1593 struct nfs_page *first = nfs_list_entry(head->next); 1593 struct nfs_page *first = nfs_list_entry(head->next);
1594 struct inode *inode = first->wb_context->dentry->d_inode; 1594 struct inode *inode = d_inode(first->wb_context->dentry);
1595 1595
1596 /* Set up the RPC argument and reply structs 1596 /* Set up the RPC argument and reply structs
1597 * NB: take care not to mess about with data->commit et al. */ 1597 * NB: take care not to mess about with data->commit et al. */
@@ -1690,7 +1690,7 @@ static void nfs_commit_release_pages(struct nfs_commit_data *data)
1690 1690
1691 dprintk("NFS: commit (%s/%llu %d@%lld)", 1691 dprintk("NFS: commit (%s/%llu %d@%lld)",
1692 req->wb_context->dentry->d_sb->s_id, 1692 req->wb_context->dentry->d_sb->s_id,
1693 (unsigned long long)NFS_FILEID(req->wb_context->dentry->d_inode), 1693 (unsigned long long)NFS_FILEID(d_inode(req->wb_context->dentry)),
1694 req->wb_bytes, 1694 req->wb_bytes,
1695 (long long)req_offset(req)); 1695 (long long)req_offset(req));
1696 if (status < 0) { 1696 if (status < 0) {