)]}'
{
  "commit": "52a81824e43a912d72d3985e0cc62643b05a1639",
  "tree": "008de6143ce1aa70c16feba7b1809e19a091d809",
  "parents": [
    "20af3f4ea424c5a29f98666b649c9bacd5629876"
  ],
  "author": {
    "name": "Pratyush Yadav",
    "email": "ptyadav@amazon.de",
    "time": "Mon Dec 09 17:02:26 2024 +0000"
  },
  "committer": {
    "name": "Pratyush Yadav",
    "email": "ptyadav@amazon.de",
    "time": "Mon Dec 09 18:25:54 2024 +0000"
  },
  "message": "Add support for adding data to files\n\nThe KHO inode must be updated with a mapping of which logical \"block\" of\nthe file corresponds to which page. In addition, after kexec the pages\nare inserted into the page cache lazily based on when they are first\nused. This makes the assumption that a page not in page cache does not\nexist false. Update shmem_get_folio_gfp() and\nshmem_alloc_and_add_folio() to do this.\n\nWhen a page is not found in the page cache on a KHO-enabled inode,\nshmem_get_folio_gfp() now still attempts to find the page since a\nreference to the page might exist in the KHO inode\u0027s block list and we\nhaven\u0027t inserted it in the page cache yet. Since a page taken over from\nKHO is similar to a clean page allocated from buddy, this handling is\ndone in shmem_alloc_and_add_folio().\n\nOn a KHO-enabled inode, shmem_alloc_kho_folio() is used to do this. If\nthe page exists on the blocks list, it is returned and\nshmem_alloc_and_add_folio() initialized it and adds it to the page\ncache. Otherwise, for SGP_WRITE, a new page is allocated, added to the\nblock list, and returned to be initialized and added to page cache. For\nSGP_READ or SGP_NOALLOC, -ENOENT is returned to indicate to caller a\npage is not found and it can error or zero on hole. This way, we always\nkeep the blocks list up-to-date on new allocations, and allow for\nrestoring pre-kexec pages.\n\nshmem_get_folio_gfp() is refactored to make this logic easier to\nimplement.\n\nFor truncation, add the invalidate folio callback. This along with\nmapping_set_release_always() on the inode makes sure it gets called on\ntruncate. The callback just removes the mapping of the folio from the\nblocks list, since the caller will take care of actually freeing the\nfolio.\n\nNOTE: As with every patch is this series, the code here is very hacky\nand quickly put together to get a proof-of-concept. So the code is full\nof bugs and problems, and will be significantly improved before the\nfirst round of patches on the list.\n\nSigned-off-by: Pratyush Yadav \u003cptyadav@amazon.de\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "f29567aee4ae82083b4691c35c006f6b0782647f",
      "old_mode": 33188,
      "old_path": "mm/shmem.c",
      "new_id": "2ab443f9eb46ed3015d177c73a6310390945ba20",
      "new_mode": 33188,
      "new_path": "mm/shmem.c"
    }
  ]
}
