]> git.hungrycats.org Git - linux/commitdiff
NTFS: Remove unused {__,}format_mft_record() from fs/ntfs/mft.c.
authorAnton Altaparmakov <aia21@cantab.net>
Thu, 7 Oct 2004 12:15:17 +0000 (13:15 +0100)
committerRichard Russon <ntfs@flatcap.org>
Thu, 7 Oct 2004 12:15:17 +0000 (13:15 +0100)
Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
fs/ntfs/ChangeLog
fs/ntfs/mft.c

index 7b311ebd5318bfd9273f7acf074d71c123e96aa8..18a423149b0ffdf4ba716692ef3b28b30b883f83 100644 (file)
@@ -58,6 +58,7 @@ ToDo/Notes:
          include errors.
        - Move the typedefs for runlist_element and runlist from types.h to
          runlist.h and fix resulting include errors.
+       - Remove unused {__,}format_mft_record() from fs/ntfs/mft.c.
 
 2.1.20 - Fix two stupid bugs introduced in 2.1.18 release.
 
index 99aa4decb9c2ede711d5ab1eda223ebcb7a23693..1bacb34022f6b10f77068a7ff0e70536353ee81d 100644 (file)
 #include "malloc.h"
 #include "ntfs.h"
 
-/**
- * __format_mft_record - initialize an empty mft record
- * @m:         mapped, pinned and locked for writing mft record
- * @size:      size of the mft record
- * @rec_no:    mft record number / inode number
- *
- * Private function to initialize an empty mft record. Use one of the two
- * provided format_mft_record() functions instead.
- */
-static void __format_mft_record(MFT_RECORD *m, const int size,
-               const unsigned long rec_no)
-{
-       ATTR_RECORD *a;
-
-       memset(m, 0, size);
-       m->magic = magic_FILE;
-       /* Aligned to 2-byte boundary. */
-       m->usa_ofs = cpu_to_le16((sizeof(MFT_RECORD) + 1) & ~1);
-       m->usa_count = cpu_to_le16(size / NTFS_BLOCK_SIZE + 1);
-       /* Set the update sequence number to 1. */
-       *(le16*)((char*)m + ((sizeof(MFT_RECORD) + 1) & ~1)) = cpu_to_le16(1);
-       m->lsn = cpu_to_le64(0LL);
-       m->sequence_number = cpu_to_le16(1);
-       m->link_count = 0;
-       /* Aligned to 8-byte boundary. */
-       m->attrs_offset = cpu_to_le16((le16_to_cpu(m->usa_ofs) +
-                       (le16_to_cpu(m->usa_count) << 1) + 7) & ~7);
-       m->flags = 0;
-       /*
-        * Using attrs_offset plus eight bytes (for the termination attribute),
-        * aligned to 8-byte boundary.
-        */
-       m->bytes_in_use = cpu_to_le32((le16_to_cpu(m->attrs_offset) + 8 + 7) &
-                       ~7);
-       m->bytes_allocated = cpu_to_le32(size);
-       m->base_mft_record = cpu_to_le64((MFT_REF)0);
-       m->next_attr_instance = 0;
-       a = (ATTR_RECORD*)((char*)m + le16_to_cpu(m->attrs_offset));
-       a->type = AT_END;
-       a->length = 0;
-}
-
-/**
- * format_mft_record - initialize an empty mft record
- * @ni:                ntfs inode of mft record
- * @mft_rec:   mapped, pinned and locked mft record (optional)
- *
- * Initialize an empty mft record. This is used when extending the MFT.
- *
- * If @mft_rec is NULL, we call map_mft_record() to obtain the
- * record and we unmap it again when finished.
- *
- * We return 0 on success or -errno on error.
- */
-int format_mft_record(ntfs_inode *ni, MFT_RECORD *mft_rec)
-{
-       MFT_RECORD *m;
-
-       if (mft_rec)
-               m = mft_rec;
-       else {
-               m = map_mft_record(ni);
-               if (IS_ERR(m))
-                       return PTR_ERR(m);
-       }
-       __format_mft_record(m, ni->vol->mft_record_size, ni->mft_no);
-       if (!mft_rec) {
-               // FIXME: Need to set the mft record dirty!
-               unmap_mft_record(ni);
-       }
-       return 0;
-}
-
 /**
  * ntfs_readpage - external declaration, function is in fs/ntfs/aops.c
  */