From b217296f1171c157faafa37d7be8554c34a21f79 Mon Sep 17 00:00:00 2001 From: Anton Altaparmakov Date: Thu, 30 Sep 2004 11:34:56 +0100 Subject: [PATCH] NTFS: Add vol->mft_data_pos and initialize it at mount time. Signed-off-by: Anton Altaparmakov --- fs/ntfs/ChangeLog | 1 + fs/ntfs/super.c | 17 +++++++++++------ fs/ntfs/volume.h | 2 ++ 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog index 2f2d62fc20361..05ca11e10afc3 100644 --- a/fs/ntfs/ChangeLog +++ b/fs/ntfs/ChangeLog @@ -26,6 +26,7 @@ ToDo/Notes: - Implement extent mft record deallocation 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. 2.1.19 - Many cleanups, improvements, and a minor bug fix. diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 2c93c59186c75..7d2a7b668f817 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c @@ -827,12 +827,12 @@ static BOOL parse_ntfs_boot_sector(ntfs_volume *vol, const NTFS_BOOT_SECTOR *b) } /** - * setup_lcn_allocator - initialize the cluster allocator - * @vol: volume structure for which to setup the lcn allocator + * ntfs_setup_allocators - initialize the cluster and mft allocators + * @vol: volume structure for which to setup the allocators * - * Setup the cluster (lcn) allocator to the starting values. + * Setup the cluster (lcn) and mft allocators to the starting values. */ -static void setup_lcn_allocator(ntfs_volume *vol) +static void ntfs_setup_allocators(ntfs_volume *vol) { #ifdef NTFS_RW LCN mft_zone_size, mft_lcn; @@ -902,6 +902,11 @@ static void setup_lcn_allocator(ntfs_volume *vol) vol->data2_zone_pos = 0; ntfs_debug("vol->data2_zone_pos = 0x%llx", (unsigned long long)vol->data2_zone_pos); + + /* Set the mft data allocation position to mft record 24. */ + vol->mft_data_pos = 24; + ntfs_debug("vol->mft_data_pos = 0x%llx", + (unsigned long long)vol->mft_data_pos); #endif /* NTFS_RW */ } @@ -2334,8 +2339,8 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent) */ result = parse_ntfs_boot_sector(vol, (NTFS_BOOT_SECTOR*)bh->b_data); - /* Initialize the cluster allocator. */ - setup_lcn_allocator(vol); + /* Initialize the cluster and mft allocators. */ + ntfs_setup_allocators(vol); brelse(bh); diff --git a/fs/ntfs/volume.h b/fs/ntfs/volume.h index 9775fa65895ee..4d0541350fff8 100644 --- a/fs/ntfs/volume.h +++ b/fs/ntfs/volume.h @@ -81,6 +81,8 @@ typedef struct { #ifdef NTFS_RW /* Variables used by the cluster and mft allocators. */ + s64 mft_data_pos; /* Mft record number at which to + allocate the next mft record. */ LCN mft_zone_start; /* First cluster of the mft zone. */ LCN mft_zone_end; /* First cluster beyond the mft zone. */ LCN mft_zone_pos; /* Current position in the mft zone. */ -- 2.53.0