patch-2.3.32 linux/fs/ntfs/super.c
Next file: linux/fs/ntfs/super.h
Previous file: linux/fs/ntfs/fs.c
Back to the patch index
Back to the overall index
- Lines: 44
- Date:
Thu Dec 9 13:14:30 1999
- Orig file:
v2.3.31/linux/fs/ntfs/super.c
- Orig date:
Tue Dec 7 09:32:48 1999
diff -u --recursive --new-file v2.3.31/linux/fs/ntfs/super.c linux/fs/ntfs/super.c
@@ -91,13 +91,12 @@
if(vol->mft_clusters_per_record<0 && vol->mft_clusters_per_record!=-10)
ntfs_error("Unexpected data #4 in boot block\n");
- vol->clustersize = vol->blocksize * vol->clusterfactor;
- if (vol->mft_clusters_per_record > 0)
- vol->mft_recordbits = vol->clustersize * vol->mft_clusters_per_record;
+ vol->clustersize=vol->blocksize*vol->clusterfactor;
+ if(vol->mft_clusters_per_record>0)
+ vol->mft_recordsize=
+ vol->clustersize*vol->mft_clusters_per_record;
else
- vol->mft_recordbits = -vol->mft_clusters_per_record;
-
- vol->mft_recordsize = 1 << vol->mft_recordbits;
+ vol->mft_recordsize=1<<(-vol->mft_clusters_per_record);
vol->index_recordsize=vol->clustersize*vol->index_clusters_per_record;
/* FIXME: long long value */
vol->mft_cluster=NTFS_GETU64(boot+0x30);
@@ -254,10 +253,9 @@
* Writes the volume size into vol_size. Returns 0 if successful
* or error.
*/
-int ntfs_get_volumesize(ntfs_volume *vol, long *vol_size )
+int ntfs_get_volumesize(ntfs_volume *vol, ntfs_u64 *vol_size )
{
ntfs_io io;
- ntfs_u64 size;
char *cluster0;
if( !vol_size )
@@ -273,11 +271,8 @@
io.do_read=1;
io.size=vol->clustersize;
ntfs_getput_clusters(vol,0,0,&io);
- size=NTFS_GETU64(cluster0+0x28);
+ *vol_size = NTFS_GETU64(cluster0+0x28);
ntfs_free(cluster0);
- /* FIXME: more than 2**32 cluster */
- /* FIXME: gcc will emit udivdi3 if we don't truncate it */
- *vol_size = ((unsigned long)size)/vol->clusterfactor;
return 0;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)