|
|
a5bd9f6 |
From 3ba196532002293027a6a3e96f8eb1960c70e00c Mon Sep 17 00:00:00 2001
|
|
|
a5bd9f6 |
From: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
|
|
|
a5bd9f6 |
Date: Sat, 5 Jan 2013 16:53:04 +0100
|
|
|
a5bd9f6 |
Subject: [PATCH 085/364] * grub-core/fs/nilfs2.c
|
|
|
a5bd9f6 |
(-grub_nilfs2_palloc_groups_per_desc_block): Rename to ...
|
|
|
a5bd9f6 |
(grub_nilfs2_palloc_log_groups_per_desc_block): ... this. Return log of
|
|
|
a5bd9f6 |
groups_per_block. All users updated.
|
|
|
a5bd9f6 |
|
|
|
a5bd9f6 |
---
|
|
|
a5bd9f6 |
ChangeLog | 7 +++++++
|
|
|
a5bd9f6 |
grub-core/fs/nilfs2.c | 20 ++++++++++++--------
|
|
|
a5bd9f6 |
2 files changed, 19 insertions(+), 8 deletions(-)
|
|
|
a5bd9f6 |
|
|
|
a5bd9f6 |
diff --git a/ChangeLog b/ChangeLog
|
|
|
a5bd9f6 |
index f15e098..ea191b3 100644
|
|
|
a5bd9f6 |
--- a/ChangeLog
|
|
|
a5bd9f6 |
+++ b/ChangeLog
|
|
|
a5bd9f6 |
@@ -1,5 +1,12 @@
|
|
|
a5bd9f6 |
2013-01-05 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
a5bd9f6 |
|
|
|
a5bd9f6 |
+ * grub-core/fs/nilfs2.c (-grub_nilfs2_palloc_groups_per_desc_block):
|
|
|
a5bd9f6 |
+ Rename to ...
|
|
|
a5bd9f6 |
+ (grub_nilfs2_palloc_log_groups_per_desc_block): ... this. Return log
|
|
|
a5bd9f6 |
+ of groups_per_block. All users updated.
|
|
|
a5bd9f6 |
+
|
|
|
a5bd9f6 |
+2013-01-05 Vladimir Serbinenko <phcoder@gmail.com>
|
|
|
a5bd9f6 |
+
|
|
|
a5bd9f6 |
* grub-core/disk/diskfilter.c (grub_diskfilter_write): Call
|
|
|
a5bd9f6 |
grub_error properly.
|
|
|
a5bd9f6 |
* grub-core/disk/ieee1275/nand.c (grub_nand_write): Likewise.
|
|
|
a5bd9f6 |
diff --git a/grub-core/fs/nilfs2.c b/grub-core/fs/nilfs2.c
|
|
|
a5bd9f6 |
index f36c513..5b34486 100644
|
|
|
a5bd9f6 |
--- a/grub-core/fs/nilfs2.c
|
|
|
a5bd9f6 |
+++ b/grub-core/fs/nilfs2.c
|
|
|
a5bd9f6 |
@@ -214,6 +214,8 @@ struct grub_nilfs2_palloc_group_desc
|
|
|
a5bd9f6 |
grub_uint32_t pg_nfrees;
|
|
|
a5bd9f6 |
};
|
|
|
a5bd9f6 |
|
|
|
a5bd9f6 |
+#define LOG_SIZE_GROUP_DESC 2
|
|
|
a5bd9f6 |
+
|
|
|
a5bd9f6 |
#define LOG_NILFS_DAT_ENTRY_SIZE 5
|
|
|
a5bd9f6 |
struct grub_nilfs2_dat_entry
|
|
|
a5bd9f6 |
{
|
|
|
a5bd9f6 |
@@ -311,10 +313,12 @@ grub_nilfs2_palloc_group (struct grub_nilfs2_data *data,
|
|
|
a5bd9f6 |
}
|
|
|
a5bd9f6 |
|
|
|
a5bd9f6 |
static inline grub_uint32_t
|
|
|
a5bd9f6 |
-grub_nilfs2_palloc_groups_per_desc_block (struct grub_nilfs2_data *data)
|
|
|
a5bd9f6 |
+grub_nilfs2_palloc_log_groups_per_desc_block (struct grub_nilfs2_data *data)
|
|
|
a5bd9f6 |
{
|
|
|
a5bd9f6 |
- return NILFS2_BLOCK_SIZE (data) /
|
|
|
a5bd9f6 |
- sizeof (struct grub_nilfs2_palloc_group_desc);
|
|
|
a5bd9f6 |
+ return LOG2_BLOCK_SIZE (data) - LOG_SIZE_GROUP_DESC;
|
|
|
a5bd9f6 |
+
|
|
|
a5bd9f6 |
+ COMPILE_TIME_ASSERT (sizeof (struct grub_nilfs2_palloc_group_desc)
|
|
|
a5bd9f6 |
+ == (1 << LOG_SIZE_GROUP_DESC));
|
|
|
a5bd9f6 |
}
|
|
|
a5bd9f6 |
|
|
|
a5bd9f6 |
static inline grub_uint32_t
|
|
|
a5bd9f6 |
@@ -338,8 +342,8 @@ static inline grub_uint32_t
|
|
|
a5bd9f6 |
grub_nilfs2_blocks_per_desc_block_log (struct grub_nilfs2_data *data,
|
|
|
a5bd9f6 |
unsigned long log_entry_size)
|
|
|
a5bd9f6 |
{
|
|
|
a5bd9f6 |
- return grub_nilfs2_palloc_groups_per_desc_block (data) *
|
|
|
a5bd9f6 |
- grub_nilfs2_blocks_per_group_log (data, log_entry_size) + 1;
|
|
|
a5bd9f6 |
+ return(grub_nilfs2_blocks_per_group_log (data, log_entry_size)
|
|
|
a5bd9f6 |
+ << grub_nilfs2_palloc_log_groups_per_desc_block (data)) + 1;
|
|
|
a5bd9f6 |
}
|
|
|
a5bd9f6 |
|
|
|
a5bd9f6 |
static inline grub_uint32_t
|
|
|
a5bd9f6 |
@@ -348,7 +352,7 @@ grub_nilfs2_palloc_desc_block_offset_log (struct grub_nilfs2_data *data,
|
|
|
a5bd9f6 |
unsigned long log_entry_size)
|
|
|
a5bd9f6 |
{
|
|
|
a5bd9f6 |
grub_uint32_t desc_block =
|
|
|
a5bd9f6 |
- group / grub_nilfs2_palloc_groups_per_desc_block (data);
|
|
|
a5bd9f6 |
+ group >> grub_nilfs2_palloc_log_groups_per_desc_block (data);
|
|
|
a5bd9f6 |
return desc_block * grub_nilfs2_blocks_per_desc_block_log (data,
|
|
|
a5bd9f6 |
log_entry_size);
|
|
|
a5bd9f6 |
}
|
|
|
a5bd9f6 |
@@ -358,8 +362,8 @@ grub_nilfs2_palloc_bitmap_block_offset (struct grub_nilfs2_data *data,
|
|
|
a5bd9f6 |
unsigned long group,
|
|
|
a5bd9f6 |
unsigned long log_entry_size)
|
|
|
a5bd9f6 |
{
|
|
|
a5bd9f6 |
- unsigned long desc_offset = group %
|
|
|
a5bd9f6 |
- grub_nilfs2_palloc_groups_per_desc_block (data);
|
|
|
a5bd9f6 |
+ unsigned long desc_offset = group
|
|
|
a5bd9f6 |
+ & ((1 << grub_nilfs2_palloc_log_groups_per_desc_block (data)) - 1);
|
|
|
a5bd9f6 |
|
|
|
a5bd9f6 |
return grub_nilfs2_palloc_desc_block_offset_log (data, group, log_entry_size)
|
|
|
a5bd9f6 |
+ 1
|
|
|
a5bd9f6 |
--
|
|
|
a5bd9f6 |
1.8.1.4
|
|
|
a5bd9f6 |
|