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)
|
138 | 138 | partition->flags |= B_PARTITION_FILE_SYSTEM; |
139 | 139 | partition->content_size = cookie->super_block.NumBlocks() |
140 | 140 | * cookie->super_block.BlockSize(); |
141 | | partition->block_size = cookie->super_block.BlockSize(); |
142 | 141 | partition->content_name = strdup(cookie->super_block.name); |
143 | 142 | if (partition->content_name == NULL) |
144 | 143 | return B_NO_MEMORY; |
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)
|
91 | 91 | partition->status = B_PARTITION_VALID; |
92 | 92 | partition->flags |= B_PARTITION_FILE_SYSTEM; |
93 | 93 | partition->content_size = cookie->super_block.TotalSize(); |
94 | | partition->block_size = cookie->super_block.BlockSize(); |
95 | 94 | partition->content_name = strdup(cookie->super_block.label); |
96 | 95 | if (partition->content_name == NULL) |
97 | 96 | return B_NO_MEMORY; |
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)
|
1456 | 1456 | |
1457 | 1457 | partition->content_size = off_t(end.minute * kFramesPerMinute |
1458 | 1458 | + end.second * kFramesPerSecond + end.frame) * kFrameSize; |
1459 | | partition->block_size = kFrameSize; |
1460 | 1459 | |
1461 | 1460 | // determine volume title |
1462 | 1461 | |
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)
|
135 | 135 | partition->flags |= B_PARTITION_FILE_SYSTEM; |
136 | 136 | partition->content_size = cookie->super_block.NumBlocks() |
137 | 137 | << cookie->super_block.BlockShift(); |
138 | | partition->block_size = 1 << cookie->super_block.BlockShift(); |
139 | 138 | partition->content_name = strdup(cookie->name); |
140 | 139 | |
141 | 140 | return partition->content_name != NULL ? B_OK : B_NO_MEMORY; |
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)
|
96 | 96 | (cookie->super_block.CompatibleFeatures() |
97 | 97 | & EXT2_INCOMPATIBLE_FEATURE_64BIT) != 0) |
98 | 98 | << cookie->super_block.BlockShift(); |
99 | | partition->block_size = 1UL << cookie->super_block.BlockShift(); |
100 | 99 | partition->content_name = strdup(cookie->super_block.name); |
101 | 100 | if (partition->content_name == NULL) |
102 | 101 | return B_NO_MEMORY; |
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)
|
86 | 86 | partition->flags |= B_PARTITION_FILE_SYSTEM; |
87 | 87 | partition->content_size = volume->CountBlocks() |
88 | 88 | * volume->GetBlockSize(); |
89 | | partition->block_size = volume->GetBlockSize(); |
90 | 89 | |
91 | 90 | volume->UpdateName(partition->id); |
92 | 91 | // must be done after setting the content size |
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)
|
113 | 113 | partition->status = B_PARTITION_VALID; |
114 | 114 | partition->flags |= B_PARTITION_FILE_SYSTEM; |
115 | 115 | partition->content_size = partition->size; |
116 | | // TODO: not actually correct |
117 | | partition->block_size = volumeDescriptor.logical_block_size(); |
118 | 116 | |
119 | 117 | UdfString name(volumeDescriptor.logical_volume_identifier()); |
120 | 118 | partition->content_name = strdup(name.Utf8()); |