On Sun, Apr 19, 2020 at 10:31:26PM +0200, Guoqing Jiang wrote: > On 19.04.20 05:14, Matthew Wilcox wrote: > > On Sun, Apr 19, 2020 at 12:51:18AM +0200, Guoqing Jiang wrote: > > > When reading md code, I find md-bitmap.c copies __clear_page_buffers from > > > buffer.c, and after more search, seems there are some places in fs could > > > use this function directly. So this patchset tries to export the function > > > and use it to cleanup code. > > OK, I see why you did this, but there are a couple of problems with it. > > > > One is just a sequencing problem; between exporting __clear_page_buffers() > > and removing it from the md code, the md code won't build. > > Seems the build option BLK_DEV_MD is depended on BLOCK, and buffer.c > is relied on the same option. > > ifeq ($(CONFIG_BLOCK),y)/x > obj-y += buffer.o block_dev.o direct-io.o mpage.o > else > obj-y += no-block.o > endif > > So I am not sure it is necessary to move the function to include/linux/mm.h > if there is no sequencing problem, thanks for your any further suggestion. The sequencing problem is that there will be _two_ definitions of __clear_page_buffers(). The reason it should go in mm.h is that it's a very simple function and it will be better to inline it than call an external function. The two things are not related to each other.