]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man3/readdir.3, man/man3type/stat.3type: Improve documentation about .d_ino and... ino
authorAlejandro Colomar <alx@kernel.org>
Wed, 28 May 2025 18:59:11 +0000 (20:59 +0200)
committerAlejandro Colomar <alx@kernel.org>
Fri, 31 Oct 2025 10:34:24 +0000 (11:34 +0100)
Suggested-by: Pali Rohár <pali@kernel.org>
Co-authored-by: Pali Rohár <pali@kernel.org>
Co-authored-by: Jan Kara <jack@suse.cz>
Cc: "G. Branden Robinson" <branden@debian.org>
Cc: <linux-fsdevel@vger.kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man3/readdir.3
man/man3type/stat.3type

index e1c7d2a6a6b56c919789e3b538b2fbcdbd58065a..220643795a30acd7fb1f98c2a249590227d481ac 100644 (file)
@@ -58,7 +58,24 @@ The fields of the
 structure are as follows:
 .TP
 .I .d_ino
-This is the inode number of the file.
+This is the inode number of the file
+in the filesystem containing
+the directory on which
+.BR readdir ()
+was called.
+If the directory entry is the mount point,
+then
+.I .d_ino
+differs from
+.I .st_ino
+returned by
+.BR stat (2)
+on this file:
+.I .d_ino
+is the inode number of the mount point,
+while
+.I .st_ino
+is the inode number of the root directory of the mounted filesystem.
 .TP
 .I .d_off
 The value returned in
index 76ee3765db224d5c85543e87a725ffd07233d450..ea9acc5ec025407eb789f2c736052b7ec7aadea1 100644 (file)
@@ -66,7 +66,25 @@ and
 macros may be useful to decompose the device ID in this field.)
 .TP
 .I .st_ino
-This field contains the file's inode number.
+This field contains the file's inode number
+in the filesystem on
+.IR .st_dev .
+If
+.BR stat (2)
+was called on the mount point,
+then
+.I .st_ino
+differs from
+.I .d_ino
+returned by
+.BR readdir (3)
+for the corresponding directory entry in the parent directory.
+In this case,
+.I .st_ino
+is the inode number of the root directory of the mounted filesystem,
+while
+.I .d_ino
+is the inode number of the mount point in the parent filesystem.
 .TP
 .I .st_mode
 This field contains the file type and mode.