At 11/02/2016 11:21 PM, David Sterba wrote:
On Wed, Sep 21, 2016 at 11:15:52AM +0800, Qu Wenruo wrote:
From: Lu Fengqi <lufq.f...@cn.fujitsu.com>

Introduce a new function find_dir_item() to find DIR_ITEM for the given
key, and check it with the specified INODE_REF/INODE_EXTREF match.

Signed-off-by: Lu Fengqi <lufq.f...@cn.fujitsu.com>
Signed-off-by: Qu Wenruo <quwen...@cn.fujitsu.com>
---
 cmds-check.c | 140 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 140 insertions(+)

diff --git a/cmds-check.c b/cmds-check.c
index 998ba63..4e25804 100644
--- a/cmds-check.c
+++ b/cmds-check.c
@@ -3848,6 +3848,146 @@ out:
        return err;
 }

+#define ROOT_DIR_ERROR         (1<<1)    /* bad root_dir */
+#define DIR_ITEM_MISSING       (1<<2)    /* DIR_ITEM not found */
+#define DIR_ITEM_MISMATCH      (1<<3)    /* DIR_ITEM found but not match */

What's the reason for another definition of the error codes? They're
mostly copied from te I_ERR_* counterparts. I'd rather have one set of
error codes.

I tried to merge them into a 32bit error bits.

But things turns out that, I_ERR and REF_ERR have already taken 28 bits.
For a int type, we only have extra 4bits.

All fs tree level error code are OK to merge.
But extent tree level errors, including extent ref/backref error bits, and tree block level errors, like bad key type in current content or bad item size, have no corresponding bits.

These bits are already over 4 bits.


Yes, we can expand the error bit to u64, but that will be a huge modification for both the original mode and lowmem mode.


What about letting me separate the lowmem code from cmds-check.c into check/lowmem.c and using the current error when you're going to create check/ directory?

It should be OK to merge all lowmem error bits into one int type, but not possible to do it with original mode error bits without expanding the int type. Since we have different error bit standard, this leads to completely different usage on these bits.
A lot of lowmem bit won't be used by original mode and vice-verse.

Thanks,
Qu


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to