aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 23:16:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-26 23:16:07 -0500
commitd895cb1af15c04c522a25c79cc429076987c089b (patch)
tree895dc9157e28f603d937a58be664e4e440d5530c /fs/cifs
parent9626357371b519f2b955fef399647181034a77fe (diff)
parentd3d009cb965eae7e002ea5badf603ea8f4c34915 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile (part one) from Al Viro: "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent locking violations, etc. The most visible changes here are death of FS_REVAL_DOT (replaced with "has ->d_weak_revalidate()") and a new helper getting from struct file to inode. Some bits of preparation to xattr method interface changes. Misc patches by various people sent this cycle *and* ocfs2 fixes from several cycles ago that should've been upstream right then. PS: the next vfs pile will be xattr stuff." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits) saner proc_get_inode() calling conventions proc: avoid extra pde_put() in proc_fill_super() fs: change return values from -EACCES to -EPERM fs/exec.c: make bprm_mm_init() static ocfs2/dlm: use GFP_ATOMIC inside a spin_lock ocfs2: fix possible use-after-free with AIO ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero target: writev() on single-element vector is pointless export kernel_write(), convert open-coded instances fs: encode_fh: return FILEID_INVALID if invalid fid_type kill f_vfsmnt vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op nfsd: handle vfs_getattr errors in acl protocol switch vfs_getattr() to struct path default SET_PERSONALITY() in linux/elf.h ceph: prepopulate inodes only when request is aborted d_hash_and_lookup(): export, switch open-coded instances 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate() 9p: split dropping the acls from v9fs_set_create_acl() ...
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifsfs.c6
-rw-r--r--fs/cifs/file.c26
-rw-r--r--fs/cifs/inode.c8
-rw-r--r--fs/cifs/ioctl.c2
-rw-r--r--fs/cifs/readdir.c12
5 files changed, 26 insertions, 28 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 9be09b21b4e0..4bad7b16271f 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -683,7 +683,7 @@ out_nls:
683static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, 683static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
684 unsigned long nr_segs, loff_t pos) 684 unsigned long nr_segs, loff_t pos)
685{ 685{
686 struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; 686 struct inode *inode = file_inode(iocb->ki_filp);
687 ssize_t written; 687 ssize_t written;
688 int rc; 688 int rc;
689 689
@@ -707,7 +707,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int whence)
707 */ 707 */
708 if (whence != SEEK_SET && whence != SEEK_CUR) { 708 if (whence != SEEK_SET && whence != SEEK_CUR) {
709 int rc; 709 int rc;
710 struct inode *inode = file->f_path.dentry->d_inode; 710 struct inode *inode = file_inode(file);
711 711
712 /* 712 /*
713 * We need to be sure that all dirty pages are written and the 713 * We need to be sure that all dirty pages are written and the
@@ -739,7 +739,7 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
739{ 739{
740 /* note that this is called by vfs setlease with lock_flocks held 740 /* note that this is called by vfs setlease with lock_flocks held
741 to protect *lease from going away */ 741 to protect *lease from going away */
742 struct inode *inode = file->f_path.dentry->d_inode; 742 struct inode *inode = file_inode(file);
743 struct cifsFileInfo *cfile = file->private_data; 743 struct cifsFileInfo *cfile = file->private_data;
744 744
745 if (!(S_ISREG(inode->i_mode))) 745 if (!(S_ISREG(inode->i_mode)))
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index a8d8b589ee0e..c16d2a018ab8 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -947,7 +947,7 @@ static int
947cifs_posix_lock_test(struct file *file, struct file_lock *flock) 947cifs_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)
974static int 974static int
975cifs_posix_lock_set(struct file *file, struct file_lock *flock) 975cifs_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 */
2247int cifs_flush(struct file *file, fl_owner_t id) 2247int 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
2543cifs_strict_writev(struct kiocb *iocb, const struct iovec *iov, 2543cifs_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
2915cifs_strict_readv(struct kiocb *iocb, const struct iovec *iov, 2915cifs_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 = {
3063int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma) 3063int 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 9638233964fc..d2a833999bcc 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -299,7 +299,7 @@ cifs_get_file_info_unix(struct file *filp)
299 unsigned int xid; 299 unsigned int xid;
300 FILE_UNIX_BASIC_INFO find_data; 300 FILE_UNIX_BASIC_INFO find_data;
301 struct cifs_fattr fattr; 301 struct cifs_fattr fattr;
302 struct inode *inode = filp->f_path.dentry->d_inode; 302 struct inode *inode = file_inode(filp);
303 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 303 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
304 struct cifsFileInfo *cfile = filp->private_data; 304 struct cifsFileInfo *cfile = filp->private_data;
305 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 305 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
@@ -568,7 +568,7 @@ cifs_get_file_info(struct file *filp)
568 unsigned int xid; 568 unsigned int xid;
569 FILE_ALL_INFO find_data; 569 FILE_ALL_INFO find_data;
570 struct cifs_fattr fattr; 570 struct cifs_fattr fattr;
571 struct inode *inode = filp->f_path.dentry->d_inode; 571 struct inode *inode = file_inode(filp);
572 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 572 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
573 struct cifsFileInfo *cfile = filp->private_data; 573 struct cifsFileInfo *cfile = filp->private_data;
574 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 574 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
@@ -1688,7 +1688,7 @@ cifs_invalidate_mapping(struct inode *inode)
1688int cifs_revalidate_file_attr(struct file *filp) 1688int cifs_revalidate_file_attr(struct file *filp)
1689{ 1689{
1690 int rc = 0; 1690 int rc = 0;
1691 struct inode *inode = filp->f_path.dentry->d_inode; 1691 struct inode *inode = file_inode(filp);
1692 struct cifsFileInfo *cfile = (struct cifsFileInfo *) filp->private_data; 1692 struct cifsFileInfo *cfile = (struct cifsFileInfo *) filp->private_data;
1693 1693
1694 if (!cifs_inode_needs_reval(inode)) 1694 if (!cifs_inode_needs_reval(inode))
@@ -1745,7 +1745,7 @@ out:
1745int cifs_revalidate_file(struct file *filp) 1745int cifs_revalidate_file(struct file *filp)
1746{ 1746{
1747 int rc; 1747 int rc;
1748 struct inode *inode = filp->f_path.dentry->d_inode; 1748 struct inode *inode = file_inode(filp);
1749 1749
1750 rc = cifs_revalidate_file_attr(filp); 1750 rc = cifs_revalidate_file_attr(filp);
1751 if (rc) 1751 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
31long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) 31long 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..df40cc5fd13a 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -82,12 +82,10 @@ cifs_prime_dcache(struct dentry *parent, struct qstr *name,
82 82
83 cFYI(1, "%s: for %s", __func__, name->name); 83 cFYI(1, "%s: for %s", __func__, name->name);
84 84
85 if (parent->d_op && parent->d_op->d_hash) 85 dentry = d_hash_and_lookup(parent, name);
86 parent->d_op->d_hash(parent, parent->d_inode, name); 86 if (unlikely(IS_ERR(dentry)))
87 else 87 return;
88 name->hash = full_name_hash(name->name, name->len);
89 88
90 dentry = d_lookup(parent, name);
91 if (dentry) { 89 if (dentry) {
92 int err; 90 int err;
93 91
@@ -505,7 +503,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 */ 503 whether we can use the cached search results from the previous search */
506static int is_dir_changed(struct file *file) 504static int is_dir_changed(struct file *file)
507{ 505{
508 struct inode *inode = file->f_path.dentry->d_inode; 506 struct inode *inode = file_inode(file);
509 struct cifsInodeInfo *cifsInfo = CIFS_I(inode); 507 struct cifsInodeInfo *cifsInfo = CIFS_I(inode);
510 508
511 if (cifsInfo->time == 0) 509 if (cifsInfo->time == 0)
@@ -778,7 +776,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
778 switch ((int) file->f_pos) { 776 switch ((int) file->f_pos) {
779 case 0: 777 case 0:
780 if (filldir(direntry, ".", 1, file->f_pos, 778 if (filldir(direntry, ".", 1, file->f_pos,
781 file->f_path.dentry->d_inode->i_ino, DT_DIR) < 0) { 779 file_inode(file)->i_ino, DT_DIR) < 0) {
782 cERROR(1, "Filldir for current dir failed"); 780 cERROR(1, "Filldir for current dir failed");
783 rc = -ENOMEM; 781 rc = -ENOMEM;
784 break; 782 break;