Re: [PATCH v12 01/12] KVM: guest_memfd: Rename "struct kvm_gmem" to "struct gmem_file"

From: David Hildenbrand
Date: Fri Oct 10 2025 - 11:08:07 EST


- struct file *gmem_file = READ_ONCE(slot->gmem.file);
- struct kvm_gmem *gmem = file->private_data;
+ struct file *slot_file = READ_ONCE(slot->gmem.file);
+ struct gmem_file *f = file->private_data;
^^^
struct folio *folio;
- if (file != gmem_file) {
- WARN_ON_ONCE(gmem_file);
+ if (file != slot_file) {
+ WARN_ON_ONCE(slot_file);
return ERR_PTR(-EFAULT);
}
- gmem = file->private_data;
- if (xa_load(&gmem->bindings, index) != slot) {
- WARN_ON_ONCE(xa_load(&gmem->bindings, index));
+ f = file->private_data;

This redundant initialization can be dropped.

I sent a cleanup patch including this change a few weeks ago:

https://lore.kernel.org/kvm/20250902080307.153171-2-shivankg@xxxxxxx

Yeah, Sean/Oaolo, can you take a look and pick that up as well?

--
Cheers

David / dhildenb