[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080328031246.8c7e849b.akpm@linux-foundation.org>
Date: Fri, 28 Mar 2008 03:12:46 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Artem Bityutskiy <Artem.Bityutskiy@...ia.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Adrian Hunter <ext-adrian.hunter@...ia.com>
Subject: Re: [RFC PATCH 05/26] UBIFS: add file-system build
On Thu, 27 Mar 2008 16:55:25 +0200 Artem Bityutskiy <Artem.Bityutskiy@...ia.com> wrote:
> +static int init_constants_late(struct ubifs_info *c)
> +{
> + int tmp, err;
> + long long tmp64;
> +
> + c->main_bytes = c->main_lebs * c->leb_size;
> +
> + c->max_znode_sz = sizeof(struct ubifs_znode) +
> + c->fanout * sizeof(struct ubifs_zbranch);
> +
> + tmp = ubifs_idx_node_sz(c, 1);
> + c->ranges[UBIFS_IDX_NODE].min_len = tmp;
> + c->min_idx_node_sz = ALIGN(tmp, 8);
> +
> + tmp = ubifs_idx_node_sz(c, c->fanout);
> + c->ranges[UBIFS_IDX_NODE].max_len = tmp;
> + c->max_idx_node_sz = ALIGN(tmp, 8);
> +
> + /* Make sure LEB size is large enough to fit full commit */
> + tmp = UBIFS_CS_NODE_SZ + UBIFS_REF_NODE_SZ * c->jhead_cnt;
> + tmp = ALIGN(tmp, c->min_io_size);
> + if (tmp > c->leb_size) {
> + dbg_err("too small LEB size %d, at least %d needed",
> + c->leb_size, tmp);
> + return -EINVAL;
> + }
> +
> + /*
> + * Make sure that the log is large enough to fit reference nodes for
> + * all buds plus one reserved LEB.
> + */
> + tmp64 = c->max_bud_bytes;
> + tmp = do_div(tmp64, c->leb_size);
do_div() operates on u64, not signed long long. This will warn on several
architectures.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists