于 2011年08月05日 06:22, Randy Dunlap 写道:
From: Randy Dunlap<rdunlap@xxxxxxxxxxxx> vmstat_text is only available when PROC_FS or SYSFS is enabled. This causes build errors in drivers/base/node.c when they are both disabled: drivers/built-in.o: In function `node_read_vmstat': node.c:(.text+0x10e28f): undefined reference to `vmstat_text' Rather than litter drivers/base/node.c with #ifdef/#endif around the affected lines of code, add macros for optional sysdev attributes so that those lines of code will be ignored, without using #ifdef/#endif in the .c file(s). I.e., the ifdeffery is done only in a header file with sysdev_create_file_optional() and sysdev_remove_file_optional().
This looks ugly for me, because other sysfs files here are not optional only due to that they don't rely on vmstat_text. I still think my approach to fix this is better, that is, introducing a new Kconfig for drivers/base/node.c which depends on CONFIG_SYSFS. Thanks. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>