[PATCH] fs/ext*,f2fs,jffs2,reiserfs: give comments for acl size and count calculation
Jan Kara
jack at suse.cz
Mon Dec 31 10:45:59 EST 2012
On Fri 28-12-12 12:31:46, Chen Gang wrote:
>
> give comments (by Theodore Ts'o)
>
> ACL_USER_OBJ ACL_USER*[1] ACL_GROUP_OBJ ACL_GROUP*[1] ACL_MASK[2] ACL_OTHER
>
> [1] Where * is the regexp sense of "0 or more times"
> [2] Only if there is at least one ACL_USER or ACL_GROUP tag;
> otherwise skip ACL_MASK.
>
> use macro instead of hard code number (by Chen Gang)
>
> Signed-off-by: Theodore Ts'o <tytso at mit.edu>
> Signed-off-by: Chen Gang <gang.chen at asianux.com>
> ---
...
> diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
> index 7931efe..d75d2f6 100644
> --- a/include/linux/posix_acl.h
> +++ b/include/linux/posix_acl.h
> @@ -26,6 +26,15 @@
> #define ACL_MASK (0x10)
> #define ACL_OTHER (0x20)
>
> +/*
> + * ACL_USER_OBJ ACL_USER*[1] ACL_GROUP_OBJ ACL_GROUP*[1] ACL_MASK[2] ACL_OTHER
> + *
> + * [1] Where * is the regexp sense of "0 or more times"
> + * [2] Only if there is at least one ACL_USER or ACL_GROUP tag;
> + * otherwise skip ACL_MASK.
> + */
> +#define ACL_MAX_SHORT_ENTRY (4)
> +
I agree that defining a constant for this makes sence. Just please be
more verbose with the comment. This is hardly readable for anyone not
knowing what's going on in advance. Also braces around 4 are superfluous.
Add something like the comment below before posix_acl_valid():
/*
* posix_acl_valid() makes sure ACL format is the following:
* ACL_USER_OBJ ACL_USER*[1] ACL_GROUP_OBJ ACL_GROUP*[1] ACL_MASK[2] ACL_OTHER
*
* [1] Where * is the regexp sense of "0 or more times"
* [2] If ACL_USER or ACL_GROUP is present, then ACL_MASK must be present.
*/
Then add comment before definition of ACL_MAX_SHORT_ENTRY:
/*
* posix_acl_valid() makes sure that if there are <= 4 ACL entries, then
* all of them are short. Otherwise exactly 4 entries are short ones and
* other have full length. See comment before that function for exact ACL
* format.
*/
Honza
> /* permissions in the e_perm field */
> #define ACL_READ (0x04)
> #define ACL_WRITE (0x02)
> --
> 1.7.10.4
--
Jan Kara <jack at suse.cz>
SUSE Labs, CR
More information about the linux-mtd
mailing list