Replacing a page in page_cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

I am trying to replace a page which is already present in page_cache.
Is there any direct way to do so (via some kernel API)?  My experiment
is something like, I have a file opened and read completely in user
space app (just to make sure that all the file is present in page
cache). From kernel, I am allocating a new page, filling some data
into it, and want to store this data by replacing some existing page
from page_cache.

Initially I was thinking of removing a page (at a particular index)
from page_cache and then add my new page at the same index. But by
doing so, that page will be treated as containing invalid data, hence
again the data will be fetched from the disk and it will overwrite
whatever I had initially written into that page. Is there any way I
can add the page into page_cache (by add_to_page_cache_lru) and still
mark it Uptodate (SetPageUptodate or something) without any bad
consequences?

Regards,
Jack

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux