In Linux struct stat contains the major/minor numbers of the underlying device, consequently we put the cdev name into struct stat.
Signed-off-by: Sascha Hauer <[email protected]> --- fs/fs.c | 1 + include/linux/stat.h | 1 + 2 files changed, 2 insertions(+) diff --git a/fs/fs.c b/fs/fs.c index 9e2c95c6352cc63400f997bb8de53af44f4741cf..9022287dff2f4959f64eac76c544634b3978d238 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -1117,6 +1117,7 @@ static void stat_inode(struct inode *inode, struct stat *s) s->st_mode = inode->i_mode; s->st_uid = inode->i_uid; s->st_gid = inode->i_gid; + s->st_cdevname = inode->cdevname; } int fstat(int fd, struct stat *s) diff --git a/include/linux/stat.h b/include/linux/stat.h index 6ee05b52873f47e5d17a4387829187512be29ea8..84b6484a1f2149d1f2d770f0f11bf0ae0ef63744 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h @@ -55,6 +55,7 @@ struct stat { unsigned short st_mode; unsigned short st_uid; unsigned short st_gid; + const char *st_cdevname; /* barebox specific */ loff_t st_size; }; -- 2.47.3
