#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)
{
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;
int iam_node_read(struct iam_container *c, iam_ptr_t ptr,
handle_t *h, struct buffer_head **bh);
-/*
- * Container format.
- */
-struct iam_format {
- /*
- * Method called to recognize container format. Should return true iff
- * container @c conforms to this format. This method may do IO to read
- * container pages.
- *
- * If container is recognized, this method sets operation vectors
- * ->id_ops and ->id_leaf_ops in container description (c->ic_descr),
- * and fills other description fields.
- */
- int (*if_guess)(struct iam_container *c);
- /*
- * Linkage into global list of container formats.
- */
- struct list_head if_linkage;
-};
-
-void iam_format_register(struct iam_format *fmt);
int iam_root_limit(int rootgap, int blocksize, int size);
void iam_lfix_format_init(void);
void iam_lvar_format_init(void);
+int iam_lfix_guess(struct iam_container *c);
+int iam_lvar_guess(struct iam_container *c);
void iam_htree_format_init(void);
int iam_lfix_create(struct inode *obj,
.id_name = "lfix"
};
-static int iam_lfix_guess(struct iam_container *c)
+int iam_lfix_guess(struct iam_container *c)
{
int result;
struct buffer_head *bh;
return result;
}
-static struct iam_format iam_lfix_format = {
- .if_guess = iam_lfix_guess
-};
-
-void iam_lfix_format_init(void)
-{
- iam_format_register(&iam_lfix_format);
-}
-
/*
* Debugging aid.
*/
.id_name = "lvar"
};
-static int lvar_guess(struct iam_container *c)
+int iam_lvar_guess(struct iam_container *c)
{
int result;
struct buffer_head *bh;
}
return result;
}
-
-static struct iam_format lvar_format = {
- .if_guess = lvar_guess
-};
-
-void iam_lvar_format_init(void)
-{
- iam_format_register(&lvar_format);
-}
-