diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-02-18 15:24:11 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-02-18 15:24:11 +0000 |
commit | 5420d590b328622811a38f7775f1e304faf956d0 (patch) | |
tree | 40258dad98a7d2e2a84a8e54665d029732689368 /lib/ext2fs/fileio.c | |
parent | a7ba9645a38361fe68524abed78208680c4eca47 (diff) | |
parent | 70d7281dcbf3180d291ade48296982dcda356877 (diff) | |
download | e2fsprogs-5420d590b328622811a38f7775f1e304faf956d0.tar.gz |
Merge branch 'master' into baserock/morph
This updates baserock/morph to the currently mirrored upstream
version. This is what we used to be building, in fact.
Diffstat (limited to 'lib/ext2fs/fileio.c')
-rw-r--r-- | lib/ext2fs/fileio.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/ext2fs/fileio.c b/lib/ext2fs/fileio.c index d56f5b50..1f7002cd 100644 --- a/lib/ext2fs/fileio.c +++ b/lib/ext2fs/fileio.c @@ -106,6 +106,14 @@ struct ext2_inode *ext2fs_file_get_inode(ext2_file_t file) return &file->inode; } +/* This function returns the inode number from the structure */ +ext2_ino_t ext2fs_file_get_inode_num(ext2_file_t file) +{ + if (file->magic != EXT2_ET_MAGIC_EXT2_FILE) + return 0; + return file->ino; +} + /* * This function flushes the dirty block buffer out to disk if * necessary. @@ -389,7 +397,7 @@ errcode_t ext2fs_file_set_size2(ext2_file_t file, ext2_off64_t size) return retval; } - if (truncate_block <= old_truncate) + if (truncate_block >= old_truncate) return 0; return ext2fs_punch(file->fs, file->ino, &file->inode, 0, |