lkml.org 
[lkml]   [2008]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 05/26] UBIFS: add file-system build
On Thu, 27 Mar 2008 16:55:25 +0200 Artem Bityutskiy <Artem.Bityutskiy@nokia.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.


\
 
 \ /
  Last update: 2008-03-28 11:15    [W:0.258 / U:1.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site