Changes by: yura
Update of /cvs/linux-ntfs/ntfsprogs/include/ntfs
In directory delta357.server4you.de:/tmp/cvs-serv5970/include/ntfs
Modified Files:
rich.h support.h
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: rich.h
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/include/ntfs/rich.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -p -r1.3 -r1.4
--- rich.h 28 Oct 2005 04:32:21 -0000 1.3
+++ rich.h 13 Jul 2006 02:49:07 -0000 1.4
@@ -26,9 +26,7 @@
#include "attrib.h"
#include "bitmap.h"
-#define ROUND_UP(num,bound) (((num)+((bound)-1)) & ~((bound)-1))
-#define ROUND_DOWN(num,bound) ((num) & ~((bound)-1))
-#define ATTR_SIZE(s) ROUND_UP(s,8)
+#define ATTR_SIZE(s) ROUND_UP(s, 3)
ATTR_RECORD * find_attribute(const ATTR_TYPES type, ntfs_attr_search_ctx *ctx);
ATTR_RECORD * find_first_attribute(const ATTR_TYPES type, MFT_RECORD *mft);
Index: support.h
===================================================================
RCS file: /cvs/linux-ntfs/ntfsprogs/include/ntfs/support.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -p -r1.8 -r1.9
--- support.h 18 Dec 2005 16:27:20 -0000 1.8
+++ support.h 13 Jul 2006 02:49:07 -0000 1.9
@@ -61,6 +61,13 @@
#endif
/*
+ * Round up and down @num to 2 in power of @order.
+ */
+#define ROUND_UP(num,order) (((num) + ((1 << order) - 1)) & \
+ ~((1 << order) - 1))
+#define ROUND_DOWN(num,order) ((num) & ~((1 << order) - 1))
+
+/*
* Simple bit operation macros. NOTE: These are NOT atomic.
*/
#define test_bit(bit, var) ((var) & (1 << (bit)))
|