]> err.no Git - linux-2.6/blobdiff - fs/cifs/inode.c
Merge branch 'master'
[linux-2.6] / fs / cifs / inode.c
index f65310cc60a187e9384ebcf1b7ac183de641a5b6..ff93a9f81d1c0ff0264a3647655292fcaab91156 100644 (file)
@@ -574,9 +574,9 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry)
 
        /* Unlink can be called from rename so we can not grab the sem here
           since we deadlock otherwise */
-/*     down(&direntry->d_sb->s_vfs_rename_sem);*/
+/*     mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);*/
        full_path = build_path_from_dentry(direntry);
-/*     up(&direntry->d_sb->s_vfs_rename_sem);*/
+/*     mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);*/
        if (full_path == NULL) {
                FreeXid(xid);
                return -ENOMEM;
@@ -718,9 +718,9 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
        cifs_sb = CIFS_SB(inode->i_sb);
        pTcon = cifs_sb->tcon;
 
-       down(&inode->i_sb->s_vfs_rename_sem);
+       mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
        full_path = build_path_from_dentry(direntry);
-       up(&inode->i_sb->s_vfs_rename_sem);
+       mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
        if (full_path == NULL) {
                FreeXid(xid);
                return -ENOMEM;
@@ -803,9 +803,9 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
        cifs_sb = CIFS_SB(inode->i_sb);
        pTcon = cifs_sb->tcon;
 
-       down(&inode->i_sb->s_vfs_rename_sem);
+       mutex_lock(&inode->i_sb->s_vfs_rename_mutex);
        full_path = build_path_from_dentry(direntry);
-       up(&inode->i_sb->s_vfs_rename_sem);
+       mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);
        if (full_path == NULL) {
                FreeXid(xid);
                return -ENOMEM;
@@ -1041,9 +1041,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
@@ -1067,7 +1067,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);
@@ -1137,9 +1137,9 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
                        rc = 0;
        }
                
-       down(&direntry->d_sb->s_vfs_rename_sem);
+       mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);
        full_path = build_path_from_dentry(direntry);
-       up(&direntry->d_sb->s_vfs_rename_sem);
+       mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);
        if (full_path == NULL) {
                FreeXid(xid);
                return -ENOMEM;
@@ -1149,8 +1149,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