This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / fs / ntfs / quota.c
index d66ca9e..d0ef418 100644 (file)
 
 #ifdef NTFS_RW
 
-#include "ntfs.h"
 #include "index.h"
 #include "quota.h"
+#include "debug.h"
+#include "ntfs.h"
 
 /**
  * ntfs_mark_quotas_out_of_date - mark the quotas out of date on an ntfs volume
@@ -37,7 +38,7 @@ BOOL ntfs_mark_quotas_out_of_date(ntfs_volume *vol)
 {
        ntfs_index_context *ictx;
        QUOTA_CONTROL_ENTRY *qce;
-       const u32 qid = QUOTA_DEFAULTS_ID;
+       const le32 qid = QUOTA_DEFAULTS_ID;
        int err;
 
        ntfs_debug("Entering.");
@@ -47,11 +48,11 @@ BOOL ntfs_mark_quotas_out_of_date(ntfs_volume *vol)
                ntfs_error(vol->sb, "Quota inodes are not open.");
                return FALSE;
        }
-       down(&vol->quota_q_ino->i_sem);
+       mutex_lock(&vol->quota_q_ino->i_mutex);
        ictx = ntfs_index_ctx_get(NTFS_I(vol->quota_q_ino));
        if (!ictx) {
                ntfs_error(vol->sb, "Failed to get index context.");
-               return FALSE;
+               goto err_out;
        }
        err = ntfs_index_lookup(&qid, sizeof(qid), ictx);
        if (err) {
@@ -97,7 +98,7 @@ BOOL ntfs_mark_quotas_out_of_date(ntfs_volume *vol)
        ntfs_index_entry_mark_dirty(ictx);
 set_done:
        ntfs_index_ctx_put(ictx);
-       up(&vol->quota_q_ino->i_sem);
+       mutex_unlock(&vol->quota_q_ino->i_mutex);
        /*
         * We set the flag so we do not try to mark the quotas out of date
         * again on remount.
@@ -107,8 +108,9 @@ done:
        ntfs_debug("Done.");
        return TRUE;
 err_out:
-       ntfs_index_ctx_put(ictx);
-       up(&vol->quota_q_ino->i_sem);
+       if (ictx)
+               ntfs_index_ctx_put(ictx);
+       mutex_unlock(&vol->quota_q_ino->i_mutex);
        return FALSE;
 }