]> git.hungrycats.org Git - linux/commitdiff
NTFS: Rename init_runlist() to ntfs_init_runlist(), ntfs_vcn_to_lcn() to
authorAnton Altaparmakov <aia21@cantab.net>
Thu, 30 Sep 2004 10:49:53 +0000 (11:49 +0100)
committerAnton Altaparmakov <aia21@cantab.net>
Thu, 30 Sep 2004 10:49:53 +0000 (11:49 +0100)
      ntfs_rl_vcn_to_lcn(), decompress_mapping_pairs() to
      ntfs_mapping_pairs_decompress() and adapt all callers.

Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
fs/ntfs/ChangeLog
fs/ntfs/aops.c
fs/ntfs/attrib.c
fs/ntfs/compress.c
fs/ntfs/inode.c
fs/ntfs/runlist.c
fs/ntfs/runlist.h

index 05ca11e10afc30a340527ca5b242b7aaf6937c91..2b0306ece05bc5f7b5d7aceaf581d33d2c65537b 100644 (file)
@@ -27,6 +27,9 @@ ToDo/Notes:
          fs/ntfs/mft.c::ntfs_extent_mft_record_free().
        - Splitt runlist related functions off from attrib.[hc] to runlist.[hc].
        - Add vol->mft_data_pos and initialize it at mount time.
+       - Rename init_runlist() to ntfs_init_runlist(), ntfs_vcn_to_lcn() to
+         ntfs_rl_vcn_to_lcn(), decompress_mapping_pairs() to
+         ntfs_mapping_pairs_decompress() and adapt all callers.
 
 2.1.19 - Many cleanups, improvements, and a minor bug fix.
 
index edcc9fbf6c09b4c1a48c17471ce9083549ad065e..e343c50d80b10c3d2c7a79f92420b703b12acbc8 100644 (file)
@@ -232,7 +232,7 @@ lock_retry_remap:
                                /* Seek to element containing target vcn. */
                                while (rl->length && rl[1].vcn <= vcn)
                                        rl++;
-                               lcn = ntfs_vcn_to_lcn(rl, vcn);
+                               lcn = ntfs_rl_vcn_to_lcn(rl, vcn);
                        } else
                                lcn = (LCN)LCN_RL_NOT_MAPPED;
                        /* Successful remap. */
@@ -266,7 +266,7 @@ lock_retry_remap:
                        }
                        /* Hard error, zero out region. */
                        SetPageError(page);
-                       ntfs_error(vol->sb, "ntfs_vcn_to_lcn(vcn = 0x%llx) "
+                       ntfs_error(vol->sb, "ntfs_rl_vcn_to_lcn(vcn = 0x%llx) "
                                        "failed with error code 0x%llx%s.",
                                        (unsigned long long)vcn,
                                        (unsigned long long)-lcn,
@@ -274,9 +274,9 @@ lock_retry_remap:
                        // FIXME: Depending on vol->on_errors, do something.
                }
                /*
-                * 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.
+                * Either iblock was outside lblock limits or
+                * ntfs_rl_vcn_to_lcn() returned error.  Just zero that portion
+                * of the page and set the buffer uptodate.
                 */
 handle_hole:
                bh->b_blocknr = -1UL;
@@ -637,7 +637,7 @@ lock_retry_remap:
                        /* Seek to element containing target vcn. */
                        while (rl->length && rl[1].vcn <= vcn)
                                rl++;
-                       lcn = ntfs_vcn_to_lcn(rl, vcn);
+                       lcn = ntfs_rl_vcn_to_lcn(rl, vcn);
                } else
                        lcn = (LCN)LCN_RL_NOT_MAPPED;
                /* Successful remap. */
@@ -673,7 +673,7 @@ lock_retry_remap:
                }
                /* Failed to map the buffer, even after retrying. */
                bh->b_blocknr = -1UL;
