Skip to content

Commit 87d4fbf

Browse files
shivankgarg98sean-jc
authored andcommitted
KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation
Remove the redundant kvm_gmem_getattr() implementation that simply calls generic_fillattr() without any special handling. The VFS layer (vfs_getattr_nosec()) will call generic_fillattr() by default when no custom getattr operation is provided in the inode_operations structure. This is a cleanup with no functional change. Signed-off-by: Shivank Garg <shivankg@amd.com> Reviewed-By: Ackerley Tng <ackerleytng@google.com> Reviewed-by: Pankaj Gupta <pankaj.gupta@amd.com> Link: https://lore.kernel.org/r/20250602172317.10601-1-shivankg@amd.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent aa006b2 commit 87d4fbf

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

virt/kvm/guest_memfd.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -382,23 +382,12 @@ static const struct address_space_operations kvm_gmem_aops = {
382382
#endif
383383
};
384384

385-
static int kvm_gmem_getattr(struct mnt_idmap *idmap, const struct path *path,
386-
struct kstat *stat, u32 request_mask,
387-
unsigned int query_flags)
388-
{
389-
struct inode *inode = path->dentry->d_inode;
390-
391-
generic_fillattr(idmap, request_mask, inode, stat);
392-
return 0;
393-
}
394-
395385
static int kvm_gmem_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
396386
struct iattr *attr)
397387
{
398388
return -EINVAL;
399389
}
400390
static const struct inode_operations kvm_gmem_iops = {
401-
.getattr = kvm_gmem_getattr,
402391
.setattr = kvm_gmem_setattr,
403392
};
404393

0 commit comments

Comments
 (0)