lkml.org 
[lkml]   [2008]   [Mar]   [28]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
/
DateFri, 28 Mar 2008 03:12:46 -0700
FromAndrew Morton <>
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2008-03-28 10:15    [W:0.246 / U:0.100 seconds]
©2003-2008 Jasper Spaans