]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/dquot.c
[PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem
[linux-2.6-omap-h63xx.git] / fs / dquot.c
index 2a62b3dc20ec00a76c665a8f1e9dda9808e715b6..cb6d5bfbdfd5157a96a9af7a6137b37880190151 100644 (file)
  * operation is just reading pointers from inode (or not using them at all) the
  * read lock is enough. If pointers are altered function must hold write lock
  * (these locking rules also apply for S_NOQUOTA flag in the inode - note that
- * for altering the flag i_sem is also needed).  If operation is holding
+ * for altering the flag i_mutex is also needed).  If operation is holding
  * reference to dquot in other way (e.g. quotactl ops) it must be guarded by
  * dqonoff_sem.
  * This locking assures that:
  * spinlock to internal buffers before writing.
  *
  * Lock ordering (including related VFS locks) is the following:
- *   i_sem > dqonoff_sem > iprune_sem > journal_lock > dqptr_sem >
+ *   i_mutex > dqonoff_sem > iprune_sem > journal_lock > dqptr_sem >
  *   > dquot->dq_lock > dqio_sem
- * i_sem on quota files is special (it's below dqio_sem)
+ * i_mutex on quota files is special (it's below dqio_sem)
  */
 
 static DEFINE_SPINLOCK(dq_list_lock);
@@ -1369,11 +1369,11 @@ int vfs_quota_off(struct super_block *sb, int type)
                        /* If quota was reenabled in the meantime, we have
                         * nothing to do */
                        if (!sb_has_quota_enabled(sb, cnt)) {
-                               down(&toputinode[cnt]->i_sem);
+                               mutex_lock(&toputinode[cnt]->i_mutex);
                                toputinode[cnt]->i_flags &= ~(S_IMMUTABLE |
                                  S_NOATIME | S_NOQUOTA);
                                truncate_inode_pages(&toputinode[cnt]->i_data, 0);
-                               up(&toputinode[cnt]->i_sem);
+                               mutex_unlock(&toputinode[cnt]->i_mutex);
                                mark_inode_dirty(toputinode[cnt]);
                                iput(toputinode[cnt]);
                        }
@@ -1417,7 +1417,7 @@ static int vfs_quota_on_inode(struct inode *inode, int type, int format_id)
        write_inode_now(inode, 1);
        /* And now flush the block cache so that kernel sees the changes */
        invalidate_bdev(sb->s_bdev, 0);
-       down(&inode->i_sem);
+       mutex_lock(&inode->i_mutex);
        down(&dqopt->dqonoff_sem);
        if (sb_has_quota_enabled(sb, type)) {
                error = -EBUSY;
@@ -1449,7 +1449,7 @@ static int vfs_quota_on_inode(struct inode *inode, int type, int format_id)
                goto out_file_init;
        }
        up(&dqopt->dqio_sem);
-       up(&inode->i_sem);
+       mutex_unlock(&inode->i_mutex);
        set_enable_flags(dqopt, type);
 
        add_dquot_ref(sb, type);
@@ -1470,7 +1470,7 @@ out_lock:
                inode->i_flags |= oldflags;
                up_write(&dqopt->dqptr_sem);
        }
-       up(&inode->i_sem);
+       mutex_unlock(&inode->i_mutex);
 out_fmt:
        put_quota_format(fmt);