Re: [PATCH v5 3/3] drivers/base/node.c: use bin_attribute to break the size limitation of cpumap ABI

From: Andy Shevchenko
Date: Fri Jul 02 2021 - 06:03:49 EST


On Fri, Jul 02, 2021 at 09:25:59PM +1200, Barry Song wrote:
> From: Tian Tao <tiantao6@xxxxxxxxxxxxx>
>
> Reading sys/devices/system/cpu/cpuX/nodeX/ returns cpumap and cpulist.
> However, the size of this file is limited to PAGE_SIZE because of the
> limitation for sysfs attribute.
>
> This patch moves to use bin_attribute to extend the ABI to be more
> than one page so that cpumap bitmask and list won't be potentially
> trimmed.

...

> }
>
> -static DEVICE_ATTR_RO(cpumap);
>
> -static inline ssize_t cpulist_show(struct device *dev,
> - struct device_attribute *attr,
> - char *buf)
> +static BIN_ATTR_RO(cpumap, 0);

It will be extra blank line after this change.

--
With Best Regards,
Andy Shevchenko