On Tue, Sep 25, 2018 at 08:06:25AM +0800, Qu Wenruo wrote:
> Since we're following the name size limit of linux, just use NAME_MAX.
> 
> Signed-off-by: Qu Wenruo <w...@suse.com>
> ---
>  fs/btrfs/ctree.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 53af9f5253f4..5ab6d1f6e055 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -65,7 +65,7 @@ struct btrfs_ordered_sum;
>   * we can actually store much bigger names, but lets not confuse the rest
>   * of linux
>   */
> -#define BTRFS_NAME_LEN 255
> +#define BTRFS_NAME_LEN NAME_MAX

While the values are the same, the symbolic names have a slightly
different meaning. NAME_MAX is from the public API, BTRFS_NAME_LEN is
defined as btrfs limit, and de facto part of the on-disk format. These
are independent, although compatible for all practical purposes. I would
not conflate the two in the define, the comment could be updated to
document that better though.

Reply via email to