Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

memfd: implement get_id for memfd_luo

Memfds are identified by their underlying inode. Implement get_id for
memfd_luo to return the inode pointer. This prevents the same memfd from
being managed twice by LUO if the same inode is pointed by multiple file
objects.

Link: https://lore.kernel.org/20260326163943.574070-3-pasha.tatashin@soleen.com
Signed-off-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Reviewed-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Cc: David Matlack <dmatlack@google.com>
Cc: Mike Rapoport (Microsoft) <rppt@kernel.org>
Cc: Samiullah Khawaja <skhawaja@google.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Pasha Tatashin and committed by
Andrew Morton
bc3a5763 00d0b372

+6
+6
mm/memfd_luo.c
··· 560 560 return shmem_file(file) && !inode->i_nlink; 561 561 } 562 562 563 + static unsigned long memfd_luo_get_id(struct file *file) 564 + { 565 + return (unsigned long)file_inode(file); 566 + } 567 + 563 568 static const struct liveupdate_file_ops memfd_luo_file_ops = { 564 569 .freeze = memfd_luo_freeze, 565 570 .finish = memfd_luo_finish, ··· 572 567 .preserve = memfd_luo_preserve, 573 568 .unpreserve = memfd_luo_unpreserve, 574 569 .can_preserve = memfd_luo_can_preserve, 570 + .get_id = memfd_luo_get_id, 575 571 .owner = THIS_MODULE, 576 572 }; 577 573