Re: [PATCH 0/4] cgroups: show correct file mode

From: Paul Menage
Date: Mon Mar 02 2009 - 19:16:13 EST


On Mon, Mar 2, 2009 at 4:09 PM, KAMEZAWA Hiroyuki
<kamezawa.hiroyu@xxxxxxxxxxxxxx> wrote:
>
> int mode;
> if (cft->mode)
> mode = cft->mode;
> else if (cft->write_xxx || .....)
> mode = 0644;
> else
> mode = 0444;

Almost:

int mode;
if (cft->mode) {
mode = cft->mode;
} else {
if (cft->write_xxx || ....)
mode |= 0600;
if (cft->read_xxx || ...)
mode |= 0444;
}

Paul
--
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/