[PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem
[deliverable/linux.git] / fs / ntfs / attrib.c
index bc25e88ad468edc03561c033c3338c6e3b513a56..9480a0526cd370efc366f8dd7bf1828f3682f74e 100644 (file)
@@ -21,7 +21,9 @@
  */
 
 #include <linux/buffer_head.h>
+#include <linux/sched.h>
 #include <linux/swap.h>
+#include <linux/writeback.h>
 
 #include "attrib.h"
 #include "debug.h"
@@ -89,7 +91,7 @@ int ntfs_map_runlist_nolock(ntfs_inode *ni, VCN vcn, ntfs_attr_search_ctx *ctx)
        struct page *put_this_page = NULL;
        int err = 0;
        BOOL ctx_is_temporary, ctx_needs_reset;
-       ntfs_attr_search_ctx old_ctx;
+       ntfs_attr_search_ctx old_ctx = { NULL, };
 
        ntfs_debug("Mapping runlist part containing vcn 0x%llx.",
                        (unsigned long long)vcn);
@@ -1409,7 +1411,7 @@ int ntfs_attr_can_be_non_resident(const ntfs_volume *vol, const ATTR_TYPE type)
  */
 int ntfs_attr_can_be_resident(const ntfs_volume *vol, const ATTR_TYPE type)
 {
-       if (type == AT_INDEX_ALLOCATION || type == AT_EA)
+       if (type == AT_INDEX_ALLOCATION)
                return -EPERM;
        return 0;
 }
@@ -1530,7 +1532,7 @@ int ntfs_resident_attr_value_resize(MFT_RECORD *m, ATTR_RECORD *a,
  * NOTE to self: No changes in the attribute list are required to move from
  *              a resident to a non-resident attribute.
  *
- * Locking: - The caller must hold i_sem on the inode.
+ * Locking: - The caller must hold i_mutex on the inode.
  */
 int ntfs_attr_make_non_resident(ntfs_inode *ni, const u32 data_size)
 {
@@ -1726,7 +1728,7 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni, const u32 data_size)
        /*
         * This needs to be last since the address space operations ->readpage
         * and ->writepage can run concurrently with us as they are not
-        * serialized on i_sem.  Note, we are not allowed to fail once we flip
+        * serialized on i_mutex.  Note, we are not allowed to fail once we flip
         * this switch, which is another reason to do this last.
         */
        NInoSetNonResident(ni);
@@ -2590,6 +2592,8 @@ int ntfs_attr_set(ntfs_inode *ni, const s64 ofs, const s64 cnt, const u8 val)
                /* Finally unlock and release the page. */
                unlock_page(page);
                page_cache_release(page);
+               balance_dirty_pages_ratelimited(mapping);
+               cond_resched();
        }
        /* If there is a last partial page, need to do it the slow way. */
        if (end_ofs) {
This page took 0.025374 seconds and 5 git commands to generate.