Changes by: yura
Update of /cvs/linux-ntfs/ntfsprogs/libntfs
In directory delta357.server4you.de:/tmp/cvs-serv5970/libntfs
Modified Files:
bitmap.c dir.c
Log Message:
move ROUND_{UP,DOWN} to support.h, make second parameter to be order in which
we should power 2 (to prevent incorrect use)
Index: bitmap.c
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/libntfs/bitmap.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -p -r1.22 -r1.23
--- bitmap.c 10 Feb 2006 11:00:47 -0000 1.22
+++ bitmap.c 13 Jul 2006 02:49:07 -0000 1.23
@@ -401,9 +401,9 @@ int ntfs_bmp_add_data(struct ntfs_bmp *b
return -1;
ntfs_log_trace ("\n");
- old = ROUND_UP(bmp->count, 16);
+ old = ROUND_UP(bmp->count, 4);
bmp->count++;
- new = ROUND_UP(bmp->count, 16);
+ new = ROUND_UP(bmp->count, 4);
if (old != new) {
bmp->data = realloc(bmp->data, new * sizeof(*bmp->data));
@@ -513,8 +513,8 @@ int ntfs_bmp_set_range(struct ntfs_bmp *
vcn_finish = vcn + length - 1;
//ntfs_log_debug("vcn_start = %d, vcn_finish = %d\n", vcn_start, vcn_finish);
- a = ROUND_DOWN(vcn_start, csib);
- b = ROUND_DOWN(vcn_finish, csib) + 1;
+ a = ROUND_DOWN(vcn_start, bmp->vol->cluster_size_bits + 3);
+ b = ROUND_DOWN(vcn_finish, bmp->vol->cluster_size_bits + 3) + 1;
//ntfs_log_debug("a = %lld, b = %lld\n", a, b);
@@ -598,7 +598,7 @@ s64 ntfs_bmp_find_last_set(struct ntfs_b
// find cluster size of bmp
byte_count = bmp->attr->data_size;
- clust_count = ROUND_UP(byte_count, bmp->vol->cluster_size) >> bmp->vol->cluster_size_bits;
+ clust_count = ROUND_UP(byte_count, bmp->vol->cluster_size_bits) >> bmp->vol->cluster_size_bits;
//ntfs_log_debug("bitmap = %lld bytes\n", byte_count);
//ntfs_log_debug("bitmap = %lld buffers\n", clust_count);
Index: dir.c
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/libntfs/dir.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -p -r1.58 -r1.59
--- dir.c 3 Jun 2006 22:09:24 -0000 1.58
+++ dir.c 13 Jul 2006 02:49:07 -0000 1.59
@@ -1750,7 +1750,7 @@ int ntfs_dir_truncate(ntfs_volume *vol,
return 0;
#if 0
- buf_count = ROUND_UP(dir->bitmap->attr->allocated_size, vol->cluster_size) >> vol->cluster_size_bits;
+ buf_count = ROUND_UP(dir->bitmap->attr->allocated_size, vol->cluster_size_bits) >> vol->cluster_size_bits;
ntfs_log_debug("alloc = %lld bytes\n", dir->ialloc->allocated_size);
ntfs_log_debug("alloc = %lld clusters\n", dir->ialloc->allocated_size >> vol->cluster_size_bits);
ntfs_log_debug("bitmap bytes 0 to %lld\n", ((dir->ialloc->allocated_size >> vol->cluster_size_bits)-1)>>3);
|