[eb91db7] | 1 | /*
|
---|
[f22d5ef0] | 2 | * Copyright (c) 2012 Frantisek Princ
|
---|
[eb91db7] | 3 | * All rights reserved.
|
---|
| 4 | *
|
---|
| 5 | * Redistribution and use in source and binary forms, with or without
|
---|
| 6 | * modification, are permitted provided that the following conditions
|
---|
| 7 | * are met:
|
---|
| 8 | *
|
---|
| 9 | * - Redistributions of source code must retain the above copyright
|
---|
| 10 | * notice, this list of conditions and the following disclaimer.
|
---|
| 11 | * - Redistributions in binary form must reproduce the above copyright
|
---|
| 12 | * notice, this list of conditions and the following disclaimer in the
|
---|
| 13 | * documentation and/or other materials provided with the distribution.
|
---|
| 14 | * - The name of the author may not be used to endorse or promote products
|
---|
| 15 | * derived from this software without specific prior written permission.
|
---|
| 16 | *
|
---|
| 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
---|
| 18 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
---|
| 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
---|
| 20 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
---|
| 21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
---|
| 22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
---|
| 23 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
---|
| 24 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
---|
| 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 27 | */
|
---|
| 28 |
|
---|
| 29 | /** @addtogroup libext4
|
---|
| 30 | * @{
|
---|
| 31 | */
|
---|
| 32 |
|
---|
| 33 | #ifndef LIBEXT4_LIBEXT4_INODE_H_
|
---|
| 34 | #define LIBEXT4_LIBEXT4_INODE_H_
|
---|
| 35 |
|
---|
[6c501f8] | 36 | #include <libblock.h>
|
---|
[9875711] | 37 | #include <sys/types.h>
|
---|
[b53a733] | 38 | #include "libext4_types.h"
|
---|
[9b9d37bb] | 39 |
|
---|
| 40 | extern uint32_t ext4_inode_get_mode(ext4_superblock_t *, ext4_inode_t *);
|
---|
[fe27eb4] | 41 | extern void ext4_inode_set_mode(ext4_superblock_t *, ext4_inode_t *, uint32_t);
|
---|
[3712434] | 42 | extern uint32_t ext4_inode_get_uid(ext4_inode_t *);
|
---|
[fe27eb4] | 43 | extern void ext4_inode_set_uid(ext4_inode_t *, uint32_t);
|
---|
[9b9d37bb] | 44 | extern uint64_t ext4_inode_get_size(ext4_superblock_t *, ext4_inode_t *);
|
---|
[052e82d] | 45 | extern void ext4_inode_set_size(ext4_inode_t *, uint64_t);
|
---|
[3712434] | 46 | extern uint32_t ext4_inode_get_access_time(ext4_inode_t *);
|
---|
[fe27eb4] | 47 | extern void ext4_inode_set_access_time(ext4_inode_t *, uint32_t);
|
---|
[3712434] | 48 | extern uint32_t ext4_inode_get_change_inode_time(ext4_inode_t *);
|
---|
[fe27eb4] | 49 | extern void ext4_inode_set_change_inode_time(ext4_inode_t *, uint32_t);
|
---|
[3712434] | 50 | extern uint32_t ext4_inode_get_modification_time(ext4_inode_t *);
|
---|
[fe27eb4] | 51 | extern void ext4_inode_set_modification_time(ext4_inode_t *, uint32_t);
|
---|
[3712434] | 52 | extern uint32_t ext4_inode_get_deletion_time(ext4_inode_t *);
|
---|
[fe27eb4] | 53 | extern void ext4_inode_set_deletion_time(ext4_inode_t *, uint32_t);
|
---|
[3712434] | 54 | extern uint32_t ext4_inode_get_gid(ext4_inode_t *);
|
---|
[fe27eb4] | 55 | extern void ext4_inode_set_gid(ext4_inode_t *, uint32_t);
|
---|
[3712434] | 56 | extern uint16_t ext4_inode_get_links_count(ext4_inode_t *);
|
---|
[fe27eb4] | 57 | extern void ext4_inode_set_links_count(ext4_inode_t *, uint16_t);
|
---|
[b3d7277] | 58 | extern uint64_t ext4_inode_get_blocks_count(ext4_superblock_t *, ext4_inode_t *);
|
---|
| 59 | extern int ext4_inode_set_blocks_count(ext4_superblock_t *, ext4_inode_t *, uint64_t);
|
---|
[7b9381b] | 60 | extern uint32_t ext4_inode_get_flags(ext4_inode_t *);
|
---|
[fe27eb4] | 61 | extern void ext4_inode_set_flags(ext4_inode_t *, uint32_t);
|
---|
| 62 | extern uint32_t ext4_inode_get_generation(ext4_inode_t *);
|
---|
| 63 | extern void ext4_inode_set_generation(ext4_inode_t *, uint32_t);
|
---|
[b191acae] | 64 | extern uint64_t ext4_inode_get_file_acl(ext4_inode_t *, ext4_superblock_t *);
|
---|
| 65 | extern void ext4_inode_set_file_acl(ext4_inode_t *, ext4_superblock_t *, uint64_t);
|
---|
[3712434] | 66 | /*
|
---|
| 67 | uint16_t extra_isize;
|
---|
| 68 | uint32_t ctime_extra; // Extra change time (nsec << 2 | epoch)
|
---|
| 69 | uint32_t mtime_extra; // Extra Modification time (nsec << 2 | epoch)
|
---|
| 70 | uint32_t atime_extra; // Extra Access time (nsec << 2 | epoch)
|
---|
| 71 | uint32_t crtime; // File creation time
|
---|
| 72 | uint32_t crtime_extra; // Extra file creation time (nsec << 2 | epoch)
|
---|
| 73 | uint32_t version_hi; // High 32 bits for 64-bit version
|
---|
| 74 | */
|
---|
[eb91db7] | 75 |
|
---|
[fe27eb4] | 76 | /******************************************/
|
---|
| 77 |
|
---|
| 78 | extern uint32_t ext4_inode_get_direct_block(ext4_inode_t *, uint32_t);
|
---|
| 79 | extern void ext4_inode_set_direct_block(ext4_inode_t *, uint32_t, uint32_t);
|
---|
| 80 | extern uint32_t ext4_inode_get_indirect_block(ext4_inode_t *, uint32_t);
|
---|
| 81 | extern void ext4_inode_set_indirect_block(ext4_inode_t *, uint32_t, uint32_t);
|
---|
[acd869e] | 82 | extern ext4_extent_header_t * ext4_inode_get_extent_header(ext4_inode_t *);
|
---|
[fe27eb4] | 83 | extern bool ext4_inode_is_type(ext4_superblock_t *, ext4_inode_t *, uint32_t);
|
---|
[7b9381b] | 84 | extern bool ext4_inode_has_flag(ext4_inode_t *, uint32_t);
|
---|
[b3d7277] | 85 | extern void ext4_inode_clear_flag(ext4_inode_t *, uint32_t);
|
---|
| 86 | extern void ext4_inode_set_flag(ext4_inode_t *, uint32_t);
|
---|
[43a9968] | 87 | extern bool ext4_inode_can_truncate(ext4_superblock_t *, ext4_inode_t *);
|
---|
[7b9381b] | 88 |
|
---|
[eb91db7] | 89 | #endif
|
---|
| 90 |
|
---|
| 91 | /**
|
---|
| 92 | * @}
|
---|
| 93 | */
|
---|