aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ntfs
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-04-06 16:09:21 +0100
committerAnton Altaparmakov <aia21@cantab.net>2005-05-05 11:48:00 +0100
commit7fafb8b634121f4fa35ff92f85737f8bc2259f06 (patch)
treeed581b567781b6b2a99a9f2059e3f3c324a0c928 /fs/ntfs
parentbb3cf33509009132cf8c7a7729f9d26c0c5fa961 (diff)
downloadlinux-7fafb8b634121f4fa35ff92f85737f8bc2259f06.tar.gz
NTFS: Minor cleanup: Define and use NTFS_MAX_CLUSTER_SIZE constant instead
of hard coded 0x10000 in fs/ntfs/super.c. Signed-off-by: Anton Altaparmakov <aia21@cantab.net>
Diffstat (limited to 'fs/ntfs')
-rw-r--r--fs/ntfs/ChangeLog2
-rw-r--r--fs/ntfs/ntfs.h3
-rw-r--r--fs/ntfs/super.c6
3 files changed, 8 insertions, 3 deletions
diff --git a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
index 52f868a9662b56..788e3bd2528b5d 100644
--- a/fs/ntfs/ChangeLog
+++ b/fs/ntfs/ChangeLog
@@ -111,6 +111,8 @@ ToDo/Notes:
refusing the mount. Thanks to Bernd Casimir for pointing this
problem out.
- Update attribute definition handling.
+ - Add NTFS_MAX_CLUSTER_SIZE and NTFS_MAX_PAGES_PER_CLUSTER constants.
+ - Use NTFS_MAX_CLUSTER_SIZE in super.c instead of hard coding 0x10000.
2.1.22 - Many bug and race fixes and error handling improvements.
diff --git a/fs/ntfs/ntfs.h b/fs/ntfs/ntfs.h
index e85f6e928b1ef9..446b5014115cfb 100644
--- a/fs/ntfs/ntfs.h
+++ b/fs/ntfs/ntfs.h
@@ -31,6 +31,7 @@
#include <linux/fs.h>
#include <linux/nls.h>
#include <linux/smp.h>
+#include <linux/pagemap.h>
#include "types.h"
#include "volume.h"
@@ -42,6 +43,8 @@ typedef enum {
NTFS_SB_MAGIC = 0x5346544e, /* 'NTFS' */
NTFS_MAX_NAME_LEN = 255,
NTFS_MAX_ATTR_NAME_LEN = 255,
+ NTFS_MAX_CLUSTER_SIZE = 64 * 1024, /* 64kiB */
+ NTFS_MAX_PAGES_PER_CLUSTER = NTFS_MAX_CLUSTER_SIZE / PAGE_CACHE_SIZE,
} NTFS_CONSTANTS;
/* Global variables. */
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 6f752ea765c375..8e50aa929f1c06 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -561,9 +561,9 @@ static BOOL is_boot_sector_ntfs(const struct super_block *sb,
default:
goto not_ntfs;
}
- /* Check the cluster size is not above 65536 bytes. */
+ /* Check the cluster size is not above the maximum (64kiB). */
if ((u32)le16_to_cpu(b->bpb.bytes_per_sector) *
- b->bpb.sectors_per_cluster > 0x10000)
+ b->bpb.sectors_per_cluster > NTFS_MAX_CLUSTER_SIZE)
goto not_ntfs;
/* Check reserved/unused fields are really zero. */
if (le16_to_cpu(b->bpb.reserved_sectors) ||
@@ -2585,7 +2585,7 @@ err_out_now:
*/
kmem_cache_t *ntfs_name_cache;
-/* Slab caches for efficient allocation/deallocation of of inodes. */
+/* Slab caches for efficient allocation/deallocation of inodes. */
kmem_cache_t *ntfs_inode_cache;
kmem_cache_t *ntfs_big_inode_cache;