Changeset 12b4a7f in mainline for uspace/lib/ext4/libext4_inode.c


Ignore:
Timestamp:
2011-11-07T16:23:30Z (13 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
43a9968
Parents:
052e82d
Message:

functional truncate operation (only to lower size actually), except extent files

File:
1 edited

Legend:

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

    r052e82d r12b4a7f  
    193193}
    194194
     195bool ext4_inode_can_truncate(ext4_inode_t *inode)
     196{
     197         if (ext4_inode_has_flag(inode, EXT4_INODE_FLAG_APPEND)
     198                         || ext4_inode_has_flag(inode, EXT4_INODE_FLAG_IMMUTABLE)) {
     199                 return false;
     200         }
     201
     202
     203         if (ext4_inode_get_mode(inode) == EXT4_INODE_MODE_FILE
     204                         || ext4_inode_get_mode(inode) == EXT4_INODE_MODE_DIRECTORY) {
     205                 return true;
     206         }
     207
     208         return false;
     209}
     210
    195211/**
    196212 * @}
Note: See TracChangeset for help on using the changeset viewer.