Merge branch 'for-2.6.40' of git://linux-nfs.org/~bfields/linux
[deliverable/linux.git] / fs / quota / dquot.c
index fcc8ae75d8743383c8a3436a867bb8c12b1b08b9..5b572c89e6c4bcbb028b5faf417c098503cc2991 100644 (file)
@@ -442,7 +442,7 @@ EXPORT_SYMBOL(dquot_acquire);
  */
 int dquot_commit(struct dquot *dquot)
 {
-       int ret = 0, ret2 = 0;
+       int ret = 0;
        struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);
 
        mutex_lock(&dqopt->dqio_mutex);
@@ -454,15 +454,10 @@ int dquot_commit(struct dquot *dquot)
        spin_unlock(&dq_list_lock);
        /* Inactive dquot can be only if there was error during read/init
         * => we have better not writing it */
-       if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) {
+       if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags))
                ret = dqopt->ops[dquot->dq_type]->commit_dqblk(dquot);
-               if (info_dirty(&dqopt->info[dquot->dq_type])) {
-                       ret2 = dqopt->ops[dquot->dq_type]->write_file_info(
-                                               dquot->dq_sb, dquot->dq_type);
-               }
-               if (ret >= 0)
-                       ret = ret2;
-       }
+       else
+               ret = -EIO;
 out_sem:
        mutex_unlock(&dqopt->dqio_mutex);
        return ret;
@@ -696,8 +691,11 @@ static void prune_dqcache(int count)
  * This is called from kswapd when we think we need some
  * more memory
  */
-static int shrink_dqcache_memory(struct shrinker *shrink, int nr, gfp_t gfp_mask)
+static int shrink_dqcache_memory(struct shrinker *shrink,
+                                struct shrink_control *sc)
 {
+       int nr = sc->nr_to_scan;
+
        if (nr) {
                spin_lock(&dq_list_lock);
                prune_dqcache(nr);
@@ -956,7 +954,7 @@ static inline int dqput_blocks(struct dquot *dquot)
 
 /*
  * Remove references to dquots from inode and add dquot to list for freeing
- * if we have the last referece to dquot
+ * if we have the last reference to dquot
  * We can't race with anybody because we hold dqptr_sem for writing...
  */
 static int remove_inode_dquot_ref(struct inode *inode, int type,
This page took 0.025137 seconds and 5 git commands to generate.