update to 2.6.9-rc1
[linux-flexiantxendom0-3.2.10.git] / fs / ntfs / aops.c
index 0ffc1d1..9adb619 100644 (file)
@@ -170,7 +170,7 @@ static int ntfs_read_block(struct page *page)
        LCN lcn;
        ntfs_inode *ni;
        ntfs_volume *vol;
-       run_list_element *rl;
+       runlist_element *rl;
        struct buffer_head *bh, *head, *arr[MAX_BUF_PER_PAGE];
        sector_t iblock, lblock, zblock;
        unsigned int blocksize, vcn_ofs;
@@ -196,8 +196,8 @@ static int ntfs_read_block(struct page *page)
        zblock = (ni->initialized_size + blocksize - 1) >> blocksize_bits;
 
 #ifdef DEBUG
-       if (unlikely(!ni->run_list.rl && !ni->mft_no && !NInoAttr(ni)))
-               panic("NTFS: $MFT/$DATA run list has been unmapped! This is a "
+       if (unlikely(!ni->runlist.rl && !ni->mft_no && !NInoAttr(ni)))
+               panic("NTFS: $MFT/$DATA runlist has been unmapped! This is a "
                                "very serious bug! Cannot continue...");
 #endif
 
@@ -225,14 +225,14 @@ static int ntfs_read_block(struct page *page)
                                        vol->cluster_size_mask;
                        if (!rl) {
 lock_retry_remap:
-                               down_read(&ni->run_list.lock);
-                               rl = ni->run_list.rl;
+                               down_read(&ni->runlist.lock);
+                               rl = ni->runlist.rl;
                        }
                        if (likely(rl != NULL)) {
                                /* Seek to element containing target vcn. */
                                while (rl->length && rl[1].vcn <= vcn)
                                        rl++;
-                               lcn = vcn_to_lcn(rl, vcn);
+                               lcn = ntfs_vcn_to_lcn(rl, vcn);
                        } else
                                lcn = (LCN)LCN_RL_NOT_MAPPED;
                        /* Successful remap. */
@@ -252,29 +252,29 @@ lock_retry_remap:
                        /* It is a hole, need to zero it. */
                        if (lcn == LCN_HOLE)
                                goto handle_hole;
-                       /* If first try and run list unmapped, map and retry. */
+                       /* If first try and runlist unmapped, map and retry. */
                        if (!is_retry && lcn == LCN_RL_NOT_MAPPED) {
                                is_retry = TRUE;
                                /*
-                                * Attempt to map run list, dropping lock for
+                                * Attempt to map runlist, dropping lock for
                                 * the duration.
                                 */
-                               up_read(&ni->run_list.lock);
-                               if (!map_run_list(ni, vcn))
+                               up_read(&ni->runlist.lock);
+                               if (!ntfs_map_runlist(ni, vcn))
                                        goto lock_retry_remap;
                                rl = NULL;
                        }
                        /* Hard error, zero out region. */
                        SetPageError(page);
-                       ntfs_error(vol->sb, "vcn_to_lcn(vcn = 0x%llx) failed "
-                                       "with error code 0x%llx%s.",
+                       ntfs_error(vol->sb, "ntfs_vcn_to_lcn(vcn = 0x%llx) "
+                                       "failed with error code 0x%llx%s.",
                                        (unsigned long long)vcn,
                                        (unsigned long long)-lcn,
                                        is_retry ? " even after retrying" : "");
                        // FIXME: Depending on vol->on_errors, do something.
                }
                /*
-                * Either iblock was outside lblock limits or vcn_to_lcn()
+                * Either iblock was outside lblock limits or ntfs_vcn_to_lcn()
                 * returned error. Just zero that portion of the page and set
                 * the buffer uptodate.
                 */
@@ -291,7 +291,7 @@ handle_zblock:
 
        /* Release the lock if we took it. */
        if (rl)
-               up_read(&ni->run_list.lock);
+               up_read(&ni->runlist.lock);
 
        /* Check we have at least one buffer ready for i/o. */
        if (nr) {
@@ -393,7 +393,7 @@ int ntfs_readpage(struct file *file, struct page *page)
 
        /* Map, pin, and lock the mft record. */
        mrec = map_mft_record(base_ni);
-       if (unlikely(IS_ERR(mrec))) {
+       if (IS_ERR(mrec)) {
                err = PTR_ERR(mrec);
                goto err_out;
        }
@@ -473,7 +473,7 @@ static int ntfs_write_block(struct writeback_control *wbc, struct page *page)
        struct inode *vi;
        ntfs_inode *ni;
        ntfs_volume *vol;
-       run_list_element *rl;
+       runlist_element *rl;
        struct buffer_head *bh, *head;
        unsigned int blocksize, vcn_ofs;
        int err;
@@ -631,14 +631,14 @@ static int ntfs_write_block(struct writeback_control *wbc, struct page *page)
                                vol->cluster_size_mask;
                if (!rl) {
 lock_retry_remap:
-                       down_read(&ni->run_list.lock);
-                       rl = ni->run_list.rl;
+                       down_read(&ni->runlist.lock);
+                       rl = ni->runlist.rl;
                }
                if (likely(rl != NULL)) {
                        /* Seek to element containing target vcn. */
                        while (rl->length && rl[1].vcn <= vcn)
                                rl++;
-                       lcn = vcn_to_lcn(rl, vcn);
+                       lcn = ntfs_vcn_to_lcn(rl, vcn);
                } else
                        lcn = (LCN)LCN_RL_NOT_MAPPED;
                /* Successful remap. */
@@ -659,22 +659,22 @@ lock_retry_remap:
                        err = -EOPNOTSUPP;
                        break;
                }
-               /* If first try and run list unmapped, map and retry. */
+               /* If first try and runlist unmapped, map and retry. */
                if (!is_retry && lcn == LCN_RL_NOT_MAPPED) {
                        is_retry = TRUE;
                        /*
-                        * Attempt to map run list, dropping lock for
+                        * Attempt to map runlist, dropping lock for
                         * the duration.
                         */
-                       up_read(&ni->run_list.lock);
-                       err = map_run_list(ni, vcn);
+                       up_read(&ni->runlist.lock);
+                       err = ntfs_map_runlist(ni, vcn);
                        if (likely(!err))
                                goto lock_retry_remap;
                        rl = NULL;
                }
                /* Failed to map the buffer, even after retrying. */
                bh->b_blocknr = -1UL;
-               ntfs_error(vol->sb, "vcn_to_lcn(vcn = 0x%llx) failed "
+               ntfs_error(vol->sb, "ntfs_vcn_to_lcn(vcn = 0x%llx) failed "
                                "with error code 0x%llx%s.",
                                (unsigned long long)vcn,
                                (unsigned long long)-lcn,
@@ -687,7 +687,7 @@ lock_retry_remap:
 
        /* Release the lock if we took it. */
        if (rl)
-               up_read(&ni->run_list.lock);
+               up_read(&ni->runlist.lock);
 
        /* For the error case, need to reset bh to the beginning. */
        bh = head;
@@ -1111,7 +1111,7 @@ static int ntfs_writepage(struct page *page, struct writeback_control *wbc)
 
        /* Map, pin, and lock the mft record. */
        m = map_mft_record(base_ni);
-       if (unlikely(IS_ERR(m))) {
+       if (IS_ERR(m)) {
                err = PTR_ERR(m);
                m = NULL;
                ctx = NULL;
@@ -1240,7 +1240,7 @@ static int ntfs_prepare_nonresident_write(struct page *page,
        struct inode *vi;
        ntfs_inode *ni;
        ntfs_volume *vol;
-       run_list_element *rl;
+       runlist_element *rl;
        struct buffer_head *bh, *head, *wait[2], **wait_bh = wait;
        unsigned int vcn_ofs, block_start, block_end, blocksize;
        int err;
@@ -1397,14 +1397,14 @@ static int ntfs_prepare_nonresident_write(struct page *page,
                        is_retry = FALSE;
                        if (!rl) {
 lock_retry_remap:
-                               down_read(&ni->run_list.lock);
-                               rl = ni->run_list.rl;
+                               down_read(&ni->runlist.lock);
+                               rl = ni->runlist.rl;
                        }
                        if (likely(rl != NULL)) {
                                /* Seek to element containing target vcn. */
                                while (rl->length && rl[1].vcn <= vcn)
                                        rl++;
-                               lcn = vcn_to_lcn(rl, vcn);
+                               lcn = ntfs_vcn_to_lcn(rl, vcn);
                        } else
                                lcn = (LCN)LCN_RL_NOT_MAPPED;
                        if (unlikely(lcn < 0)) {
@@ -1439,11 +1439,11 @@ lock_retry_remap:
                                                lcn == LCN_RL_NOT_MAPPED) {
                                        is_retry = TRUE;
                                        /*
-                                        * Attempt to map run list, dropping
+                                        * Attempt to map runlist, dropping
                                         * lock for the duration.
                                         */
-                                       up_read(&ni->run_list.lock);
-                                       err = map_run_list(ni, vcn);
+                                       up_read(&ni->runlist.lock);
+                                       err = ntfs_map_runlist(ni, vcn);
                                        if (likely(!err))
                                                goto lock_retry_remap;
                                        rl = NULL;
@@ -1453,9 +1453,9 @@ lock_retry_remap:
                                 * retrying.
                                 */
                                bh->b_blocknr = -1UL;
-                               ntfs_error(vol->sb, "vcn_to_lcn(vcn = 0x%llx) "
-                                               "failed with error code "
-                                               "0x%llx%s.",
+                               ntfs_error(vol->sb, "ntfs_vcn_to_lcn(vcn = "
+                                               "0x%llx) failed with error "
+                                               "code 0x%llx%s.",
                                                (unsigned long long)vcn,
                                                (unsigned long long)-lcn,
                                                is_retry ? " even after "
@@ -1530,7 +1530,7 @@ lock_retry_remap:
 
        /* Release the lock if we took it. */
        if (rl) {
-               up_read(&ni->run_list.lock);
+               up_read(&ni->runlist.lock);
                rl = NULL;
        }
 
@@ -1576,7 +1576,7 @@ err_out:
        if (is_retry)
                flush_dcache_page(page);
        if (rl)
-               up_read(&ni->run_list.lock);
+               up_read(&ni->runlist.lock);
        return err;
 }
 
@@ -1885,7 +1885,7 @@ static int ntfs_commit_write(struct file *file, struct page *page,
 
        /* Map, pin, and lock the mft record. */
        m = map_mft_record(base_ni);
-       if (unlikely(IS_ERR(m))) {
+       if (IS_ERR(m)) {
                err = PTR_ERR(m);
                m = NULL;
                ctx = NULL;