Re: [PATCH, RESEND] tmpfs: fix mounts when size is less than thepage size

From: Hugh Dickins
Date: Sun Nov 04 2007 - 13:31:17 EST


On Sun, 4 Nov 2007, Michael Marineau wrote:
> On 11/4/07, Hugh Dickins <hugh@xxxxxxxxxxx> wrote:
> > Fair enough, that does match the documentation of "size=0" better.
> > Though either way, someone who typos is going to get one kind of surprise
> > or another. Do you mind if we do it slightly differently, achieving the
> > same effect without a special case, by rounding up instead of down?
>
> Sounds reasonable to me. I didn't know about DIV_ROUND_UP :-)

I'm not familiar with it either (had to look it up to check it's
the right thing) - in mm/ we're accustomed to writing things like
"(size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT"; but that took
the line over 80 columns, and I dreaded someone somewhere mailing
in to ask "Why didn't you use DIV_ROUND_UP?" ;-)

Hugh
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/