From 924cbd4f42c8284899523903934d5db785919fdc Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sat, 31 Jan 2015 21:27:01 +0100 Subject: IMFS: Simplify ino generation The type of ino_t is unsigned long, so it can store a pointer. Avoid a potential integer overflow. --- cpukit/libfs/src/imfs/imfs.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cpukit/libfs/src/imfs/imfs.h') diff --git a/cpukit/libfs/src/imfs/imfs.h b/cpukit/libfs/src/imfs/imfs.h index c296bffc06..f258ae05a7 100644 --- a/cpukit/libfs/src/imfs/imfs.h +++ b/cpukit/libfs/src/imfs/imfs.h @@ -244,7 +244,6 @@ struct IMFS_jnode_tt { mode_t st_mode; /* File mode */ unsigned short reference_count; nlink_t st_nlink; /* Link count */ - ino_t st_ino; /* inode */ uid_t st_uid; /* User ID of owner */ gid_t st_gid; /* Group ID of owner */ @@ -372,7 +371,6 @@ static inline void IMFS_mtime_ctime_update( IMFS_jnode_t *jnode ) } typedef struct { - ino_t ino_count; const IMFS_node_control *node_controls [IMFS_TYPE_COUNT]; } IMFS_fs_info_t; @@ -960,6 +958,11 @@ static inline bool IMFS_is_hard_link( mode_t mode ) return ( mode & S_IFMT ) == IMFS_STAT_FMT_HARD_LINK; } +static inline ino_t IMFS_node_to_ino( const IMFS_jnode_t *node ) +{ + return (ino_t) node; +} + /** @} */ /** -- cgit v1.2.3