Changeset 7b9381b in mainline
- Timestamp:
- 2011-10-10T12:09:03Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 829d238
- Parents:
- 2ea6392
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ext4/libext4_inode.c
r2ea6392 r7b9381b 84 84 /* 85 85 extern uint64_t ext4_inode_get_blocks_count(ext4_inode_t *); 86 extern uint32_t ext4_inode_get_flags(ext4_inode_t *);87 86 */ 87 88 uint32_t ext4_inode_get_flags(ext4_inode_t *inode) { 89 return uint32_t_le2host(inode->flags); 90 } 88 91 89 92 uint32_t ext4_inode_get_direct_block(ext4_inode_t *inode, uint8_t idx) … … 99 102 } 100 103 104 105 // Flags checker 106 bool ext4_inode_has_flag(ext4_inode_t *inode, uint32_t flag) { 107 if (ext4_inode_get_flags(inode) & flag) { 108 return true; 109 } 110 return false; 111 } 112 101 113 /** 102 114 * @} -
uspace/lib/ext4/libext4_inode.h
r2ea6392 r7b9381b 108 108 #define EXT4_INODE_MODE_TYPE_MASK 0xF000 109 109 110 /* 111 * Inode flags 112 */ 113 #define EXT4_INODE_FLAG_SECRM 0x00000001 // Secure deletion 114 #define EXT4_INODE_FLAG_UNRM 0x00000002 // Undelete 115 #define EXT4_INODE_FLAG_COMPR 0x00000004 // Compress file 116 #define EXT4_INODE_FLAG_SYNC 0x00000008 // Synchronous updates 117 #define EXT4_INODE_FLAG_IMMUTABLE 0x00000010 // Immutable file 118 #define EXT4_INODE_FLAG_APPEND 0x00000020 // writes to file may only append 119 #define EXT4_INODE_FLAG_NODUMP 0x00000040 // do not dump file 120 #define EXT4_INODE_FLAG_NOATIME 0x00000080 // do not update atime 121 /* Compression flags */ 122 #define EXT4_INODE_FLAG_DIRTY 0x00000100 123 #define EXT4_INODE_FLAG_COMPRBLK 0x00000200 // One or more compressed clusters 124 #define EXT4_INODE_FLAG_NOCOMPR 0x00000400 // Don't compress 125 #define EXT4_INODE_FLAG_ECOMPR 0x00000800 // Compression error 126 /* End compression flags --- maybe not all used */ 127 #define EXT4_INODE_FLAG_INDEX 0x00001000 // hash-indexed directory 128 #define EXT4_INODE_FLAG_IMAGIC 0x00002000 // AFS directory */ 129 #define EXT4_INODE_FLAG_JOURNAL_DATA 0x00004000 // File data should be journaled 130 #define EXT4_INODE_FLAG_NOTAIL 0x00008000 // File tail should not be merged 131 #define EXT4_INODE_FLAG_DIRSYNC 0x00010000 // Dirsync behaviour (directories only) 132 #define EXT4_INODE_FLAG_TOPDIR 0x00020000 // Top of directory hierarchies 133 #define EXT4_INODE_FLAG_HUGE_FILE 0x00040000 // Set to each huge file 134 #define EXT4_INODE_FLAG_EXTENTS 0x00080000 // Inode uses extents 135 #define EXT4_INODE_FLAG_EA_INODE 0x00200000 // Inode used for large EA 136 #define EXT4_INODE_FLAG_EOFBLOCKS 0x00400000 // Blocks allocated beyond EOF 137 #define EXT4_INODE_FLAG_RESERVED 0x80000000 // reserved for ext4 lib 138 110 139 #define EXT4_INODE_ROOT_INDEX 2 111 140 … … 132 161 extern uint16_t ext4_inode_get_links_count(ext4_inode_t *); 133 162 /* 134 extern uint64_t ext4_inode_get_blocks_count(ext4_inode_t *); 163 extern uint64_t ext4_inode_get_blocks_count(ext4_inode_t *) 164 */ 135 165 extern uint32_t ext4_inode_get_flags(ext4_inode_t *); 136 */137 166 138 167 uint32_t ext4_inode_get_direct_block(ext4_inode_t *, uint8_t); … … 152 181 */ 153 182 183 extern bool ext4_inode_has_flag(ext4_inode_t *, uint32_t); 184 154 185 #endif 155 186 -
uspace/srv/fs/ext4fs/ext4fs_ops.c
r2ea6392 r7b9381b 454 454 } 455 455 456 // TODO check if directory uses HTree457 if (ext4_filesystem_has_feature_compatible(fs, EXT4_FEATURE_COMPAT_DIR_INDEX)) {458 EXT4FS_DBG("Using HTree");459 }460 461 456 rc = ext4_directory_iterator_init(&it, fs, enode->inode_ref, 0); 462 457 if (rc != EOK) { … … 750 745 751 746 // TODO check if directory uses HTree 752 if (ext4_filesystem_has_feature_compatible(inst->filesystem, EXT4_FEATURE_COMPAT_DIR_INDEX)) { 753 EXT4FS_DBG("Using HTree"); 747 if (ext4_filesystem_has_feature_compatible(inst->filesystem, EXT4_FEATURE_COMPAT_DIR_INDEX) 748 && ext4_inode_has_flag(inode_ref->inode, EXT4_INODE_FLAG_INDEX)) { 749 EXT4FS_DBG("Directory using HTree"); 754 750 } 755 751 … … 827 823 ext4fs_instance_t *inst, ext4_inode_ref_t *inode_ref, size_t *rbytes) 828 824 { 829 EXT4FS_DBG("");830 831 825 int rc; 832 826 uint32_t block_size;
Note:
See TracChangeset
for help on using the changeset viewer.