diff options
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsproto.h | 3 | ||||
-rw-r--r-- | fs/cifs/dir.c | 12 | ||||
-rw-r--r-- | fs/cifs/dns_resolve.c | 2 | ||||
-rw-r--r-- | fs/cifs/file.c | 4 | ||||
-rw-r--r-- | fs/cifs/inode.c | 12 |
5 files changed, 16 insertions, 17 deletions
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 1d60c655e3e0..f110e0e7e947 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
@@ -107,7 +107,8 @@ extern struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, | |||
107 | 107 | ||
108 | extern struct cifsFileInfo *cifs_new_fileinfo(struct inode *newinode, | 108 | extern struct cifsFileInfo *cifs_new_fileinfo(struct inode *newinode, |
109 | __u16 fileHandle, struct file *file, | 109 | __u16 fileHandle, struct file *file, |
110 | struct vfsmount *mnt, unsigned int oflags); | 110 | struct vfsmount *mnt, unsigned int oflags, |
111 | __u32 oplock); | ||
111 | extern int cifs_posix_open(char *full_path, struct inode **pinode, | 112 | extern int cifs_posix_open(char *full_path, struct inode **pinode, |
112 | struct super_block *sb, | 113 | struct super_block *sb, |
113 | int mode, int oflags, | 114 | int mode, int oflags, |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index f9ed0751cc12..0f947bf73f8e 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -132,9 +132,9 @@ cifs_bp_rename_retry: | |||
132 | 132 | ||
133 | struct cifsFileInfo * | 133 | struct cifsFileInfo * |
134 | cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, | 134 | cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, |
135 | struct file *file, struct vfsmount *mnt, unsigned int oflags) | 135 | struct file *file, struct vfsmount *mnt, unsigned int oflags, |
136 | __u32 oplock) | ||
136 | { | 137 | { |
137 | int oplock = 0; | ||
138 | struct cifsFileInfo *pCifsFile; | 138 | struct cifsFileInfo *pCifsFile; |
139 | struct cifsInodeInfo *pCifsInode; | 139 | struct cifsInodeInfo *pCifsInode; |
140 | struct cifs_sb_info *cifs_sb = CIFS_SB(mnt->mnt_sb); | 140 | struct cifs_sb_info *cifs_sb = CIFS_SB(mnt->mnt_sb); |
@@ -143,9 +143,6 @@ cifs_new_fileinfo(struct inode *newinode, __u16 fileHandle, | |||
143 | if (pCifsFile == NULL) | 143 | if (pCifsFile == NULL) |
144 | return pCifsFile; | 144 | return pCifsFile; |
145 | 145 | ||
146 | if (oplockEnabled) | ||
147 | oplock = REQ_OPLOCK; | ||
148 | |||
149 | pCifsFile->netfid = fileHandle; | 146 | pCifsFile->netfid = fileHandle; |
150 | pCifsFile->pid = current->tgid; | 147 | pCifsFile->pid = current->tgid; |
151 | pCifsFile->pInode = igrab(newinode); | 148 | pCifsFile->pInode = igrab(newinode); |
@@ -468,7 +465,7 @@ cifs_create_set_dentry: | |||
468 | } | 465 | } |
469 | 466 | ||
470 | pfile_info = cifs_new_fileinfo(newinode, fileHandle, filp, | 467 | pfile_info = cifs_new_fileinfo(newinode, fileHandle, filp, |
471 | nd->path.mnt, oflags); | 468 | nd->path.mnt, oflags, oplock); |
472 | if (pfile_info == NULL) { | 469 | if (pfile_info == NULL) { |
473 | fput(filp); | 470 | fput(filp); |
474 | CIFSSMBClose(xid, tcon, fileHandle); | 471 | CIFSSMBClose(xid, tcon, fileHandle); |
@@ -729,7 +726,8 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
729 | 726 | ||
730 | cfile = cifs_new_fileinfo(newInode, fileHandle, filp, | 727 | cfile = cifs_new_fileinfo(newInode, fileHandle, filp, |
731 | nd->path.mnt, | 728 | nd->path.mnt, |
732 | nd->intent.open.flags); | 729 | nd->intent.open.flags, |
730 | oplock); | ||
733 | if (cfile == NULL) { | 731 | if (cfile == NULL) { |
734 | fput(filp); | 732 | fput(filp); |
735 | CIFSSMBClose(xid, pTcon, fileHandle); | 733 | CIFSSMBClose(xid, pTcon, fileHandle); |
diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c index 0eb87026cad3..548f06230a6d 100644 --- a/fs/cifs/dns_resolve.c +++ b/fs/cifs/dns_resolve.c | |||
@@ -66,7 +66,7 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) | |||
66 | /* Search for server name delimiter */ | 66 | /* Search for server name delimiter */ |
67 | sep = memchr(hostname, '\\', len); | 67 | sep = memchr(hostname, '\\', len); |
68 | if (sep) | 68 | if (sep) |
69 | len = sep - unc; | 69 | len = sep - hostname; |
70 | else | 70 | else |
71 | cFYI(1, "%s: probably server name is whole unc: %s", | 71 | cFYI(1, "%s: probably server name is whole unc: %s", |
72 | __func__, unc); | 72 | __func__, unc); |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index de748c652d11..681761c3e90c 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -277,7 +277,7 @@ int cifs_open(struct inode *inode, struct file *file) | |||
277 | 277 | ||
278 | pCifsFile = cifs_new_fileinfo(inode, netfid, file, | 278 | pCifsFile = cifs_new_fileinfo(inode, netfid, file, |
279 | file->f_path.mnt, | 279 | file->f_path.mnt, |
280 | oflags); | 280 | oflags, oplock); |
281 | if (pCifsFile == NULL) { | 281 | if (pCifsFile == NULL) { |
282 | CIFSSMBClose(xid, tcon, netfid); | 282 | CIFSSMBClose(xid, tcon, netfid); |
283 | rc = -ENOMEM; | 283 | rc = -ENOMEM; |
@@ -370,7 +370,7 @@ int cifs_open(struct inode *inode, struct file *file) | |||
370 | goto out; | 370 | goto out; |
371 | 371 | ||
372 | pCifsFile = cifs_new_fileinfo(inode, netfid, file, file->f_path.mnt, | 372 | pCifsFile = cifs_new_fileinfo(inode, netfid, file, file->f_path.mnt, |
373 | file->f_flags); | 373 | file->f_flags, oplock); |
374 | if (pCifsFile == NULL) { | 374 | if (pCifsFile == NULL) { |
375 | rc = -ENOMEM; | 375 | rc = -ENOMEM; |
376 | goto out; | 376 | goto out; |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 53cce8cc2224..00d1ff339ae6 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -835,8 +835,10 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino) | |||
835 | rc = cifs_get_inode_info(&inode, full_path, NULL, sb, | 835 | rc = cifs_get_inode_info(&inode, full_path, NULL, sb, |
836 | xid, NULL); | 836 | xid, NULL); |
837 | 837 | ||
838 | if (!inode) | 838 | if (!inode) { |
839 | return ERR_PTR(rc); | 839 | inode = ERR_PTR(rc); |
840 | goto out; | ||
841 | } | ||
840 | 842 | ||
841 | #ifdef CONFIG_CIFS_FSCACHE | 843 | #ifdef CONFIG_CIFS_FSCACHE |
842 | /* populate tcon->resource_id */ | 844 | /* populate tcon->resource_id */ |
@@ -852,13 +854,11 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino) | |||
852 | inode->i_uid = cifs_sb->mnt_uid; | 854 | inode->i_uid = cifs_sb->mnt_uid; |
853 | inode->i_gid = cifs_sb->mnt_gid; | 855 | inode->i_gid = cifs_sb->mnt_gid; |
854 | } else if (rc) { | 856 | } else if (rc) { |
855 | kfree(full_path); | ||
856 | _FreeXid(xid); | ||
857 | iget_failed(inode); | 857 | iget_failed(inode); |
858 | return ERR_PTR(rc); | 858 | inode = ERR_PTR(rc); |
859 | } | 859 | } |
860 | 860 | ||
861 | 861 | out: | |
862 | kfree(full_path); | 862 | kfree(full_path); |
863 | /* can not call macro FreeXid here since in a void func | 863 | /* can not call macro FreeXid here since in a void func |
864 | * TODO: This is no longer true | 864 | * TODO: This is no longer true |