diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-01-23 17:07:38 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-02-22 23:31:31 -0500 |
commit | 496ad9aa8ef448058e36ca7a787c61f2e63f0f54 (patch) | |
tree | 8f4abde793cd7db5bb8fde6d27ebcacd0e54379a /fs/cifs | |
parent | 57eccb830f1cc93d4b506ba306d8dfa685e0c88f (diff) |
new helper: file_inode(file)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 6 | ||||
-rw-r--r-- | fs/cifs/file.c | 26 | ||||
-rw-r--r-- | fs/cifs/inode.c | 8 | ||||
-rw-r--r-- | fs/cifs/ioctl.c | 2 | ||||
-rw-r--r-- | fs/cifs/readdir.c | 4 |
5 files changed, 23 insertions, 23 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index de7f9168a118..8b35365c70be 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -677,7 +677,7 @@ out_nls: | |||
677 | static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | 677 | static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, |
678 | unsigned long nr_segs, loff_t pos) | 678 | unsigned long nr_segs, loff_t pos) |
679 | { | 679 | { |
680 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; | 680 | struct inode *inode = file_inode(iocb->ki_filp); |
681 | ssize_t written; | 681 | ssize_t written; |
682 | int rc; | 682 | int rc; |
683 | 683 | ||
@@ -701,7 +701,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int whence) | |||
701 | */ | 701 | */ |
702 | if (whence != SEEK_SET && whence != SEEK_CUR) { | 702 | if (whence != SEEK_SET && whence != SEEK_CUR) { |
703 | int rc; | 703 | int rc; |
704 | struct inode *inode = file->f_path.dentry->d_inode; | 704 | struct inode *inode = file_inode(file); |
705 | 705 | ||
706 | /* | 706 | /* |
707 | * We need to be sure that all dirty pages are written and the | 707 | * We need to be sure that all dirty pages are written and the |
@@ -733,7 +733,7 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease) | |||
733 | { | 733 | { |
734 | /* note that this is called by vfs setlease with lock_flocks held | 734 | /* note that this is called by vfs setlease with lock_flocks held |
735 | to protect *lease from going away */ | 735 | to protect *lease from going away */ |
736 | struct inode *inode = file->f_path.dentry->d_inode; | 736 | struct inode *inode = file_inode(file); |
737 | struct cifsFileInfo *cfile = file->private_data; | 737 | struct cifsFileInfo *cfile = file->private_data; |
738 | 738 | ||
739 | if (!(S_ISREG(inode->i_mode))) | 739 | if (!(S_ISREG(inode->i_mode))) |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 8ea6ca50a665..1a5c2911b043 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -947,7 +947,7 @@ static int | |||
947 | cifs_posix_lock_test(struct file *file, struct file_lock *flock) | 947 | cifs_posix_lock_test(struct file *file, struct file_lock *flock) |
948 | { | 948 | { |
949 | int rc = 0; | 949 | int rc = 0; |
950 | struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode); | 950 | struct cifsInodeInfo *cinode = CIFS_I(file_inode(file)); |
951 | unsigned char saved_type = flock->fl_type; | 951 | unsigned char saved_type = flock->fl_type; |
952 | 952 | ||
953 | if ((flock->fl_flags & FL_POSIX) == 0) | 953 | if ((flock->fl_flags & FL_POSIX) == 0) |
@@ -974,7 +974,7 @@ cifs_posix_lock_test(struct file *file, struct file_lock *flock) | |||
974 | static int | 974 | static int |
975 | cifs_posix_lock_set(struct file *file, struct file_lock *flock) | 975 | cifs_posix_lock_set(struct file *file, struct file_lock *flock) |
976 | { | 976 | { |
977 | struct cifsInodeInfo *cinode = CIFS_I(file->f_path.dentry->d_inode); | 977 | struct cifsInodeInfo *cinode = CIFS_I(file_inode(file)); |
978 | int rc = 1; | 978 | int rc = 1; |
979 | 979 | ||
980 | if ((flock->fl_flags & FL_POSIX) == 0) | 980 | if ((flock->fl_flags & FL_POSIX) == 0) |
@@ -1548,7 +1548,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock) | |||
1548 | 1548 | ||
1549 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 1549 | cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); |
1550 | netfid = cfile->fid.netfid; | 1550 | netfid = cfile->fid.netfid; |
1551 | cinode = CIFS_I(file->f_path.dentry->d_inode); | 1551 | cinode = CIFS_I(file_inode(file)); |
1552 | 1552 | ||
1553 | if (cap_unix(tcon->ses) && | 1553 | if (cap_unix(tcon->ses) && |
1554 | (CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability)) && | 1554 | (CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability)) && |
@@ -2171,7 +2171,7 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, | |||
2171 | struct cifs_tcon *tcon; | 2171 | struct cifs_tcon *tcon; |
2172 | struct TCP_Server_Info *server; | 2172 | struct TCP_Server_Info *server; |
2173 | struct cifsFileInfo *smbfile = file->private_data; | 2173 | struct cifsFileInfo *smbfile = file->private_data; |
2174 | struct inode *inode = file->f_path.dentry->d_inode; | 2174 | struct inode *inode = file_inode(file); |
2175 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 2175 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
2176 | 2176 | ||
2177 | rc = filemap_write_and_wait_range(inode->i_mapping, start, end); | 2177 | rc = filemap_write_and_wait_range(inode->i_mapping, start, end); |
@@ -2246,7 +2246,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) | |||
2246 | */ | 2246 | */ |
2247 | int cifs_flush(struct file *file, fl_owner_t id) | 2247 | int cifs_flush(struct file *file, fl_owner_t id) |
2248 | { | 2248 | { |
2249 | struct inode *inode = file->f_path.dentry->d_inode; | 2249 | struct inode *inode = file_inode(file); |
2250 | int rc = 0; | 2250 | int rc = 0; |
2251 | 2251 | ||
2252 | if (file->f_mode & FMODE_WRITE) | 2252 | if (file->f_mode & FMODE_WRITE) |
@@ -2480,7 +2480,7 @@ ssize_t cifs_user_writev(struct kiocb *iocb, const struct iovec *iov, | |||
2480 | ssize_t written; | 2480 | ssize_t written; |
2481 | struct inode *inode; | 2481 | struct inode *inode; |
2482 | 2482 | ||
2483 | inode = iocb->ki_filp->f_path.dentry->d_inode; | 2483 | inode = file_inode(iocb->ki_filp); |
2484 | 2484 | ||
2485 | /* | 2485 | /* |
2486 | * BB - optimize the way when signing is disabled. We can drop this | 2486 | * BB - optimize the way when signing is disabled. We can drop this |
@@ -2543,7 +2543,7 @@ ssize_t | |||
2543 | cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov, | 2543 | cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov, |
2544 | unsigned long nr_segs, loff_t pos) | 2544 | unsigned long nr_segs, loff_t pos) |
2545 | { | 2545 | { |
2546 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; | 2546 | struct inode *inode = file_inode(iocb->ki_filp); |
2547 | struct cifsInodeInfo *cinode = CIFS_I(inode); | 2547 | struct cifsInodeInfo *cinode = CIFS_I(inode); |
2548 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 2548 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
2549 | struct cifsFileInfo *cfile = (struct cifsFileInfo *) | 2549 | struct cifsFileInfo *cfile = (struct cifsFileInfo *) |
@@ -2915,7 +2915,7 @@ ssize_t | |||
2915 | cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov, | 2915 | cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov, |
2916 | unsigned long nr_segs, loff_t pos) | 2916 | unsigned long nr_segs, loff_t pos) |
2917 | { | 2917 | { |
2918 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; | 2918 | struct inode *inode = file_inode(iocb->ki_filp); |
2919 | struct cifsInodeInfo *cinode = CIFS_I(inode); | 2919 | struct cifsInodeInfo *cinode = CIFS_I(inode); |
2920 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 2920 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
2921 | struct cifsFileInfo *cfile = (struct cifsFileInfo *) | 2921 | struct cifsFileInfo *cfile = (struct cifsFileInfo *) |
@@ -3063,7 +3063,7 @@ static struct vm_operations_struct cifs_file_vm_ops = { | |||
3063 | int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma) | 3063 | int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma) |
3064 | { | 3064 | { |
3065 | int rc, xid; | 3065 | int rc, xid; |
3066 | struct inode *inode = file->f_path.dentry->d_inode; | 3066 | struct inode *inode = file_inode(file); |
3067 | 3067 | ||
3068 | xid = get_xid(); | 3068 | xid = get_xid(); |
3069 | 3069 | ||
@@ -3356,7 +3356,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page, | |||
3356 | int rc; | 3356 | int rc; |
3357 | 3357 | ||
3358 | /* Is the page cached? */ | 3358 | /* Is the page cached? */ |
3359 | rc = cifs_readpage_from_fscache(file->f_path.dentry->d_inode, page); | 3359 | rc = cifs_readpage_from_fscache(file_inode(file), page); |
3360 | if (rc == 0) | 3360 | if (rc == 0) |
3361 | goto read_complete; | 3361 | goto read_complete; |
3362 | 3362 | ||
@@ -3371,8 +3371,8 @@ static int cifs_readpage_worker(struct file *file, struct page *page, | |||
3371 | else | 3371 | else |
3372 | cFYI(1, "Bytes read %d", rc); | 3372 | cFYI(1, "Bytes read %d", rc); |
3373 | 3373 | ||
3374 | file->f_path.dentry->d_inode->i_atime = | 3374 | file_inode(file)->i_atime = |
3375 | current_fs_time(file->f_path.dentry->d_inode->i_sb); | 3375 | current_fs_time(file_inode(file)->i_sb); |
3376 | 3376 | ||
3377 | if (PAGE_CACHE_SIZE > rc) | 3377 | if (PAGE_CACHE_SIZE > rc) |
3378 | memset(read_data + rc, 0, PAGE_CACHE_SIZE - rc); | 3378 | memset(read_data + rc, 0, PAGE_CACHE_SIZE - rc); |
@@ -3381,7 +3381,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page, | |||
3381 | SetPageUptodate(page); | 3381 | SetPageUptodate(page); |
3382 | 3382 | ||
3383 | /* send this page to the cache */ | 3383 | /* send this page to the cache */ |
3384 | cifs_readpage_to_fscache(file->f_path.dentry->d_inode, page); | 3384 | cifs_readpage_to_fscache(file_inode(file), page); |
3385 | 3385 | ||
3386 | rc = 0; | 3386 | rc = 0; |
3387 | 3387 | ||
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index ed6208ff85a7..1fc864b92cf2 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -289,7 +289,7 @@ cifs_get_file_info_unix(struct file *filp) | |||
289 | unsigned int xid; | 289 | unsigned int xid; |
290 | FILE_UNIX_BASIC_INFO find_data; | 290 | FILE_UNIX_BASIC_INFO find_data; |
291 | struct cifs_fattr fattr; | 291 | struct cifs_fattr fattr; |
292 | struct inode *inode = filp->f_path.dentry->d_inode; | 292 | struct inode *inode = file_inode(filp); |
293 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 293 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
294 | struct cifsFileInfo *cfile = filp->private_data; | 294 | struct cifsFileInfo *cfile = filp->private_data; |
295 | struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); | 295 | struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); |
@@ -558,7 +558,7 @@ cifs_get_file_info(struct file *filp) | |||
558 | unsigned int xid; | 558 | unsigned int xid; |
559 | FILE_ALL_INFO find_data; | 559 | FILE_ALL_INFO find_data; |
560 | struct cifs_fattr fattr; | 560 | struct cifs_fattr fattr; |
561 | struct inode *inode = filp->f_path.dentry->d_inode; | 561 | struct inode *inode = file_inode(filp); |
562 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | 562 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); |
563 | struct cifsFileInfo *cfile = filp->private_data; | 563 | struct cifsFileInfo *cfile = filp->private_data; |
564 | struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); | 564 | struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); |
@@ -1678,7 +1678,7 @@ cifs_invalidate_mapping(struct inode *inode) | |||
1678 | int cifs_revalidate_file_attr(struct file *filp) | 1678 | int cifs_revalidate_file_attr(struct file *filp) |
1679 | { | 1679 | { |
1680 | int rc = 0; | 1680 | int rc = 0; |
1681 | struct inode *inode = filp->f_path.dentry->d_inode; | 1681 | struct inode *inode = file_inode(filp); |
1682 | struct cifsFileInfo *cfile = (struct cifsFileInfo *) filp->private_data; | 1682 | struct cifsFileInfo *cfile = (struct cifsFileInfo *) filp->private_data; |
1683 | 1683 | ||
1684 | if (!cifs_inode_needs_reval(inode)) | 1684 | if (!cifs_inode_needs_reval(inode)) |
@@ -1735,7 +1735,7 @@ out: | |||
1735 | int cifs_revalidate_file(struct file *filp) | 1735 | int cifs_revalidate_file(struct file *filp) |
1736 | { | 1736 | { |
1737 | int rc; | 1737 | int rc; |
1738 | struct inode *inode = filp->f_path.dentry->d_inode; | 1738 | struct inode *inode = file_inode(filp); |
1739 | 1739 | ||
1740 | rc = cifs_revalidate_file_attr(filp); | 1740 | rc = cifs_revalidate_file_attr(filp); |
1741 | if (rc) | 1741 | if (rc) |
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c index fd5009d56f9f..6c9f1214cf0b 100644 --- a/fs/cifs/ioctl.c +++ b/fs/cifs/ioctl.c | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) | 31 | long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) |
32 | { | 32 | { |
33 | struct inode *inode = filep->f_dentry->d_inode; | 33 | struct inode *inode = file_inode(filep); |
34 | int rc = -ENOTTY; /* strange error - but the precedent */ | 34 | int rc = -ENOTTY; /* strange error - but the precedent */ |
35 | unsigned int xid; | 35 | unsigned int xid; |
36 | struct cifs_sb_info *cifs_sb; | 36 | struct cifs_sb_info *cifs_sb; |
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index cdd6ff48246b..7255b0c7aa7e 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
@@ -505,7 +505,7 @@ static int cifs_entry_is_dot(struct cifs_dirent *de, bool is_unicode) | |||
505 | whether we can use the cached search results from the previous search */ | 505 | whether we can use the cached search results from the previous search */ |
506 | static int is_dir_changed(struct file *file) | 506 | static int is_dir_changed(struct file *file) |
507 | { | 507 | { |
508 | struct inode *inode = file->f_path.dentry->d_inode; | 508 | struct inode *inode = file_inode(file); |
509 | struct cifsInodeInfo *cifsInfo = CIFS_I(inode); | 509 | struct cifsInodeInfo *cifsInfo = CIFS_I(inode); |
510 | 510 | ||
511 | if (cifsInfo->time == 0) | 511 | if (cifsInfo->time == 0) |
@@ -778,7 +778,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) | |||
778 | switch ((int) file->f_pos) { | 778 | switch ((int) file->f_pos) { |
779 | case 0: | 779 | case 0: |
780 | if (filldir(direntry, ".", 1, file->f_pos, | 780 | if (filldir(direntry, ".", 1, file->f_pos, |
781 | file->f_path.dentry->d_inode->i_ino, DT_DIR) < 0) { | 781 | file_inode(file)->i_ino, DT_DIR) < 0) { |
782 | cERROR(1, "Filldir for current dir failed"); | 782 | cERROR(1, "Filldir for current dir failed"); |
783 | rc = -ENOMEM; | 783 | rc = -ENOMEM; |
784 | break; | 784 | break; |