aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2015-03-17 18:25:59 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2015-04-15 15:06:57 -0400
commit2b0143b5c986be1ce8408b3aadc4709e0a94429d (patch)
tree98b1dee70f3d5d9ac9309f4638e41864ddcd0952 /fs/cifs
parentce0b16ddf18df35026164fda4a642ef10c01f442 (diff)
VFS: normal filesystems (and lustre): d_inode() annotations
that's the bulk of filesystem drivers dealing with inodes of their own Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifs_dfs_ref.c2
-rw-r--r--fs/cifs/cifsfs.c2
-rw-r--r--fs/cifs/cifssmb.c4
-rw-r--r--fs/cifs/dir.c8
-rw-r--r--fs/cifs/file.c48
-rw-r--r--fs/cifs/inode.c32
-rw-r--r--fs/cifs/link.c12
-rw-r--r--fs/cifs/misc.c2
-rw-r--r--fs/cifs/readdir.c4
-rw-r--r--fs/cifs/smb1ops.c2
-rw-r--r--fs/cifs/smb2file.c4
-rw-r--r--fs/cifs/smb2misc.c4
-rw-r--r--fs/cifs/smb2ops.c10
-rw-r--r--fs/cifs/xattr.c22
14 files changed, 78 insertions, 78 deletions
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index b8602f199815..430e0348c99e 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -301,7 +301,7 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
301 if (full_path == NULL) 301 if (full_path == NULL)
302 goto cdda_exit; 302 goto cdda_exit;
303 303
304 cifs_sb = CIFS_SB(mntpt->d_inode->i_sb); 304 cifs_sb = CIFS_SB(d_inode(mntpt)->i_sb);
305 tlink = cifs_sb_tlink(cifs_sb); 305 tlink = cifs_sb_tlink(cifs_sb);
306 if (IS_ERR(tlink)) { 306 if (IS_ERR(tlink)) {
307 mnt = ERR_CAST(tlink); 307 mnt = ERR_CAST(tlink);
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index eaab4b2a0595..f5089bde3635 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -607,7 +607,7 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
607 p = s = full_path; 607 p = s = full_path;
608 608
609 do { 609 do {
610 struct inode *dir = dentry->d_inode; 610 struct inode *dir = d_inode(dentry);
611 struct dentry *child; 611 struct dentry *child;
612 612
613 if (!dir) { 613 if (!dir) {
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index fa13d5e79f64..84650a51c7c4 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -1898,7 +1898,7 @@ static void
1898cifs_writev_requeue(struct cifs_writedata *wdata) 1898cifs_writev_requeue(struct cifs_writedata *wdata)
1899{ 1899{
1900 int i, rc = 0; 1900 int i, rc = 0;
1901 struct inode *inode = wdata->cfile->dentry->d_inode; 1901 struct inode *inode = d_inode(wdata->cfile->dentry);
1902 struct TCP_Server_Info *server; 1902 struct TCP_Server_Info *server;
1903 unsigned int rest_len; 1903 unsigned int rest_len;
1904 1904
@@ -1981,7 +1981,7 @@ cifs_writev_complete(struct work_struct *work)
1981{ 1981{
1982 struct cifs_writedata *wdata = container_of(work, 1982 struct cifs_writedata *wdata = container_of(work,
1983 struct cifs_writedata, work); 1983 struct cifs_writedata, work);
1984 struct inode *inode = wdata->cfile->dentry->d_inode; 1984 struct inode *inode = d_inode(wdata->cfile->dentry);
1985 int i = 0; 1985 int i = 0;
1986 1986
1987 if (wdata->result == 0) { 1987 if (wdata->result == 0) {
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index b72bc29cba23..338d56936f6a 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -745,13 +745,13 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
745 goto lookup_out; 745 goto lookup_out;
746 } 746 }
747 747
748 if (direntry->d_inode != NULL) { 748 if (d_really_is_positive(direntry)) {
749 cifs_dbg(FYI, "non-NULL inode in lookup\n"); 749 cifs_dbg(FYI, "non-NULL inode in lookup\n");
750 } else { 750 } else {
751 cifs_dbg(FYI, "NULL inode in lookup\n"); 751 cifs_dbg(FYI, "NULL inode in lookup\n");
752 } 752 }
753 cifs_dbg(FYI, "Full path: %s inode = 0x%p\n", 753 cifs_dbg(FYI, "Full path: %s inode = 0x%p\n",
754 full_path, direntry->d_inode); 754 full_path, d_inode(direntry));
755 755
756 if (pTcon->unix_ext) { 756 if (pTcon->unix_ext) {
757 rc = cifs_get_inode_info_unix(&newInode, full_path, 757 rc = cifs_get_inode_info_unix(&newInode, full_path,
@@ -792,7 +792,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
792 if (flags & LOOKUP_RCU) 792 if (flags & LOOKUP_RCU)
793 return -ECHILD; 793 return -ECHILD;
794 794
795 if (direntry->d_inode) { 795 if (d_really_is_positive(direntry)) {
796 if (cifs_revalidate_dentry(direntry)) 796 if (cifs_revalidate_dentry(direntry))
797 return 0; 797 return 0;
798 else { 798 else {
@@ -803,7 +803,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
803 * attributes will have been updated by 803 * attributes will have been updated by
804 * cifs_revalidate_dentry(). 804 * cifs_revalidate_dentry().
805 */ 805 */
806 if (IS_AUTOMOUNT(direntry->d_inode) && 806 if (IS_AUTOMOUNT(d_inode(direntry)) &&
807 !(direntry->d_flags & DCACHE_NEED_AUTOMOUNT)) { 807 !(direntry->d_flags & DCACHE_NEED_AUTOMOUNT)) {
808 spin_lock(&direntry->d_lock); 808 spin_lock(&direntry->d_lock);
809 direntry->d_flags |= DCACHE_NEED_AUTOMOUNT; 809 direntry->d_flags |= DCACHE_NEED_AUTOMOUNT;
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index ca2bc5406306..cafbf10521d5 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -273,7 +273,7 @@ cifs_new_fileinfo(struct cifs_fid *fid, struct file *file,
273 struct tcon_link *tlink, __u32 oplock) 273 struct tcon_link *tlink, __u32 oplock)
274{ 274{
275 struct dentry *dentry = file->f_path.dentry; 275 struct dentry *dentry = file->f_path.dentry;
276 struct inode *inode = dentry->d_inode; 276 struct inode *inode = d_inode(dentry);
277 struct cifsInodeInfo *cinode = CIFS_I(inode); 277 struct cifsInodeInfo *cinode = CIFS_I(inode);
278 struct cifsFileInfo *cfile; 278 struct cifsFileInfo *cfile;
279 struct cifs_fid_locks *fdlocks; 279 struct cifs_fid_locks *fdlocks;
@@ -357,7 +357,7 @@ cifsFileInfo_get(struct cifsFileInfo *cifs_file)
357 */ 357 */
358void cifsFileInfo_put(struct cifsFileInfo *cifs_file) 358void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
359{ 359{
360 struct inode *inode = cifs_file->dentry->d_inode; 360 struct inode *inode = d_inode(cifs_file->dentry);
361 struct cifs_tcon *tcon = tlink_tcon(cifs_file->tlink); 361 struct cifs_tcon *tcon = tlink_tcon(cifs_file->tlink);
362 struct TCP_Server_Info *server = tcon->ses->server; 362 struct TCP_Server_Info *server = tcon->ses->server;
363 struct cifsInodeInfo *cifsi = CIFS_I(inode); 363 struct cifsInodeInfo *cifsi = CIFS_I(inode);
@@ -386,7 +386,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
386 386
387 if (list_empty(&cifsi->openFileList)) { 387 if (list_empty(&cifsi->openFileList)) {
388 cifs_dbg(FYI, "closing last open instance for inode %p\n", 388 cifs_dbg(FYI, "closing last open instance for inode %p\n",
389 cifs_file->dentry->d_inode); 389 d_inode(cifs_file->dentry));
390 /* 390 /*
391 * In strict cache mode we need invalidate mapping on the last 391 * In strict cache mode we need invalidate mapping on the last
392 * close because it may cause a error when we open this file 392 * close because it may cause a error when we open this file
@@ -572,7 +572,7 @@ static int
572cifs_relock_file(struct cifsFileInfo *cfile) 572cifs_relock_file(struct cifsFileInfo *cfile)
573{ 573{
574 struct cifs_sb_info *cifs_sb = CIFS_SB(cfile->dentry->d_sb); 574 struct cifs_sb_info *cifs_sb = CIFS_SB(cfile->dentry->d_sb);
575 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 575 struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
576 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 576 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
577 int rc = 0; 577 int rc = 0;
578 578
@@ -620,7 +620,7 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush)
620 return rc; 620 return rc;
621 } 621 }
622 622
623 inode = cfile->dentry->d_inode; 623 inode = d_inode(cfile->dentry);
624 cifs_sb = CIFS_SB(inode->i_sb); 624 cifs_sb = CIFS_SB(inode->i_sb);
625 tcon = tlink_tcon(cfile->tlink); 625 tcon = tlink_tcon(cfile->tlink);
626 server = tcon->ses->server; 626 server = tcon->ses->server;
@@ -874,7 +874,7 @@ cifs_find_lock_conflict(struct cifsFileInfo *cfile, __u64 offset, __u64 length,
874{ 874{
875 bool rc = false; 875 bool rc = false;
876 struct cifs_fid_locks *cur; 876 struct cifs_fid_locks *cur;
877 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 877 struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
878 878
879 list_for_each_entry(cur, &cinode->llist, llist) { 879 list_for_each_entry(cur, &cinode->llist, llist) {
880 rc = cifs_find_fid_lock_conflict(cur, offset, length, type, 880 rc = cifs_find_fid_lock_conflict(cur, offset, length, type,
@@ -899,7 +899,7 @@ cifs_lock_test(struct cifsFileInfo *cfile, __u64 offset, __u64 length,
899{ 899{
900 int rc = 0; 900 int rc = 0;
901 struct cifsLockInfo *conf_lock; 901 struct cifsLockInfo *conf_lock;
902 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 902 struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
903 struct TCP_Server_Info *server = tlink_tcon(cfile->tlink)->ses->server; 903 struct TCP_Server_Info *server = tlink_tcon(cfile->tlink)->ses->server;
904 bool exist; 904 bool exist;
905 905
@@ -927,7 +927,7 @@ cifs_lock_test(struct cifsFileInfo *cfile, __u64 offset, __u64 length,
927static void 927static void
928cifs_lock_add(struct cifsFileInfo *cfile, struct cifsLockInfo *lock) 928cifs_lock_add(struct cifsFileInfo *cfile, struct cifsLockInfo *lock)
929{ 929{
930 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 930 struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
931 down_write(&cinode->lock_sem); 931 down_write(&cinode->lock_sem);
932 list_add_tail(&lock->llist, &cfile->llist->locks); 932 list_add_tail(&lock->llist, &cfile->llist->locks);
933 up_write(&cinode->lock_sem); 933 up_write(&cinode->lock_sem);
@@ -944,7 +944,7 @@ cifs_lock_add_if(struct cifsFileInfo *cfile, struct cifsLockInfo *lock,
944 bool wait) 944 bool wait)
945{ 945{
946 struct cifsLockInfo *conf_lock; 946 struct cifsLockInfo *conf_lock;
947 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 947 struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
948 bool exist; 948 bool exist;
949 int rc = 0; 949 int rc = 0;
950 950
@@ -1125,7 +1125,7 @@ struct lock_to_push {
1125static int 1125static int
1126cifs_push_posix_locks(struct cifsFileInfo *cfile) 1126cifs_push_posix_locks(struct cifsFileInfo *cfile)
1127{ 1127{
1128 struct inode *inode = cfile->dentry->d_inode; 1128 struct inode *inode = d_inode(cfile->dentry);
1129 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 1129 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
1130 struct file_lock *flock; 1130 struct file_lock *flock;
1131 struct file_lock_context *flctx = inode->i_flctx; 1131 struct file_lock_context *flctx = inode->i_flctx;
@@ -1214,7 +1214,7 @@ static int
1214cifs_push_locks(struct cifsFileInfo *cfile) 1214cifs_push_locks(struct cifsFileInfo *cfile)
1215{ 1215{
1216 struct cifs_sb_info *cifs_sb = CIFS_SB(cfile->dentry->d_sb); 1216 struct cifs_sb_info *cifs_sb = CIFS_SB(cfile->dentry->d_sb);
1217 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 1217 struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
1218 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 1218 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
1219 int rc = 0; 1219 int rc = 0;
1220 1220
@@ -1382,7 +1382,7 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,
1382 unsigned int max_num, num, max_buf; 1382 unsigned int max_num, num, max_buf;
1383 LOCKING_ANDX_RANGE *buf, *cur; 1383 LOCKING_ANDX_RANGE *buf, *cur;
1384 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 1384 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
1385 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 1385 struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
1386 struct cifsLockInfo *li, *tmp; 1386 struct cifsLockInfo *li, *tmp;
1387 __u64 length = 1 + flock->fl_end - flock->fl_start; 1387 __u64 length = 1 + flock->fl_end - flock->fl_start;
1388 struct list_head tmp_llist; 1388 struct list_head tmp_llist;
@@ -1488,7 +1488,7 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
1488 struct cifsFileInfo *cfile = (struct cifsFileInfo *)file->private_data; 1488 struct cifsFileInfo *cfile = (struct cifsFileInfo *)file->private_data;
1489 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 1489 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
1490 struct TCP_Server_Info *server = tcon->ses->server; 1490 struct TCP_Server_Info *server = tcon->ses->server;
1491 struct inode *inode = cfile->dentry->d_inode; 1491 struct inode *inode = d_inode(cfile->dentry);
1492 1492
1493 if (posix_lck) { 1493 if (posix_lck) {
1494 int posix_lock_type; 1494 int posix_lock_type;
@@ -1643,7 +1643,7 @@ cifs_write(struct cifsFileInfo *open_file, __u32 pid, const char *write_data,
1643 struct TCP_Server_Info *server; 1643 struct TCP_Server_Info *server;
1644 unsigned int xid; 1644 unsigned int xid;
1645 struct dentry *dentry = open_file->dentry; 1645 struct dentry *dentry = open_file->dentry;
1646 struct cifsInodeInfo *cifsi = CIFS_I(dentry->d_inode); 1646 struct cifsInodeInfo *cifsi = CIFS_I(d_inode(dentry));
1647 struct cifs_io_parms io_parms; 1647 struct cifs_io_parms io_parms;
1648 1648
1649 cifs_sb = CIFS_SB(dentry->d_sb); 1649 cifs_sb = CIFS_SB(dentry->d_sb);
@@ -1676,7 +1676,7 @@ cifs_write(struct cifsFileInfo *open_file, __u32 pid, const char *write_data,
1676 break; 1676 break;
1677 } 1677 }
1678 1678
1679 len = min(server->ops->wp_retry_size(dentry->d_inode), 1679 len = min(server->ops->wp_retry_size(d_inode(dentry)),
1680 (unsigned int)write_size - total_written); 1680 (unsigned int)write_size - total_written);
1681 /* iov[0] is reserved for smb header */ 1681 /* iov[0] is reserved for smb header */
1682 iov[1].iov_base = (char *)write_data + total_written; 1682 iov[1].iov_base = (char *)write_data + total_written;
@@ -1696,9 +1696,9 @@ cifs_write(struct cifsFileInfo *open_file, __u32 pid, const char *write_data,
1696 return rc; 1696 return rc;
1697 } 1697 }
1698 } else { 1698 } else {
1699 spin_lock(&dentry->d_inode->i_lock); 1699 spin_lock(&d_inode(dentry)->i_lock);
1700 cifs_update_eof(cifsi, *offset, bytes_written); 1700 cifs_update_eof(cifsi, *offset, bytes_written);
1701 spin_unlock(&dentry->d_inode->i_lock); 1701 spin_unlock(&d_inode(dentry)->i_lock);
1702 *offset += bytes_written; 1702 *offset += bytes_written;
1703 } 1703 }
1704 } 1704 }
@@ -1706,12 +1706,12 @@ cifs_write(struct cifsFileInfo *open_file, __u32 pid, const char *write_data,
1706 cifs_stats_bytes_written(tcon, total_written); 1706 cifs_stats_bytes_written(tcon, total_written);
1707 1707
1708 if (total_written > 0) { 1708 if (total_written > 0) {
1709 spin_lock(&dentry->d_inode->i_lock); 1709 spin_lock(&d_inode(dentry)->i_lock);
1710 if (*offset > dentry->d_inode->i_size) 1710 if (*offset > d_inode(dentry)->i_size)
1711 i_size_write(dentry->d_inode, *offset); 1711 i_size_write(d_inode(dentry), *offset);
1712 spin_unlock(&dentry->d_inode->i_lock); 1712 spin_unlock(&d_inode(dentry)->i_lock);
1713 } 1713 }
1714 mark_inode_dirty_sync(dentry->d_inode); 1714 mark_inode_dirty_sync(d_inode(dentry));
1715 free_xid(xid); 1715 free_xid(xid);
1716 return total_written; 1716 return total_written;
1717} 1717}
@@ -2406,7 +2406,7 @@ cifs_uncached_writev_complete(struct work_struct *work)
2406{ 2406{
2407 struct cifs_writedata *wdata = container_of(work, 2407 struct cifs_writedata *wdata = container_of(work,
2408 struct cifs_writedata, work); 2408 struct cifs_writedata, work);
2409 struct inode *inode = wdata->cfile->dentry->d_inode; 2409 struct inode *inode = d_inode(wdata->cfile->dentry);
2410 struct cifsInodeInfo *cifsi = CIFS_I(inode); 2410 struct cifsInodeInfo *cifsi = CIFS_I(inode);
2411 2411
2412 spin_lock(&inode->i_lock); 2412 spin_lock(&inode->i_lock);
@@ -3794,7 +3794,7 @@ void cifs_oplock_break(struct work_struct *work)
3794{ 3794{
3795 struct cifsFileInfo *cfile = container_of(work, struct cifsFileInfo, 3795 struct cifsFileInfo *cfile = container_of(work, struct cifsFileInfo,
3796 oplock_break); 3796 oplock_break);
3797 struct inode *inode = cfile->dentry->d_inode; 3797 struct inode *inode = d_inode(cfile->dentry);
3798 struct cifsInodeInfo *cinode = CIFS_I(inode); 3798 struct cifsInodeInfo *cinode = CIFS_I(inode);
3799 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 3799 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
3800 struct TCP_Server_Info *server = tcon->ses->server; 3800 struct TCP_Server_Info *server = tcon->ses->server;
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 3e126d7bb2ea..55b58112d122 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -1067,7 +1067,7 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
1067 int rc; 1067 int rc;
1068 struct cifs_fid fid; 1068 struct cifs_fid fid;
1069 struct cifs_open_parms oparms; 1069 struct cifs_open_parms oparms;
1070 struct inode *inode = dentry->d_inode; 1070 struct inode *inode = d_inode(dentry);
1071 struct cifsInodeInfo *cifsInode = CIFS_I(inode); 1071 struct cifsInodeInfo *cifsInode = CIFS_I(inode);
1072 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 1072 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
1073 struct tcon_link *tlink; 1073 struct tcon_link *tlink;
@@ -1196,7 +1196,7 @@ cifs_drop_nlink(struct inode *inode)
1196} 1196}
1197 1197
1198/* 1198/*
1199 * If dentry->d_inode is null (usually meaning the cached dentry 1199 * If d_inode(dentry) is null (usually meaning the cached dentry
1200 * is a negative dentry) then we would attempt a standard SMB delete, but 1200 * is a negative dentry) then we would attempt a standard SMB delete, but
1201 * if that fails we can not attempt the fall back mechanisms on EACCESS 1201 * if that fails we can not attempt the fall back mechanisms on EACCESS
1202 * but will return the EACCESS to the caller. Note that the VFS does not call 1202 * but will return the EACCESS to the caller. Note that the VFS does not call
@@ -1207,7 +1207,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
1207 int rc = 0; 1207 int rc = 0;
1208 unsigned int xid; 1208 unsigned int xid;
1209 char *full_path = NULL; 1209 char *full_path = NULL;
1210 struct inode *inode = dentry->d_inode; 1210 struct inode *inode = d_inode(dentry);
1211 struct cifsInodeInfo *cifs_inode; 1211 struct cifsInodeInfo *cifs_inode;
1212 struct super_block *sb = dir->i_sb; 1212 struct super_block *sb = dir->i_sb;
1213 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 1213 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
@@ -1551,13 +1551,13 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
1551 cifs_put_tlink(tlink); 1551 cifs_put_tlink(tlink);
1552 1552
1553 if (!rc) { 1553 if (!rc) {
1554 spin_lock(&direntry->d_inode->i_lock); 1554 spin_lock(&d_inode(direntry)->i_lock);
1555 i_size_write(direntry->d_inode, 0); 1555 i_size_write(d_inode(direntry), 0);
1556 clear_nlink(direntry->d_inode); 1556 clear_nlink(d_inode(direntry));
1557 spin_unlock(&direntry->d_inode->i_lock); 1557 spin_unlock(&d_inode(direntry)->i_lock);
1558 } 1558 }
1559 1559
1560 cifsInode = CIFS_I(direntry->d_inode); 1560 cifsInode = CIFS_I(d_inode(direntry));
1561 /* force revalidate to go get info when needed */ 1561 /* force revalidate to go get info when needed */
1562 cifsInode->time = 0; 1562 cifsInode->time = 0;
1563 1563
@@ -1568,7 +1568,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
1568 */ 1568 */
1569 cifsInode->time = 0; 1569 cifsInode->time = 0;
1570 1570
1571 direntry->d_inode->i_ctime = inode->i_ctime = inode->i_mtime = 1571 d_inode(direntry)->i_ctime = inode->i_ctime = inode->i_mtime =
1572 current_fs_time(inode->i_sb); 1572 current_fs_time(inode->i_sb);
1573 1573
1574rmdir_exit: 1574rmdir_exit:
@@ -1727,7 +1727,7 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
1727 1727
1728unlink_target: 1728unlink_target:
1729 /* Try unlinking the target dentry if it's not negative */ 1729 /* Try unlinking the target dentry if it's not negative */
1730 if (target_dentry->d_inode && (rc == -EACCES || rc == -EEXIST)) { 1730 if (d_really_is_positive(target_dentry) && (rc == -EACCES || rc == -EEXIST)) {
1731 if (d_is_dir(target_dentry)) 1731 if (d_is_dir(target_dentry))
1732 tmprc = cifs_rmdir(target_dir, target_dentry); 1732 tmprc = cifs_rmdir(target_dir, target_dentry);
1733 else 1733 else
@@ -1867,7 +1867,7 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry)
1867{ 1867{
1868 unsigned int xid; 1868 unsigned int xid;
1869 int rc = 0; 1869 int rc = 0;
1870 struct inode *inode = dentry->d_inode; 1870 struct inode *inode = d_inode(dentry);
1871 struct super_block *sb = dentry->d_sb; 1871 struct super_block *sb = dentry->d_sb;
1872 char *full_path = NULL; 1872 char *full_path = NULL;
1873 1873
@@ -1919,7 +1919,7 @@ int cifs_revalidate_file(struct file *filp)
1919int cifs_revalidate_dentry(struct dentry *dentry) 1919int cifs_revalidate_dentry(struct dentry *dentry)
1920{ 1920{
1921 int rc; 1921 int rc;
1922 struct inode *inode = dentry->d_inode; 1922 struct inode *inode = d_inode(dentry);
1923 1923
1924 rc = cifs_revalidate_dentry_attr(dentry); 1924 rc = cifs_revalidate_dentry_attr(dentry);
1925 if (rc) 1925 if (rc)
@@ -1933,7 +1933,7 @@ int cifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
1933{ 1933{
1934 struct cifs_sb_info *cifs_sb = CIFS_SB(dentry->d_sb); 1934 struct cifs_sb_info *cifs_sb = CIFS_SB(dentry->d_sb);
1935 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); 1935 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
1936 struct inode *inode = dentry->d_inode; 1936 struct inode *inode = d_inode(dentry);
1937 int rc; 1937 int rc;
1938 1938
1939 /* 1939 /*
@@ -2110,7 +2110,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
2110 int rc; 2110 int rc;
2111 unsigned int xid; 2111 unsigned int xid;
2112 char *full_path = NULL; 2112 char *full_path = NULL;
2113 struct inode *inode = direntry->d_inode; 2113 struct inode *inode = d_inode(direntry);
2114 struct cifsInodeInfo *cifsInode = CIFS_I(inode); 2114 struct cifsInodeInfo *cifsInode = CIFS_I(inode);
2115 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 2115 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
2116 struct tcon_link *tlink; 2116 struct tcon_link *tlink;
@@ -2251,7 +2251,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
2251 unsigned int xid; 2251 unsigned int xid;
2252 kuid_t uid = INVALID_UID; 2252 kuid_t uid = INVALID_UID;
2253 kgid_t gid = INVALID_GID; 2253 kgid_t gid = INVALID_GID;
2254 struct inode *inode = direntry->d_inode; 2254 struct inode *inode = d_inode(direntry);
2255 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 2255 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
2256 struct cifsInodeInfo *cifsInode = CIFS_I(inode); 2256 struct cifsInodeInfo *cifsInode = CIFS_I(inode);
2257 char *full_path = NULL; 2257 char *full_path = NULL;
@@ -2409,7 +2409,7 @@ cifs_setattr_exit:
2409int 2409int
2410cifs_setattr(struct dentry *direntry, struct iattr *attrs) 2410cifs_setattr(struct dentry *direntry, struct iattr *attrs)
2411{ 2411{
2412 struct inode *inode = direntry->d_inode; 2412 struct inode *inode = d_inode(direntry);
2413 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 2413 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
2414 struct cifs_tcon *pTcon = cifs_sb_master_tcon(cifs_sb); 2414 struct cifs_tcon *pTcon = cifs_sb_master_tcon(cifs_sb);
2415 2415
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 2ec6037f61c7..252e672d5604 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -586,12 +586,12 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
586 * if source file is cached (oplocked) revalidate will not go to server 586 * if source file is cached (oplocked) revalidate will not go to server
587 * until the file is closed or oplock broken so update nlinks locally 587 * until the file is closed or oplock broken so update nlinks locally
588 */ 588 */
589 if (old_file->d_inode) { 589 if (d_really_is_positive(old_file)) {
590 cifsInode = CIFS_I(old_file->d_inode); 590 cifsInode = CIFS_I(d_inode(old_file));
591 if (rc == 0) { 591 if (rc == 0) {
592 spin_lock(&old_file->d_inode->i_lock); 592 spin_lock(&d_inode(old_file)->i_lock);
593 inc_nlink(old_file->d_inode); 593 inc_nlink(d_inode(old_file));
594 spin_unlock(&old_file->d_inode->i_lock); 594 spin_unlock(&d_inode(old_file)->i_lock);
595 595
596 /* 596 /*
597 * parent dir timestamps will update from srv within a 597 * parent dir timestamps will update from srv within a
@@ -629,7 +629,7 @@ cifs_hl_exit:
629void * 629void *
630cifs_follow_link(struct dentry *direntry, struct nameidata *nd) 630cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
631{ 631{
632 struct inode *inode = direntry->d_inode; 632 struct inode *inode = d_inode(direntry);
633 int rc = -ENOMEM; 633 int rc = -ENOMEM;
634 unsigned int xid; 634 unsigned int xid;
635 char *full_path = NULL; 635 char *full_path = NULL;
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 337946355b29..8442b8b8e0be 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -473,7 +473,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
473 continue; 473 continue;
474 474
475 cifs_dbg(FYI, "file id match, oplock break\n"); 475 cifs_dbg(FYI, "file id match, oplock break\n");
476 pCifsInode = CIFS_I(netfile->dentry->d_inode); 476 pCifsInode = CIFS_I(d_inode(netfile->dentry));
477 477
478 set_bit(CIFS_INODE_PENDING_OPLOCK_BREAK, 478 set_bit(CIFS_INODE_PENDING_OPLOCK_BREAK,
479 &pCifsInode->flags); 479 &pCifsInode->flags);
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index c295338e0a98..b4a47237486b 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -78,7 +78,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
78{ 78{
79 struct dentry *dentry, *alias; 79 struct dentry *dentry, *alias;
80 struct inode *inode; 80 struct inode *inode;
81 struct super_block *sb = parent->d_inode->i_sb; 81 struct super_block *sb = d_inode(parent)->i_sb;
82 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 82 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
83 83
84 cifs_dbg(FYI, "%s: for %s\n", __func__, name->name); 84 cifs_dbg(FYI, "%s: for %s\n", __func__, name->name);
@@ -88,7 +88,7 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
88 return; 88 return;
89 89
90 if (dentry) { 90 if (dentry) {
91 inode = dentry->d_inode; 91 inode = d_inode(dentry);
92 if (inode) { 92 if (inode) {
93 /* 93 /*
94 * If we're generating inode numbers, then we don't 94 * If we're generating inode numbers, then we don't
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index d2979036a4c7..7bfdd6066276 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -722,7 +722,7 @@ cifs_open_file(const unsigned int xid, struct cifs_open_parms *oparms,
722static void 722static void
723cifs_set_fid(struct cifsFileInfo *cfile, struct cifs_fid *fid, __u32 oplock) 723cifs_set_fid(struct cifsFileInfo *cfile, struct cifs_fid *fid, __u32 oplock)
724{ 724{
725 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 725 struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
726 cfile->fid.netfid = fid->netfid; 726 cfile->fid.netfid = fid->netfid;
727 cifs_set_oplock_level(cinode, oplock); 727 cifs_set_oplock_level(cinode, oplock);
728 cinode->can_cache_brlcks = CIFS_CACHE_WRITE(cinode); 728 cinode->can_cache_brlcks = CIFS_CACHE_WRITE(cinode);
diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c
index 7198eac5dddd..2ab297dae5a7 100644
--- a/fs/cifs/smb2file.c
+++ b/fs/cifs/smb2file.c
@@ -95,7 +95,7 @@ smb2_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,
95 unsigned int max_num, num = 0, max_buf; 95 unsigned int max_num, num = 0, max_buf;
96 struct smb2_lock_element *buf, *cur; 96 struct smb2_lock_element *buf, *cur;
97 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 97 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
98 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 98 struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
99 struct cifsLockInfo *li, *tmp; 99 struct cifsLockInfo *li, *tmp;
100 __u64 length = 1 + flock->fl_end - flock->fl_start; 100 __u64 length = 1 + flock->fl_end - flock->fl_start;
101 struct list_head tmp_llist; 101 struct list_head tmp_llist;
@@ -231,7 +231,7 @@ smb2_push_mandatory_locks(struct cifsFileInfo *cfile)
231 unsigned int xid; 231 unsigned int xid;
232 unsigned int max_num, max_buf; 232 unsigned int max_num, max_buf;
233 struct smb2_lock_element *buf; 233 struct smb2_lock_element *buf;
234 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 234 struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
235 struct cifs_fid_locks *fdlocks; 235 struct cifs_fid_locks *fdlocks;
236 236
237 xid = get_xid(); 237 xid = get_xid();
diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
index 22dfdf17d065..1c5907019045 100644
--- a/fs/cifs/smb2misc.c
+++ b/fs/cifs/smb2misc.c
@@ -453,7 +453,7 @@ smb2_tcon_has_lease(struct cifs_tcon *tcon, struct smb2_lease_break *rsp,
453 453
454 list_for_each(tmp, &tcon->openFileList) { 454 list_for_each(tmp, &tcon->openFileList) {
455 cfile = list_entry(tmp, struct cifsFileInfo, tlist); 455 cfile = list_entry(tmp, struct cifsFileInfo, tlist);
456 cinode = CIFS_I(cfile->dentry->d_inode); 456 cinode = CIFS_I(d_inode(cfile->dentry));
457 457
458 if (memcmp(cinode->lease_key, rsp->LeaseKey, 458 if (memcmp(cinode->lease_key, rsp->LeaseKey,
459 SMB2_LEASE_KEY_SIZE)) 459 SMB2_LEASE_KEY_SIZE))
@@ -590,7 +590,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
590 continue; 590 continue;
591 591
592 cifs_dbg(FYI, "file id match, oplock break\n"); 592 cifs_dbg(FYI, "file id match, oplock break\n");
593 cinode = CIFS_I(cfile->dentry->d_inode); 593 cinode = CIFS_I(d_inode(cfile->dentry));
594 594
595 if (!CIFS_CACHE_WRITE(cinode) && 595 if (!CIFS_CACHE_WRITE(cinode) &&
596 rsp->OplockLevel == SMB2_OPLOCK_LEVEL_NONE) 596 rsp->OplockLevel == SMB2_OPLOCK_LEVEL_NONE)
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index eab05e1aa587..54daee5ad4c1 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -524,7 +524,7 @@ smb2_print_stats(struct seq_file *m, struct cifs_tcon *tcon)
524static void 524static void
525smb2_set_fid(struct cifsFileInfo *cfile, struct cifs_fid *fid, __u32 oplock) 525smb2_set_fid(struct cifsFileInfo *cfile, struct cifs_fid *fid, __u32 oplock)
526{ 526{
527 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 527 struct cifsInodeInfo *cinode = CIFS_I(d_inode(cfile->dentry));
528 struct TCP_Server_Info *server = tlink_tcon(cfile->tlink)->ses->server; 528 struct TCP_Server_Info *server = tlink_tcon(cfile->tlink)->ses->server;
529 529
530 cfile->fid.persistent_fid = fid->persistent_fid; 530 cfile->fid.persistent_fid = fid->persistent_fid;
@@ -793,7 +793,7 @@ smb2_set_file_size(const unsigned int xid, struct cifs_tcon *tcon,
793 * If extending file more than one page make sparse. Many Linux fs 793 * If extending file more than one page make sparse. Many Linux fs
794 * make files sparse by default when extending via ftruncate 794 * make files sparse by default when extending via ftruncate
795 */ 795 */
796 inode = cfile->dentry->d_inode; 796 inode = d_inode(cfile->dentry);
797 797
798 if (!set_alloc && (size > inode->i_size + 8192)) { 798 if (!set_alloc && (size > inode->i_size + 8192)) {
799 __u8 set_sparse = 1; 799 __u8 set_sparse = 1;
@@ -1032,7 +1032,7 @@ static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon,
1032 1032
1033 xid = get_xid(); 1033 xid = get_xid();
1034 1034
1035 inode = cfile->dentry->d_inode; 1035 inode = d_inode(cfile->dentry);
1036 cifsi = CIFS_I(inode); 1036 cifsi = CIFS_I(inode);
1037 1037
1038 /* if file not oplocked can't be sure whether asking to extend size */ 1038 /* if file not oplocked can't be sure whether asking to extend size */
@@ -1083,7 +1083,7 @@ static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon,
1083 1083
1084 xid = get_xid(); 1084 xid = get_xid();
1085 1085
1086 inode = cfile->dentry->d_inode; 1086 inode = d_inode(cfile->dentry);
1087 cifsi = CIFS_I(inode); 1087 cifsi = CIFS_I(inode);
1088 1088
1089 /* Need to make file sparse, if not already, before freeing range. */ 1089 /* Need to make file sparse, if not already, before freeing range. */
@@ -1115,7 +1115,7 @@ static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon,
1115 1115
1116 xid = get_xid(); 1116 xid = get_xid();
1117 1117
1118 inode = cfile->dentry->d_inode; 1118 inode = d_inode(cfile->dentry);
1119 cifsi = CIFS_I(inode); 1119 cifsi = CIFS_I(inode);
1120 1120
1121 /* if file not oplocked can't be sure whether asking to extend size */ 1121 /* if file not oplocked can't be sure whether asking to extend size */
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index 72a4d10653d6..ff9e1f8b16a4 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -50,9 +50,9 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
50 50
51 if (direntry == NULL) 51 if (direntry == NULL)
52 return -EIO; 52 return -EIO;
53 if (direntry->d_inode == NULL) 53 if (d_really_is_negative(direntry))
54 return -EIO; 54 return -EIO;
55 sb = direntry->d_inode->i_sb; 55 sb = d_inode(direntry)->i_sb;
56 if (sb == NULL) 56 if (sb == NULL)
57 return -EIO; 57 return -EIO;
58 58
@@ -111,9 +111,9 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
111 111
112 if (direntry == NULL) 112 if (direntry == NULL)
113 return -EIO; 113 return -EIO;
114 if (direntry->d_inode == NULL) 114 if (d_really_is_negative(direntry))
115 return -EIO; 115 return -EIO;
116 sb = direntry->d_inode->i_sb; 116 sb = d_inode(direntry)->i_sb;
117 if (sb == NULL) 117 if (sb == NULL)
118 return -EIO; 118 return -EIO;
119 119
@@ -177,12 +177,12 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
177 memcpy(pacl, ea_value, value_size); 177 memcpy(pacl, ea_value, value_size);
178 if (pTcon->ses->server->ops->set_acl) 178 if (pTcon->ses->server->ops->set_acl)
179 rc = pTcon->ses->server->ops->set_acl(pacl, 179 rc = pTcon->ses->server->ops->set_acl(pacl,
180 value_size, direntry->d_inode, 180 value_size, d_inode(direntry),
181 full_path, CIFS_ACL_DACL); 181 full_path, CIFS_ACL_DACL);
182 else 182 else
183 rc = -EOPNOTSUPP; 183 rc = -EOPNOTSUPP;
184 if (rc == 0) /* force revalidate of the inode */ 184 if (rc == 0) /* force revalidate of the inode */
185 CIFS_I(direntry->d_inode)->time = 0; 185 CIFS_I(d_inode(direntry))->time = 0;
186 kfree(pacl); 186 kfree(pacl);
187 } 187 }
188#else 188#else
@@ -246,9 +246,9 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
246 246
247 if (direntry == NULL) 247 if (direntry == NULL)
248 return -EIO; 248 return -EIO;
249 if (direntry->d_inode == NULL) 249 if (d_really_is_negative(direntry))
250 return -EIO; 250 return -EIO;
251 sb = direntry->d_inode->i_sb; 251 sb = d_inode(direntry)->i_sb;
252 if (sb == NULL) 252 if (sb == NULL)
253 return -EIO; 253 return -EIO;
254 254
@@ -324,7 +324,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
324 goto get_ea_exit; /* rc already EOPNOTSUPP */ 324 goto get_ea_exit; /* rc already EOPNOTSUPP */
325 325
326 pacl = pTcon->ses->server->ops->get_acl(cifs_sb, 326 pacl = pTcon->ses->server->ops->get_acl(cifs_sb,
327 direntry->d_inode, full_path, &acllen); 327 d_inode(direntry), full_path, &acllen);
328 if (IS_ERR(pacl)) { 328 if (IS_ERR(pacl)) {
329 rc = PTR_ERR(pacl); 329 rc = PTR_ERR(pacl);
330 cifs_dbg(VFS, "%s: error %zd getting sec desc\n", 330 cifs_dbg(VFS, "%s: error %zd getting sec desc\n",
@@ -382,9 +382,9 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
382 382
383 if (direntry == NULL) 383 if (direntry == NULL)
384 return -EIO; 384 return -EIO;
385 if (direntry->d_inode == NULL) 385 if (d_really_is_negative(direntry))
386 return -EIO; 386 return -EIO;
387 sb = direntry->d_inode->i_sb; 387 sb = d_inode(direntry)->i_sb;
388 if (sb == NULL) 388 if (sb == NULL)
389 return -EIO; 389 return -EIO;
390 390