]> err.no Git - linux-2.6/blobdiff - fs/cifs/inode.c
Merge branch 'work'
[linux-2.6] / fs / cifs / inode.c
index 053c1cadf7031b805e752a26488c04166bcd6074..3ebce9430f4a9f6af94085f998d4682027d01edc 100644 (file)
@@ -770,6 +770,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
                                                 -1, -1, local_nls); */
                        if(direntry->d_inode) {
                                direntry->d_inode->i_mode = mode;
+                               direntry->d_inode->i_mode |= S_IFDIR;
                                if(cifs_sb->mnt_cifs_flags & 
                                     CIFS_MOUNT_SET_UID) {
                                        direntry->d_inode->i_uid = 
@@ -778,6 +779,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
                                                current->fsgid;
                                }
                        }
+               }
        }
        kfree(full_path);
        FreeXid(xid);
@@ -1038,9 +1040,9 @@ int cifs_revalidate(struct dentry *direntry)
        }
 
        /* can not grab this sem since kernel filesys locking documentation
-          indicates i_sem may be taken by the kernel on lookup and rename
-          which could deadlock if we grab the i_sem here as well */
-/*     down(&direntry->d_inode->i_sem);*/
+          indicates i_mutex may be taken by the kernel on lookup and rename
+          which could deadlock if we grab the i_mutex here as well */
+/*     mutex_lock(&direntry->d_inode->i_mutex);*/
        /* need to write out dirty pages here  */
        if (direntry->d_inode->i_mapping) {
                /* do we need to lock inode until after invalidate completes
@@ -1064,7 +1066,7 @@ int cifs_revalidate(struct dentry *direntry)
                        }
                }
        }
-/*     up(&direntry->d_inode->i_sem); */
+/*     mutex_unlock(&direntry->d_inode->i_mutex); */
        
        kfree(full_path);
        FreeXid(xid);
@@ -1124,7 +1126,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
        cifs_sb = CIFS_SB(direntry->d_inode->i_sb);
        pTcon = cifs_sb->tcon;
 
-       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM == 0) {
+       if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) == 0) {
                /* check if we have permission to change attrs */
                rc = inode_change_ok(direntry->d_inode, attrs);
                if(rc < 0) {
@@ -1146,8 +1148,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
        /* BB check if we need to refresh inode from server now ? BB */
 
        /* need to flush data before changing file size on server */
-       filemap_fdatawrite(direntry->d_inode->i_mapping);
-       filemap_fdatawait(direntry->d_inode->i_mapping);
+       filemap_write_and_wait(direntry->d_inode->i_mapping);
 
        if (attrs->ia_valid & ATTR_SIZE) {
                /* To avoid spurious oplock breaks from server, in the case of