From mboxrd@z Thu Jan 1 00:00:00 1970 From: greg@kroah.com (Greg KH) Date: Sun, 10 Dec 2017 22:31:22 +0100 Subject: Header organization/separation rule in kernel In-Reply-To: References: Message-ID: <20171210213122.GA19494@kroah.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Sun, Dec 10, 2017 at 11:21:46PM +0800, Shiyao MA wrote: > Hi, > > I wonder the header separation rule in kernel. > To make this question concrete, for example, let's targeting genetlink.h > > It can be found in: > > http://elixir.free-electrons.com/linux/latest/source/include/net/genetlink.h > http://elixir.free-electrons.com/linux/latest/source/include/linux/genetlink.h > http://elixir.free-electrons.com/linux/latest/source/include/uapi/linux/genetlink.h > > > so basically three parts, in uapi, linux/genetlink.h, and net/genetlink.h. > > I understand the necessity of uapi, but why divide the genetlink.h in > linux and the net folder? > What's the benefit of such separation? Some things are only for the networking subsystem, and some things are for any other part of the kernel. Hope this helps, greg k-h