projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yaffs Adding more tests to direct/timothy_tests/quick_tests
[yaffs2.git]
/
yaffs_bitmap.c
diff --git
a/yaffs_bitmap.c
b/yaffs_bitmap.c
index 1769e9b47e15e6725151abf71dbca2d414be912f..5d1cfb2965197ba853011551571e2301ec5e9a6d 100644
(file)
--- a/
yaffs_bitmap.c
+++ b/
yaffs_bitmap.c
@@
-17,89
+17,88
@@
* Chunk bitmap manipulations
*/
* Chunk bitmap manipulations
*/
-static Y_INLINE
__u8 *yaffs_BlockBits(yaffs_dev_t
*dev, int blk)
+static Y_INLINE
u8 *yaffs_block_bits(struct yaffs_dev
*dev, int blk)
{
if (blk < dev->internal_start_block || blk > dev->internal_end_block) {
T(YAFFS_TRACE_ERROR,
{
if (blk < dev->internal_start_block || blk > dev->internal_end_block) {
T(YAFFS_TRACE_ERROR,
-
(TSTR("**>> yaffs: BlockBits block %d is not valid" TENDSTR),
-
blk));
+ (TSTR("**>> yaffs: BlockBits block %d is not valid" TENDSTR),
+ blk));
YBUG();
}
return dev->chunk_bits +
YBUG();
}
return dev->chunk_bits +
-
(dev->chunk_bit_stride * (blk - dev->internal_start_block));
+ (dev->chunk_bit_stride * (blk - dev->internal_start_block));
}
}
-void yaffs_verify_chunk_bit_id(
yaffs_dev_t
*dev, int blk, int chunk)
+void yaffs_verify_chunk_bit_id(
struct yaffs_dev
*dev, int blk, int chunk)
{
if (blk < dev->internal_start_block || blk > dev->internal_end_block ||
{
if (blk < dev->internal_start_block || blk > dev->internal_end_block ||
-
chunk < 0 || chunk >= dev->param.chunks_per_block) {
+ chunk < 0 || chunk >= dev->param.chunks_per_block) {
T(YAFFS_TRACE_ERROR,
T(YAFFS_TRACE_ERROR,
-
(TSTR("**>> yaffs: Chunk Id (%d:%d) invalid"
TENDSTR),
-
blk, chunk));
+
(TSTR("**>> yaffs: Chunk Id (%d:%d) invalid"
TENDSTR),
+ blk, chunk));
YBUG();
}
}
YBUG();
}
}
-void yaffs_clear_chunk_bits(
yaffs_dev_t
*dev, int blk)
+void yaffs_clear_chunk_bits(
struct yaffs_dev
*dev, int blk)
{
{
-
__u8 *blkBits = yaffs_BlockB
its(dev, blk);
+
u8 *blk_bits = yaffs_block_b
its(dev, blk);
- memset(blk
B
its, 0, dev->chunk_bit_stride);
+ memset(blk
_b
its, 0, dev->chunk_bit_stride);
}
}
-void yaffs_clear_chunk_bit(
yaffs_dev_t
*dev, int blk, int chunk)
+void yaffs_clear_chunk_bit(
struct yaffs_dev
*dev, int blk, int chunk)
{
{
-
__u8 *blkBits = yaffs_BlockB
its(dev, blk);
+
u8 *blk_bits = yaffs_block_b
its(dev, blk);
yaffs_verify_chunk_bit_id(dev, blk, chunk);
yaffs_verify_chunk_bit_id(dev, blk, chunk);
- blk
B
its[chunk / 8] &= ~(1 << (chunk & 7));
+ blk
_b
its[chunk / 8] &= ~(1 << (chunk & 7));
}
}
-void yaffs_set_chunk_bit(
yaffs_dev_t
*dev, int blk, int chunk)
+void yaffs_set_chunk_bit(
struct yaffs_dev
*dev, int blk, int chunk)
{
{
-
__u8 *blkBits = yaffs_BlockB
its(dev, blk);
+
u8 *blk_bits = yaffs_block_b
its(dev, blk);
yaffs_verify_chunk_bit_id(dev, blk, chunk);
yaffs_verify_chunk_bit_id(dev, blk, chunk);
- blk
B
its[chunk / 8] |= (1 << (chunk & 7));
+ blk
_b
its[chunk / 8] |= (1 << (chunk & 7));
}
}
-int yaffs_check_chunk_bit(
yaffs_dev_t
*dev, int blk, int chunk)
+int yaffs_check_chunk_bit(
struct yaffs_dev
*dev, int blk, int chunk)
{
{
-
__u8 *blkBits = yaffs_BlockB
its(dev, blk);
+
u8 *blk_bits = yaffs_block_b
its(dev, blk);
yaffs_verify_chunk_bit_id(dev, blk, chunk);
yaffs_verify_chunk_bit_id(dev, blk, chunk);
- return (blk
B
its[chunk / 8] & (1 << (chunk & 7))) ? 1 : 0;
+ return (blk
_b
its[chunk / 8] & (1 << (chunk & 7))) ? 1 : 0;
}
}
-int yaffs_still_some_chunks(
yaffs_dev_t
*dev, int blk)
+int yaffs_still_some_chunks(
struct yaffs_dev
*dev, int blk)
{
{
-
__u8 *blkBits = yaffs_BlockB
its(dev, blk);
+
u8 *blk_bits = yaffs_block_b
its(dev, blk);
int i;
for (i = 0; i < dev->chunk_bit_stride; i++) {
int i;
for (i = 0; i < dev->chunk_bit_stride; i++) {
- if (*blk
B
its)
+ if (*blk
_b
its)
return 1;
return 1;
- blk
B
its++;
+ blk
_b
its++;
}
return 0;
}
}
return 0;
}
-int yaffs_count_chunk_bits(
yaffs_dev_t
*dev, int blk)
+int yaffs_count_chunk_bits(
struct yaffs_dev
*dev, int blk)
{
{
-
__u8 *blkBits = yaffs_BlockB
its(dev, blk);
+
u8 *blk_bits = yaffs_block_b
its(dev, blk);
int i;
int n = 0;
for (i = 0; i < dev->chunk_bit_stride; i++) {
int i;
int n = 0;
for (i = 0; i < dev->chunk_bit_stride; i++) {
-
__u8 x = *blkB
its;
+
u8 x = *blk_b
its;
while (x) {
if (x & 1)
n++;
x >>= 1;
}
while (x) {
if (x & 1)
n++;
x >>= 1;
}
- blk
B
its++;
+ blk
_b
its++;
}
return n;
}
}
return n;
}
-