summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-04-17 14:52:41 +0000
committerMiles Bader <miles@gnu.org>1995-04-17 14:52:41 +0000
commit2c848001b36c5c04cd8b117795e8c6fcb28b89c3 (patch)
treecc7e0d46ab7e20d4fb30cddf7c2bb46d0e08861f
parent830fc6e99b9b0f65bf9ff0c17dea4b08d2a4d532 (diff)
Formerly ext2fs.h.~22~
-rw-r--r--ext2fs/ext2fs.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h
index 3d2c11b1..adddec72 100644
--- a/ext2fs/ext2fs.h
+++ b/ext2fs/ext2fs.h
@@ -177,9 +177,9 @@ unsigned long nextgennumber;
/* Functions for looking inside disk_image */
/* block num --> byte offset on disk */
-#define boffs(block) ((block) * block_size)
+#define boffs(block) ((block) << log2_block_size)
/* byte offset on disk --> block num */
-#define boffs_block(offs) ((block) / block_size)
+#define boffs_block(offs) ((block) >> log2_block_size)
/* byte offset on disk --> pointer to in-memory block */
#define boffs_ptr(offs) (((char *)disk_image) + (offs))
@@ -191,13 +191,14 @@ unsigned long nextgennumber;
/* pointer to in-memory block --> block num */
#define bptr_block(ptr) boffs_block(bptr_offs(ptr))
-/* Get the descriptor for the block group inode INUM is in. */
+/* Get the descriptor for block group NUM. The block group descriptors are
+ stored starting in the block following the super block. */
extern inline struct ext2_group_desc *
-group_desc(unsigned long bg_num)
+group_desc(unsigned long num)
{
int desc_per_block = EXT2_DESC_PER_BLOCK(sblock);
- unsigned long group_desc = bg_num / desc_per_block;
- unsigned long desc = bg_num % desc_per_block;
+ unsigned long group_desc = num / desc_per_block;
+ unsigned long desc = num % desc_per_block;
return ((struct ext2_group_desc *)bptr(1 + group_desc)) + desc;
}
@@ -246,7 +247,6 @@ alloc_sync (struct node *np)
diskfs_node_update (np, 1);
pokel_sync (&np->dn->pokel, 1);
}
- copy_sblock ();
diskfs_set_hypermetadata (1, 0);
pokel_sync (&sblock_pokel, 1);
}