-               ntfs_error(vol->sb, "ntfs_vcn_to_lcn(vcn = 0x%llx) failed "
+               ntfs_error(vol->sb, "ntfs_rl_vcn_to_lcn(vcn = 0x%llx) failed "
                                "with error code 0x%llx%s.",
                                (unsigned long long)vcn,
                                (unsigned long long)-lcn,
@@ -1402,7 +1402,7 @@ lock_retry_remap:
                                /* Seek to element containing target vcn. */
                                while (rl->length && rl[1].vcn <= vcn)
                                        rl++;
-                               lcn = ntfs_vcn_to_lcn(rl, vcn);
+                               lcn = ntfs_rl_vcn_to_lcn(rl, vcn);
                        } else
                                lcn = (LCN)LCN_RL_NOT_MAPPED;
                        if (unlikely(lcn < 0)) {
@@ -1451,7 +1451,7 @@ lock_retry_remap:
                                 * retrying.
                                 */
                                bh->b_blocknr = -1UL;
-                               ntfs_error(vol->sb, "ntfs_vcn_to_lcn(vcn = "
+                               ntfs_error(vol->sb, "ntfs_rl_vcn_to_lcn(vcn = "
                                                "0x%llx) failed with error "
                                                "code 0x%llx%s.",
                                                (unsigned long long)vcn,
index 6c80b2d1effa1cdef6157103220a9d9dccdfe89c..286428e44be695e87b8451a039613db2beef16bb 100644 (file)
@@ -22,7 +22,6 @@
 
 #include <linux/buffer_head.h>
 #include "ntfs.h"
-//#include "dir.h"
 
 /**
  * ntfs_map_runlist - map (a part of) a runlist of an ntfs inode
@@ -66,10 +65,11 @@ int ntfs_map_runlist(ntfs_inode *ni, VCN vcn)
 
        down_write(&ni->runlist.lock);
        /* Make sure someone else didn't do the work while we were sleeping. */
-       if (likely(ntfs_vcn_to_lcn(ni->runlist.rl, vcn) <= LCN_RL_NOT_MAPPED)) {
+       if (likely(ntfs_rl_vcn_to_lcn(ni->runlist.rl, vcn) <=
+                       LCN_RL_NOT_MAPPED)) {
                runlist_element *rl;
 
-               rl = decompress_mapping_pairs(ni->vol, ctx->attr,
+               rl = ntfs_mapping_pairs_decompress(ni->vol, ctx->attr,
                                ni->runlist.rl);
                if (IS_ERR(rl))
                        err = PTR_ERR(rl);
@@ -398,14 +398,14 @@ int load_attribute_list(ntfs_volume *vol, runlist *runlist, u8 *al_start,
        rl = runlist->rl;
        /* Read all clusters specified by the runlist one run at a time. */
        while (rl->length) {
-               lcn = ntfs_vcn_to_lcn(rl, rl->vcn);
+               lcn = ntfs_rl_vcn_to_lcn(rl, rl->vcn);
                ntfs_debug("Reading vcn = 0x%llx, lcn = 0x%llx.",
                                (unsigned long long)rl->vcn,
                                (unsigned long long)lcn);
                /* The attribute list cannot be sparse. */
                if (lcn < 0) {
-                       ntfs_error(sb, "ntfs_vcn_to_lcn() failed. Cannot read "
-                                       "attribute list.");
+                       ntfs_error(sb, "ntfs_rl_vcn_to_lcn() failed.  Cannot "
+                                       "read attribute list.");
                        goto err_out;
                }
                block = lcn << vol->cluster_size_bits >> block_size_bits;
index cc3aac147ba30b888348e138a64663b0a07d3e34..1adb24dcfcde34c5681567eb86d3e4a93df1ac4a 100644 (file)
@@ -600,7 +600,7 @@ lock_retry_remap:
                        /* Seek to element containing target vcn. */
                        while (rl->length && rl[1].vcn <= vcn)
                                rl++;
-                       lcn = ntfs_vcn_to_lcn(rl, vcn);
+                       lcn = ntfs_rl_vcn_to_lcn(rl, vcn);
                } else
                        lcn = (LCN)LCN_RL_NOT_MAPPED;
                ntfs_debug("Reading vcn = 0x%llx, lcn = 0x%llx.",
@@ -926,7 +926,7 @@ map_rl_err:
 
 rl_err:
        up_read(&ni->runlist.lock);
-       ntfs_error(vol->sb, "ntfs_vcn_to_lcn() failed. Cannot read "
+       ntfs_error(vol->sb, "ntfs_rl_vcn_to_lcn() failed. Cannot read "
                        "compression block.");
        goto err_out;
 
index 873c25d9830ffb625beb5f3b03f4bf3ca3373bf2..991b1de122ab940936c925ebfba3bf9d9816bd0f 100644 (file)
@@ -376,13 +376,13 @@ static void __ntfs_init_inode(struct super_block *sb, ntfs_inode *ni)
        ni->seq_no = 0;
        atomic_set(&ni->count, 1);
        ni->vol = NTFS_SB(sb);
-       init_runlist(&ni->runlist);
+       ntfs_init_runlist(&ni->runlist);
        init_MUTEX(&ni->mrec_lock);
        ni->page = NULL;
        ni->page_ofs = 0;
        ni->attr_list_size = 0;
        ni->attr_list = NULL;
-       init_runlist(&ni->attr_list_rl);
+       ntfs_init_runlist(&ni->attr_list_rl);
        ni->itype.index.bmp_ino = NULL;
        ni->itype.index.block_size = 0;
        ni->itype.index.vcn_size = 0;
@@ -701,7 +701,7 @@ static int ntfs_read_locked_inode(struct inode *vi)
                         * Setup the runlist. No need for locking as we have
                         * exclusive access to the inode at this time.
                         */
-                       ni->attr_list_rl.rl = decompress_mapping_pairs(vol,
+                       ni->attr_list_rl.rl = ntfs_mapping_pairs_decompress(vol,
                                        ctx->attr, NULL);
                        if (IS_ERR(ni->attr_list_rl.rl)) {
                                err = PTR_ERR(ni->attr_list_rl.rl);
@@ -1672,7 +1672,7 @@ err_out:
  *
  * We solve these problems by starting with the $DATA attribute before anything
  * else and iterating using ntfs_attr_lookup($DATA) over all extents.  As each
- * extent is found, we decompress_mapping_pairs() including the implied
+ * extent is found, we ntfs_mapping_pairs_decompress() including the implied
  * ntfs_merge_runlists().  Each step of the iteration necessarily provides
  * sufficient information for the next step to complete.
  *
@@ -1810,7 +1810,7 @@ int ntfs_read_inode_mount(struct inode *vi)
                                goto put_err_out;
                        }
                        /* Setup the runlist. */
-                       ni->attr_list_rl.rl = decompress_mapping_pairs(vol,
+                       ni->attr_list_rl.rl = ntfs_mapping_pairs_decompress(vol,
                                        ctx->attr, NULL);
                        if (IS_ERR(ni->attr_list_rl.rl)) {
                                err = PTR_ERR(ni->attr_list_rl.rl);
@@ -1942,11 +1942,11 @@ int ntfs_read_inode_mount(struct inode *vi)
                 * as we have exclusive access to the inode at this time and we
                 * are a mount in progress task, too.
                 */
-               nrl = decompress_mapping_pairs(vol, attr, ni->runlist.rl);
+               nrl = ntfs_mapping_pairs_decompress(vol, attr, ni->runlist.rl);
                if (IS_ERR(nrl)) {
-                       ntfs_error(sb, "decompress_mapping_pairs() failed with "
-                                       "error code %ld. $MFT is corrupt.",
-                                       PTR_ERR(nrl));
+                       ntfs_error(sb, "ntfs_mapping_pairs_decompress() "
+                                       "failed with error code %ld.  $MFT is "
+                                       "corrupt.", PTR_ERR(nrl));
                        goto put_err_out;
                }
                ni->runlist.rl = nrl;
index f28d054691a9544e7dc7dc72b0296a38f92a4f78..523b5c0261d14ac3927109638e66fc5938aa9ca9 100644 (file)
@@ -685,7 +685,7 @@ critical_error:
 }
 
 /**
- * decompress_mapping_pairs - convert mapping pairs array to runlist
+ * ntfs_mapping_pairs_decompress - convert mapping pairs array to runlist
  * @vol:       ntfs volume on which the attribute resides
  * @attr:      attribute record whose mapping pairs array to decompress
  * @old_rl:    optional runlist in which to insert @attr's runlist
@@ -712,7 +712,7 @@ critical_error:
  * two into one, if that is possible (we check for overlap and discard the new
  * runlist if overlap present before returning ERR_PTR(-ERANGE)).
  */
-runlist_element *decompress_mapping_pairs(const ntfs_volume *vol,
+runlist_element *ntfs_mapping_pairs_decompress(const ntfs_volume *vol,
                const ATTR_RECORD *attr, runlist_element *old_rl)
 {
        VCN vcn;                /* Current vcn. */
@@ -929,7 +929,7 @@ err_out:
 }
 
 /**
- * ntfs_vcn_to_lcn - convert a vcn into a lcn given a runlist
+ * ntfs_rl_vcn_to_lcn - convert a vcn into a lcn given a runlist
  * @rl:                runlist to use for conversion
  * @vcn:       vcn to convert
  *
@@ -951,7 +951,7 @@ err_out:
  * Locking: - The caller must have locked the runlist (for reading or writing).
  *         - This function does not touch the lock.
  */
-LCN ntfs_vcn_to_lcn(const runlist_element *rl, const VCN vcn)
+LCN ntfs_rl_vcn_to_lcn(const runlist_element *rl, const VCN vcn)
 {
        int i;
 
index 8cfb40afb8bf2c40cbeaab2033760c51670d7865..0a01315a4f13547649ddb5027f30f8dad5fe9a7f 100644 (file)
@@ -28,7 +28,7 @@
 #include "layout.h"
 #include "volume.h"
 
-static inline void init_runlist(runlist *rl)
+static inline void ntfs_init_runlist(runlist *rl)
 {
        rl->rl = NULL;
        init_rwsem(&rl->lock);
@@ -40,9 +40,9 @@ typedef enum {
        LCN_ENOENT              = -3,
 } LCN_SPECIAL_VALUES;
 
-extern runlist_element *decompress_mapping_pairs(const ntfs_volume *vol,
+extern runlist_element *ntfs_mapping_pairs_decompress(const ntfs_volume *vol,
                const ATTR_RECORD *attr, runlist_element *old_rl);
 
-extern LCN ntfs_vcn_to_lcn(const runlist_element *rl, const VCN vcn);
+extern LCN ntfs_rl_vcn_to_lcn(const runlist_element *rl, const VCN vcn);
 
 #endif /* _LINUX_NTFS_RUNLIST_H */