Changeset a54af66 in mainline for uspace/lib/ext2/libext2_inode.c
- Timestamp:
- 2011-02-23T18:21:55Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ad34feb
- Parents:
- f483a15
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext2/libext2_inode.c
rf483a15 ra54af66 54 54 55 55 /** 56 * Check whether inode is of given type 57 * 58 * @param sb pointer to superblock structure 59 * @param inode pointer to inode 60 * @param type EXT2_INODE_MODE_TYPE_* constant to check 61 */ 62 inline bool ext2_inode_is_type(ext2_superblock_t *sb, ext2_inode_t *inode, uint32_t type) 63 { 64 uint32_t mode = ext2_inode_get_mode(sb, inode); 65 return (mode & EXT2_INODE_MODE_TYPE_MASK) == type; 66 } 67 68 /** 56 69 * Get uid this inode is belonging to 57 70 * … … 79 92 { 80 93 uint32_t major_rev = ext2_superblock_get_rev_major(sb); 81 uint32_t mode = ext2_inode_get_mode(sb, inode);82 94 83 if (major_rev > 0 && mode & EXT2_INODE_MODE_FILE) {95 if (major_rev > 0 && ext2_inode_is_type(sb, inode, EXT2_INODE_MODE_FILE)) { 84 96 return ((uint64_t)uint32_t_le2host(inode->size_high)) << 32 | 85 97 ((uint64_t)uint32_t_le2host(inode->size));
Note:
See TracChangeset
for help on using the changeset viewer.