]> err.no Git - linux-2.6/blobdiff - fs/reiserfs/file.c
[PATCH] fuse: fuse_copy_finish() order fix
[linux-2.6] / fs / reiserfs / file.c
index c20babd6216d970bdb1fbf2c879cab4de7341d2f..ad6fa964b0e7e892de207307223a71887d1bc6ac 100644 (file)
@@ -49,7 +49,7 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
        }
 
        reiserfs_write_lock(inode->i_sb);
-       down(&inode->i_sem);
+       mutex_lock(&inode->i_mutex);
        /* freeing preallocation only involves relogging blocks that
         * are already in the current transaction.  preallocation gets
         * freed at the end of each transaction, so it is impossible for
@@ -100,7 +100,7 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
                err = reiserfs_truncate_file(inode, 0);
        }
       out:
-       up(&inode->i_sem);
+       mutex_unlock(&inode->i_mutex);
        reiserfs_write_unlock(inode->i_sb);
        return err;
 }
@@ -251,12 +251,12 @@ static int reiserfs_allocate_blocks_for_region(struct reiserfs_transaction_handl
                                                       blocks_to_allocate,
                                                       blocks_to_allocate);
                        if (res != CARRY_ON) {
-                               res = -ENOSPC;
+                               res = res == QUOTA_EXCEEDED ? -EDQUOT : -ENOSPC;
                                pathrelse(&path);
                                goto error_exit;
                        }
                } else {
-                       res = -ENOSPC;
+                       res = res == QUOTA_EXCEEDED ? -EDQUOT : -ENOSPC;
                        pathrelse(&path);
                        goto error_exit;
                }
@@ -1342,7 +1342,7 @@ static ssize_t reiserfs_file_write(struct file *file,     /* the file we are going t
        if (unlikely(!access_ok(VERIFY_READ, buf, count)))
                return -EFAULT;
 
-       down(&inode->i_sem);    // locks the entire file for just us
+       mutex_lock(&inode->i_mutex);    // locks the entire file for just us
 
        pos = *ppos;
 
@@ -1360,7 +1360,7 @@ static ssize_t reiserfs_file_write(struct file *file,     /* the file we are going t
        if (res)
                goto out;
 
-       inode_update_time(inode, 1);    /* Both mtime and ctime */
+       file_update_time(file);
 
        // Ok, we are done with all the checks.
 
@@ -1532,12 +1532,12 @@ static ssize_t reiserfs_file_write(struct file *file,   /* the file we are going t
                    generic_osync_inode(inode, file->f_mapping,
                                        OSYNC_METADATA | OSYNC_DATA);
 
-       up(&inode->i_sem);
+       mutex_unlock(&inode->i_mutex);
        reiserfs_async_progress_wait(inode->i_sb);
        return (already_written != 0) ? already_written : res;
 
       out:
-       up(&inode->i_sem);      // unlock the file on exit.
+       mutex_unlock(&inode->i_mutex);  // unlock the file on exit.
        return res;
 }