Ticket #8990: 0001-changes-for-block_size-value-being-sector_size.patch

File 0001-changes-for-block_size-value-being-sector_size.patch, 5.7 KB (added by kushalsingh007, 10 years ago)

Patch for the problem of block size not being equal to sector size.

  • src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp

    From 052f6237f8f006bd1f5855a08fc3de4bccceb316 Mon Sep 17 00:00:00 2001
    From: Kushal Singh <kushal.singh@students.iiit.ac.in>
    Date: Wed, 18 Feb 2015 15:07:44 +0530
    Subject: [PATCH] Previously the block size ( sector size ) was being reported
     incorrectly. The value of the block size of the intialized file systems was
     getting reported in place of the sector size. * Changes made in all the
     filesystem add-on codes which try to modify block_size. * Ensures that sector
     size is being reported via the BlockSize() function.
    
    ---
     src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp      | 1 -
     src/add-ons/kernel/file_systems/btrfs/kernel_interface.cpp    | 1 -
     src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp     | 1 -
     src/add-ons/kernel/file_systems/exfat/kernel_interface.cpp    | 1 -
     src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp     | 1 -
     src/add-ons/kernel/file_systems/reiserfs/kernel_interface.cpp | 1 -
     src/add-ons/kernel/file_systems/udf/kernel_interface.cpp      | 2 --
     7 files changed, 8 deletions(-)
    
    diff --git a/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp
    index c6c0f03..ff5ab9a 100644
    a b bfs_scan_partition(int fd, partition_data* partition, void* _cookie)  
    138138    partition->flags |= B_PARTITION_FILE_SYSTEM;
    139139    partition->content_size = cookie->super_block.NumBlocks()
    140140        * cookie->super_block.BlockSize();
    141     partition->block_size = cookie->super_block.BlockSize();
    142141    partition->content_name = strdup(cookie->super_block.name);
    143142    if (partition->content_name == NULL)
    144143        return B_NO_MEMORY;
  • src/add-ons/kernel/file_systems/btrfs/kernel_interface.cpp

    diff --git a/src/add-ons/kernel/file_systems/btrfs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/btrfs/kernel_interface.cpp
    index 1de0f48..c7b3959 100644
    a b btrfs_scan_partition(int fd, partition_data *partition, void *_cookie)  
    9191    partition->status = B_PARTITION_VALID;
    9292    partition->flags |= B_PARTITION_FILE_SYSTEM;
    9393    partition->content_size = cookie->super_block.TotalSize();
    94     partition->block_size = cookie->super_block.BlockSize();
    9594    partition->content_name = strdup(cookie->super_block.label);
    9695    if (partition->content_name == NULL)
    9796        return B_NO_MEMORY;
  • src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp

    diff --git a/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp b/src/add-ons/kernel/file_systems/cdda/kernel_interface.cpp
    index d31d967..e20f9dd 100644
    a b cdda_scan_partition(int fd, partition_data* partition, void* _cookie)  
    14561456
    14571457    partition->content_size = off_t(end.minute * kFramesPerMinute
    14581458        + end.second * kFramesPerSecond + end.frame) * kFrameSize;
    1459     partition->block_size = kFrameSize;
    14601459
    14611460    // determine volume title
    14621461
  • src/add-ons/kernel/file_systems/exfat/kernel_interface.cpp

    diff --git a/src/add-ons/kernel/file_systems/exfat/kernel_interface.cpp b/src/add-ons/kernel/file_systems/exfat/kernel_interface.cpp
    index 627a38b..07e6bc3 100644
    a b exfat_scan_partition(int fd, partition_data* partition, void* _cookie)  
    135135    partition->flags |= B_PARTITION_FILE_SYSTEM;
    136136    partition->content_size = cookie->super_block.NumBlocks()
    137137        << cookie->super_block.BlockShift();
    138     partition->block_size = 1 << cookie->super_block.BlockShift();
    139138    partition->content_name = strdup(cookie->name);
    140139
    141140    return partition->content_name != NULL ? B_OK : B_NO_MEMORY;
  • src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp

    diff --git a/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp b/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp
    index 9bdb045..9a00f5c 100644
    a b ext2_scan_partition(int fd, partition_data *partition, void *_cookie)  
    9696        (cookie->super_block.CompatibleFeatures()
    9797            & EXT2_INCOMPATIBLE_FEATURE_64BIT) != 0)
    9898            << cookie->super_block.BlockShift();
    99     partition->block_size = 1UL << cookie->super_block.BlockShift();
    10099    partition->content_name = strdup(cookie->super_block.name);
    101100    if (partition->content_name == NULL)
    102101        return B_NO_MEMORY;
  • src/add-ons/kernel/file_systems/reiserfs/kernel_interface.cpp

    diff --git a/src/add-ons/kernel/file_systems/reiserfs/kernel_interface.cpp b/src/add-ons/kernel/file_systems/reiserfs/kernel_interface.cpp
    index 4152a55..52a240d 100644
    a b reiserfs_scan_partition(int fd, partition_data *partition, void *_cookie)  
    8686    partition->flags |= B_PARTITION_FILE_SYSTEM;
    8787    partition->content_size = volume->CountBlocks()
    8888        * volume->GetBlockSize();
    89     partition->block_size = volume->GetBlockSize();
    9089
    9190    volume->UpdateName(partition->id);
    9291        // must be done after setting the content size
  • src/add-ons/kernel/file_systems/udf/kernel_interface.cpp

    diff --git a/src/add-ons/kernel/file_systems/udf/kernel_interface.cpp b/src/add-ons/kernel/file_systems/udf/kernel_interface.cpp
    index 7c0b6d4..7bcd1a5 100644
    a b udf_scan_partition(int fd, partition_data *partition, void *_cookie)  
    113113    partition->status = B_PARTITION_VALID;
    114114    partition->flags |= B_PARTITION_FILE_SYSTEM;
    115115    partition->content_size = partition->size;
    116         // TODO: not actually correct
    117     partition->block_size = volumeDescriptor.logical_block_size();
    118116
    119117    UdfString name(volumeDescriptor.logical_volume_identifier());
    120118    partition->content_name = strdup(name.Utf8());