What is the private page?

944 Views Asked by At

In the page struct, there is private field. If I use page_buffers() function, they return that field.

And also there is PrivatePage(). But I dont know what it is.

What is this?

1

There are 1 best solutions below

0
On

See include/linux/page-flags.h:

 * Private page markings that may be used by the filesystem that owns the page
 * for its own purposes.
 * - PG_private and PG_private_2 cause releasepage() and co to be invoked

And also Documentation/filesystems/vfs.txt:

An address_space handler may attach extra information to a page, typically using the 'private' field in the 'struct page'. If such information is attached, the PG_Private flag should be set. This will cause various VM routines to make extra calls into the address_space handler to deal with that data.

page_buffers() is for the specific case where the private field contains a pointer to a struct buffer_head, which is a very common pattern in filesystem drivers.