From 211ee30f24c0abf5fcd5df17451b738e32c2c2c5 Mon Sep 17 00:00:00 2001 From: Jeff Bailey Date: Mon, 28 Jul 2003 01:48:26 +0000 Subject: 2003-07-14 Marco Gerards * 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. --- fatfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fatfs/inode.c') diff --git a/fatfs/inode.c b/fatfs/inode.c index 50f8662b..b341f188 100644 --- a/fatfs/inode.c +++ b/fatfs/inode.c @@ -329,8 +329,8 @@ read_node (struct node *np, vm_address_t buf) st->st_mode = S_IFDIR | 0777; /* When we read in the node the first time, diskfs_root_node is zero. */ - if (diskfs_root_node == 0 || - (np == diskfs_root_node && (fat_type == FAT12 || fat_type == FAT16))) + if ((diskfs_root_node == 0 || np == diskfs_root_node) && + (fat_type = FAT12 || fat_type == FAT16)) { st->st_size = read_dword (dr->file_size); np->allocsize = nr_of_root_dir_sectors << log2_bytes_per_sector; -- cgit v1.2.3