linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/proc: Use inode_get_dev() for device numbers in procmap_query
@ 2025-07-16 14:27 Wei Gao
  2025-07-16 17:06 ` kernel test robot
  2025-07-16 20:39 ` Wei Gao
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Gao @ 2025-07-16 14:27 UTC (permalink / raw)
  To: Andrew Morton, David Hildenbrand
  Cc: Lorenzo Stoakes, Jason A. Donenfeld, Catalin Marinas,
	Penglei Jiang, Mark Brown, Joey Gouly, Brahmajit Das,
	Andrei Vagin, Baolin Wang, Andrii Nakryiko, Ryan Roberts,
	linux-kernel, linux-fsdevel, Wei Gao

This ensures consistency and proper abstraction when accessing device
information associated with an inode.

Signed-off-by: Wei Gao <wegao@suse.com>
---
 fs/proc/task_mmu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 751479eb128f..b113a274f814 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -518,8 +518,8 @@ static int do_procmap_query(struct proc_maps_private *priv, void __user *uarg)
 		const struct inode *inode = file_user_inode(vma->vm_file);
 
 		karg.vma_offset = ((__u64)vma->vm_pgoff) << PAGE_SHIFT;
-		karg.dev_major = MAJOR(inode->i_sb->s_dev);
-		karg.dev_minor = MINOR(inode->i_sb->s_dev);
+		karg.dev_major = MAJOR(inode_get_dev(inode));
+		karg.dev_minor = MINOR(inode_get_dev(inode));
 		karg.inode = inode->i_ino;
 	} else {
 		karg.vma_offset = 0;
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-07-16 17:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16 14:27 [PATCH] fs/proc: Use inode_get_dev() for device numbers in procmap_query Wei Gao
2025-07-16 17:06 ` kernel test robot
2025-07-16 20:39 ` Wei Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).