Changeset 7b9381b in mainline


Ignore:
Timestamp:
2011-10-10T12:09:03Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
829d238
Parents:
2ea6392
Message:

Inode flags added

Location:
uspace
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_inode.c

    r2ea6392 r7b9381b  
    8484/*
    8585extern uint64_t ext4_inode_get_blocks_count(ext4_inode_t *);
    86 extern uint32_t ext4_inode_get_flags(ext4_inode_t *);
    8786*/
     87
     88uint32_t ext4_inode_get_flags(ext4_inode_t *inode) {
     89        return uint32_t_le2host(inode->flags);
     90}
    8891
    8992uint32_t ext4_inode_get_direct_block(ext4_inode_t *inode, uint8_t idx)
     
    99102}
    100103
     104
     105// Flags checker
     106bool 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
    101113/**
    102114 * @}
  • uspace/lib/ext4/libext4_inode.h

    r2ea6392 r7b9381b  
    108108#define EXT4_INODE_MODE_TYPE_MASK       0xF000
    109109
     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
    110139#define EXT4_INODE_ROOT_INDEX   2
    111140
     
    132161extern uint16_t ext4_inode_get_links_count(ext4_inode_t *);
    133162/*
    134 extern uint64_t ext4_inode_get_blocks_count(ext4_inode_t *);
     163extern uint64_t ext4_inode_get_blocks_count(ext4_inode_t *)
     164*/
    135165extern uint32_t ext4_inode_get_flags(ext4_inode_t *);
    136 */
    137166
    138167uint32_t ext4_inode_get_direct_block(ext4_inode_t *, uint8_t);
     
    152181*/
    153182
     183extern bool ext4_inode_has_flag(ext4_inode_t *, uint32_t);
     184
    154185#endif
    155186
  • uspace/srv/fs/ext4fs/ext4fs_ops.c

    r2ea6392 r7b9381b  
    454454        }
    455455
    456         // TODO check if directory uses HTree
    457         if (ext4_filesystem_has_feature_compatible(fs, EXT4_FEATURE_COMPAT_DIR_INDEX)) {
    458                 EXT4FS_DBG("Using HTree");
    459         }
    460 
    461456        rc = ext4_directory_iterator_init(&it, fs, enode->inode_ref, 0);
    462457        if (rc != EOK) {
     
    750745
    751746        // 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");
    754750        }
    755751
     
    827823    ext4fs_instance_t *inst, ext4_inode_ref_t *inode_ref, size_t *rbytes)
    828824{
    829         EXT4FS_DBG("");
    830 
    831825        int rc;
    832826        uint32_t block_size;
Note: See TracChangeset for help on using the changeset viewer.