diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 48 |
1 files changed, 24 insertions, 24 deletions
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 | */ |
358 | void cifsFileInfo_put(struct cifsFileInfo *cifs_file) | 358 | void 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 | |||
572 | cifs_relock_file(struct cifsFileInfo *cfile) | 572 | cifs_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, | |||
927 | static void | 927 | static void |
928 | cifs_lock_add(struct cifsFileInfo *cfile, struct cifsLockInfo *lock) | 928 | cifs_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 { | |||
1125 | static int | 1125 | static int |
1126 | cifs_push_posix_locks(struct cifsFileInfo *cfile) | 1126 | cifs_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 | |||
1214 | cifs_push_locks(struct cifsFileInfo *cfile) | 1214 | cifs_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; |