summaryrefslogtreecommitdiff
path: root/fatfs/fatfs.h
diff options
context:
space:
mode:
authorJeff Bailey <jbailey@gnu.org>2003-07-28 01:48:26 +0000
committerJeff Bailey <jbailey@gnu.org>2003-07-28 01:48:26 +0000
commit211ee30f24c0abf5fcd5df17451b738e32c2c2c5 (patch)
treee2281b39ab091d290441f038de849494e99a76ea /fatfs/fatfs.h
parent3099f96171c69d65a1b7add77e9a7356b073d92b (diff)
2003-07-14 Marco Gerards <metgerards@student.han.nl>
* fat.c (fat_read_sblock): Don't test if the root dir size is a multiple of sectors_per_cluster. Reported by Barry deFreese (bddebian@cox.net). * fatfs.h (LOG2_BLOCKS_PER_CLUSTER): New macro. (FAT_FIRST_CLUSTER_BLOCK): Likewise. (fat_first_cluster_byte): Macro removed. * inode.c (read_node): Correctly setup diskfs_root_node for FAT32 filesystems. * pager.c (fat_getcluster): Check for reading beyond allocsize correctly for file systems with a clustersize > vm_page_size. (file_pager_read_small_page): Don't use byte offsets when calculating the block. (file_pager_read_huge_page): Likewise. (pending_clusters_write): Likewise. (file_pager_write_small_page): Likewise. (STAT_INC): Cast to void to suppress warning.
Diffstat (limited to 'fatfs/fatfs.h')
-rw-r--r--fatfs/fatfs.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/fatfs/fatfs.h b/fatfs/fatfs.h
index f46695ba..a741d875 100644
--- a/fatfs/fatfs.h
+++ b/fatfs/fatfs.h
@@ -1,5 +1,5 @@
/* fatfs.h - Interface for fatfs.
- Copyright (C) 1997, 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999, 2002, 2003 Free Software Foundation, Inc.
Written by Thomas Bushnell, n/BSG and Marcus Brinkmann.
This file is part of the GNU Hurd.
@@ -95,12 +95,16 @@ extern vm_address_t zerocluster;
extern struct dirrect dr_root_node;
+#define LOG2_BLOCKS_PER_CLUSTER
+ (log2_bytes_per_cluster - store->logs2_block_size)
+
#define round_cluster(offs) \
((((offs) + bytes_per_cluster - 1) \
>> log2_bytes_per_cluster) << log2_bytes_per_cluster)
-#define fat_first_cluster_byte(cluster) \
- (first_data_byte + ((cluster - 2) << log2_bytes_per_cluster))
+#define FAT_FIRST_CLUSTER_BLOCK(cluster) \
+ (((cluster - 2) << LOG2_BLOCKS_PER_CLUSTER) +
+ (first_data_byte >> store->log2_block_size))
void drop_pager_softrefs (struct node *);
void allow_pager_softrefs (struct node *);