#include <ldiskfs/acl.h>
-/*
- * List of all registered formats.
- *
- * No locking. Callers synchronize.
- */
-static LIST_HEAD(iam_formats);
-
-void iam_format_register(struct iam_format *fmt)
-{
- list_add(&fmt->if_linkage, &iam_formats);
-}
-
static struct buffer_head *
iam_load_idle_blocks(struct iam_container *c, iam_ptr_t blk)
{
bh = __ldiskfs_bread(NULL, inode, blk, 0);
if (IS_ERR_OR_NULL(bh)) {
- CERROR("%s: cannot load idle blocks, blk = %u, err = %ld\n",
+ CERROR("%s: cannot load idle blocks, blk = %u: rc = %ld\n",
osd_ino2name(inode), blk, bh ? PTR_ERR(bh) : -EIO);
c->ic_idle_failed = 1;
if (bh == NULL)
head = (struct iam_idle_head *)(bh->b_data);
if (le16_to_cpu(head->iih_magic) != IAM_IDLE_HEADER_MAGIC) {
- CERROR("%s: invalid idle block head, blk = %u, magic = %d\n",
- osd_ino2name(inode), blk, le16_to_cpu(head->iih_magic));
+ int rc = -EBADF;
+
+ CERROR("%s: invalid idle block head, blk = %u, magic = %x: rc = %d\n",
+ osd_ino2name(inode), blk, le16_to_cpu(head->iih_magic),
+ rc);
brelse(bh);
c->ic_idle_failed = 1;
- return ERR_PTR(-EBADF);
+ return ERR_PTR(rc);
}
return bh;
static int iam_format_guess(struct iam_container *c)
{
int result;
- struct iam_format *fmt;
-
- /*
- * XXX temporary initialization hook.
- */
- {
- static int initialized = 0;
- if (!initialized) {
- iam_lvar_format_init();
- iam_lfix_format_init();
- initialized = 1;
- }
- }
-
- result = -ENOENT;
- list_for_each_entry(fmt, &iam_formats, if_linkage) {
- result = fmt->if_guess(c);
- if (result == 0)
- break;
- }
+ result = iam_lvar_guess(c);
+ if (result)
+ result = iam_lfix_guess(c);
if (result == 0) {
struct buffer_head *bh;
}
#if LDISKFS_INVARIANT_ON
-extern int dx_node_check(struct iam_path *p, struct iam_frame *f);
-
static int iam_path_check(struct iam_path *p)
{
int i;