From e91bcb8bb505f52e068929a9983ac3dbe137c6e3 Mon Sep 17 00:00:00 2001 From: Anton Altaparmakov Date: Thu, 7 Oct 2004 13:15:17 +0100 Subject: [PATCH] NTFS: Remove unused {__,}format_mft_record() from fs/ntfs/mft.c. Signed-off-by: Anton Altaparmakov --- fs/ntfs/ChangeLog | 1 + fs/ntfs/mft.c | 73 ----------------------------------------------- 2 files changed, 1 insertion(+), 73 deletions(-) diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index 7b311ebd5318b..18a423149b0ff 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog @@ -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. diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 99aa4decb9c2e..1bacb34022f6b 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c @@ -31,79 +31,6 @@ #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 */ -- 2.53.0