KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation
Subsystems (2)
PATCH 1/1 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.
--- virt/kvm/guest_memfd.c | 11 ----------- 1 file changed, 11 deletions(-)
virt/kvm/guest_memfd.c +0 -11
@@ -382,23 +382,12 @@ static const struct address_space_operations kvm_gmem_aops = {#endif }; -static int kvm_gmem_getattr (struct mnt_idmap *idmap,const struct path *path, -struct kstat *stat,u32 request_mask, -unsigned int query_flags) -{ -struct inode *inode = path->dentry->d_inode; - -generic_fillattr (idmap, request_mask, inode, stat); -return 0 ; -} -static int kvm_gmem_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {return -EINVAL ; }static const struct inode_operations kvm_gmem_iops = { - .getattr = kvm_gmem_getattr, .setattr = kvm_gmem_setattr, };
Signature · 1 line
2.34.1
Sean Christopherson
maintainerQuoted 2 lines · Ackerley Tng
Reviewed-by Ackerley Tng <[email protected]>
Ackerley,
FYI, your mail doesn't appear to have made it to the lists, e.g. isn't available on lore. I don't see anything obviously wrong (though that means almost nothing). Hopefully it's just a one-off glitch?
Quoted 9 lines · Sean Christopherson
Quoted 2 lines · Ackerley Tng
Reviewed-by Ackerley Tng <[email protected]>Ackerley,
FYI, your mail doesn't appear to have made it to the lists, e.g. isn't available on lore. I don't see anything obviously wrong (though that means almost nothing). Hopefully it's just a one-off glitch?
Hi Sean,
I can find it on lore:
https://lore.kernel.org/all/[email protected]
Thanks,
Shivank
Quoted 8 lines · Shivank Garg
Remove the redundant
kvm_gmem_getattr()implementation that simply callsgeneric_fillattr()without any special handling. The VFS layer (vfs_getattr_nosec()) will callgeneric_fillattr()by default when no custom getattr operation is provided in theinode_operationsstructure.This is a cleanup with no functional change.
Signed-off-by Shivank Garg <[email protected]>
Quoted 32 lines
--- virt/kvm/guest_memfd.c | 11 ----------- 1 file changed, 11 deletions(-)virt/kvm/guest_memfd.c +0
-11@@ -382,23 +382,12 @@ static const struct address_space_operations kvm_gmem_aops = {#endif }; -static int kvm_gmem_getattr (struct mnt_idmap *idmap,const struct path *path, -struct kstat *stat,u32 request_mask, -unsigned int query_flags) -{ -struct inode *inode = path->dentry->d_inode; - -generic_fillattr (idmap, request_mask, inode, stat); -return 0 ; -} -static int kvm_gmem_setattr (struct mnt_idmap *idmap,struct dentry *dentry,struct iattr *attr) {return -EINVAL ; }static const struct inode_operations kvm_gmem_iops = { - .getattr = kvm_gmem_getattr, .setattr = kvm_gmem_setattr, };
Quoted 8 lines · Shivank Garg
Remove the redundant
kvm_gmem_getattr()implementation that simply callsgeneric_fillattr()without any special handling. The VFS layer (vfs_getattr_nosec()) will callgeneric_fillattr()by default when no custom getattr operation is provided in theinode_operationsstructure.This is a cleanup with no functional change.
[...]
Applied to kvm-x86 generic, thanks!
[1/1] KVM: guest_memfd: Remove redundant kvm_gmem_getattr implementation
https://github.com/kvm-x86/linux/commit/87d4fbf4a387