minor clean up
This commit is contained in:
@@ -122,7 +122,7 @@ int main(int argc, char *argv[]) {
|
|||||||
bitmap_t b;
|
bitmap_t b;
|
||||||
for (i = 0; i < 1024; i++)
|
for (i = 0; i < 1024; i++)
|
||||||
b.bits[i] = 0;
|
b.bits[i] = 0;
|
||||||
b.bits[0] = 0x80000000; // first entry is allocated
|
b.bits[0] = 0x1 << 31; // first entry is allocated
|
||||||
|
|
||||||
rc = pwrite(fd, &b, UFS_BLOCK_SIZE, s.inode_bitmap_addr * UFS_BLOCK_SIZE);
|
rc = pwrite(fd, &b, UFS_BLOCK_SIZE, s.inode_bitmap_addr * UFS_BLOCK_SIZE);
|
||||||
assert(rc == UFS_BLOCK_SIZE);
|
assert(rc == UFS_BLOCK_SIZE);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef __ufs_h__
|
#ifndef __ufs_h__
|
||||||
#define __ufs_h__
|
#define __ufs_h__
|
||||||
|
|
||||||
#define UFS_DIRECTORY (0)
|
#define UFS_DIRECTORY (0)
|
||||||
#define UFS_REGULAR_FILE (1)
|
#define UFS_REGULAR_FILE (1)
|
||||||
|
|
||||||
#define UFS_BLOCK_SIZE (4096)
|
#define UFS_BLOCK_SIZE (4096)
|
||||||
@@ -21,13 +21,13 @@ typedef struct {
|
|||||||
|
|
||||||
// presumed: block 0 is the super block
|
// presumed: block 0 is the super block
|
||||||
typedef struct __super {
|
typedef struct __super {
|
||||||
int inode_bitmap_addr; // block address
|
int inode_bitmap_addr; // block address (in blocks)
|
||||||
int inode_bitmap_len; // in blocks
|
int inode_bitmap_len; // in blocks
|
||||||
int data_bitmap_addr; // block address
|
int data_bitmap_addr; // block address (in blocks)
|
||||||
int data_bitmap_len; // in blocks
|
int data_bitmap_len; // in blocks
|
||||||
int inode_region_addr; // block address
|
int inode_region_addr; // block address (in blocks)
|
||||||
int inode_region_len; // in blocks
|
int inode_region_len; // in blocks
|
||||||
int data_region_addr; // block address
|
int data_region_addr; // block address (in blocks)
|
||||||
int data_region_len; // in blocks
|
int data_region_len; // in blocks
|
||||||
} super_t;
|
} super_t;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user