]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/cifs/dir.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[karo-tx-linux.git] / fs / cifs / dir.c
index 43cc0fd2f8a72eb8df8afa71088a84fd2805ed96..54dce78fbb7320cdc7d6449fa347142838d51eba 100644 (file)
@@ -129,7 +129,7 @@ cifs_bp_rename_retry:
        return full_path;
 }
 
-static int cifs_posix_open(char *full_path, struct inode **pinode,
+int cifs_posix_open(char *full_path, struct inode **pinode,
                    struct super_block *sb, int mode, int oflags,
                    int *poplock, __u16 *pnetfid, int xid)
 {
@@ -187,7 +187,9 @@ static int cifs_posix_open(char *full_path, struct inode **pinode,
        if (!pinode)
                goto posix_open_ret; /* caller does not need info */
 
-       *pinode = cifs_new_inode(sb, &presp_data->UniqueId);
+       if (*pinode == NULL)
+               *pinode = cifs_new_inode(sb, &presp_data->UniqueId);
+       /* else an inode was passed in. Update its info, don't create one */
 
        /* We do not need to close the file if new_inode fails since
           the caller will retry qpathinfo as long as inode is null */
@@ -252,7 +254,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
                return -ENOMEM;
        }
 
-       mode &= ~current->fs->umask;
+       mode &= ~current_umask();
        if (oplockEnabled)
                oplock = REQ_OPLOCK;
 
@@ -477,7 +479,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
                rc = -ENOMEM;
        else if (pTcon->unix_ext) {
                struct cifs_unix_set_info_args args = {
-                       .mode   = mode & ~current->fs->umask,
+                       .mode   = mode & ~current_umask(),
                        .ctime  = NO_CHANGE_64,
                        .atime  = NO_CHANGE_64,
                        .mtime  = NO_CHANGE_64,