lwext4.git
5 years agoFix "const const" warning
Fangrui Song [Sun, 18 Nov 2018 21:48:31 +0000 (13:48 -0800)]
Fix "const const" warning

5 years agoext4: fix ext4_fsymlink creation
Grzegorz Kostka [Wed, 26 Sep 2018 20:35:36 +0000 (22:35 +0200)]
ext4: fix ext4_fsymlink creation

Solve the problem with long symbolic links creation.
Thanks to: @cobenhan

5 years agoext4_dir: fix non existing entry creation issue
rajeshvenkataraman [Sun, 23 Sep 2018 14:49:30 +0000 (07:49 -0700)]
ext4_dir: fix non existing entry creation issue

Added the length of the name string a a parameter.
Using strlen() on the name string may not give the correct length
in case of paths like: /mountpoint/nonexistdir1/nonexistdir2.

6 years agoext4: move ext4_fs_alloc_inode result check to right place
Grzegorz Kostka [Thu, 5 Apr 2018 08:54:24 +0000 (10:54 +0200)]
ext4: move ext4_fs_alloc_inode result check to right place

6 years agoMerge pull request #36 from mmmaisel/dev
Grzegorz Kostka [Thu, 1 Mar 2018 18:58:03 +0000 (19:58 +0100)]
Merge pull request #36 from mmmaisel/dev

Improvements from ext4-browser project

6 years agoMerge pull request #35 from mmmaisel/cmake
Grzegorz Kostka [Thu, 1 Mar 2018 18:51:41 +0000 (19:51 +0100)]
Merge pull request #35 from mmmaisel/cmake

CMake: Added option whether to build static or shared library

6 years agoMerge pull request #34 from mmmaisel/master
Grzegorz Kostka [Thu, 1 Mar 2018 18:51:06 +0000 (19:51 +0100)]
Merge pull request #34 from mmmaisel/master

Fix: ext4-mkfs and ext4-mbr-write use wrong partition size in case of multiple partitions

6 years agoCMake: Added option whether to build static or shared library
Max [Thu, 1 Mar 2018 16:20:35 +0000 (17:20 +0100)]
CMake: Added option whether to build static or shared library

6 years agoext4-mkfs: Use correct partition size
Max Maisel [Thu, 1 Mar 2018 16:18:15 +0000 (17:18 +0100)]
ext4-mkfs: Use correct partition size

6 years agoext4-mbr-write: Fixed partition size calculation
Max Maisel [Thu, 1 Mar 2018 16:16:18 +0000 (17:16 +0100)]
ext4-mbr-write: Fixed partition size calculation

6 years agoext4_mkfs: Added UUID parameter to create new filesystems with non-zero UUID
Max Maisel [Thu, 1 Mar 2018 16:31:32 +0000 (17:31 +0100)]
ext4_mkfs: Added UUID parameter to create new filesystems with non-zero UUID

6 years agoext4_mbr: Added "disk_id" parameter to MBR creation function
Max Maisel [Thu, 1 Mar 2018 16:28:40 +0000 (17:28 +0100)]
ext4_mbr: Added "disk_id" parameter to MBR creation function

6 years agoext4_blockdev: Added user data pointer
Max Maisel [Thu, 1 Mar 2018 16:27:14 +0000 (17:27 +0100)]
ext4_blockdev: Added user data pointer

6 years agoMerge pull request #33 from enetor/fseek
Grzegorz Kostka [Fri, 20 Oct 2017 07:40:37 +0000 (09:40 +0200)]
Merge pull request #33 from enetor/fseek

Use int64_t as offset to ext4_fseek.

6 years agoUse int64_t as offset to ext4_fseek.
Fan Deng [Wed, 18 Oct 2017 17:54:54 +0000 (10:54 -0700)]
Use int64_t as offset to ext4_fseek.

This change makes it possible to fseek backwards in fseek.

Tested:
  make test_all

6 years agoMerge pull request #32 from enetor/useless-if
Grzegorz Kostka [Tue, 17 Oct 2017 22:47:00 +0000 (00:47 +0200)]
Merge pull request #32 from enetor/useless-if

Remove an unuseful if check in ext4.c.

6 years agoRemove an unuseful if check in ext4.c.
Fan Deng [Tue, 17 Oct 2017 18:33:18 +0000 (11:33 -0700)]
Remove an unuseful if check in ext4.c.

The if check on s_bdevices[i].name is unuseful, as 'name' always
evaluates to true:
    if (s_bdevices[i].name) {
        ...
    }
This change removes the check to be consistent with the rest of the code
(see line 124 and 144).

6 years agoMerge pull request #31 from raandoom/assert_release
Grzegorz Kostka [Sun, 8 Oct 2017 20:51:51 +0000 (22:51 +0200)]
Merge pull request #31 from raandoom/assert_release

Move function call outside assert()

6 years agomove function call outside assert()
raandoom [Sun, 8 Oct 2017 20:27:36 +0000 (23:27 +0300)]
move function call outside assert()

6 years agoFix a compile issue with big endian config & some small issues fixes
branzhu [Thu, 13 Jul 2017 10:48:43 +0000 (10:48 +0000)]
Fix a compile issue with big endian config & some small issues fixes

6 years agoSuppress gcc 7.xx warnings (fall through in switch statement)
gkostka [Tue, 11 Jul 2017 15:55:08 +0000 (17:55 +0200)]
Suppress gcc 7.xx warnings (fall through in switch statement)

6 years agoext4_journal: fix not purging enough transactions
Kaho Ng [Fri, 30 Jun 2017 12:05:07 +0000 (20:05 +0800)]
ext4_journal: fix not purging enough transactions

We have to purge all consecutive transactions that
has all its buffers written to persistent location.

6 years agoext4_balloc: fix not creating revoke records correctly
Kaho Ng [Wed, 21 Jun 2017 20:20:43 +0000 (04:20 +0800)]
ext4_balloc: fix not creating revoke records correctly

We fix ext4_balloc_free_blocks() not creating revoke records
correctly according to start block and block count parameter
from caller.

6 years agoext4_balloc: fix not invaliding cache correctly
Kaho Ng [Wed, 21 Jun 2017 18:26:19 +0000 (02:26 +0800)]
ext4_balloc: fix not invaliding cache correctly

We fix ext4_balloc_free_blocks() not invaliding cache
correctly according to start block and block count parameter
from caller.

6 years agoext4: fix transaction start/stop scopes
Grzegorz Kostka [Wed, 31 May 2017 13:12:07 +0000 (15:12 +0200)]
ext4: fix transaction start/stop scopes

Remove transaction scope from ext4_generic_open2 method.

6 years agoChange lwext4 license to GPL2
gkostka [Sat, 20 May 2017 08:01:47 +0000 (10:01 +0200)]
Change lwext4 license to GPL2

Some of the source files are licensed under GPL2. It makes whole
lwext4 GPL2 licensed. To use library as a BSD3, GPL licensed source
files must be removed first. At this point there are two files
licensed under GPL2:
* ext4_xattr.c
* ext4_extents.c

6 years agoext4_config: add defines allowing disabling xattr and extent modules
gkostka [Sat, 20 May 2017 07:35:40 +0000 (09:35 +0200)]
ext4_config: add defines allowing disabling xattr and extent modules

6 years agoext4_dir_idx: make qsort as a default dir idx sort algorithm
gkostka [Sat, 20 May 2017 07:23:54 +0000 (09:23 +0200)]
ext4_dir_idx: make qsort as a default dir idx sort algorithm

6 years agoMake ext4_xattr & ext4_extents GPL licensed
gkostka [Sat, 20 May 2017 06:39:52 +0000 (08:39 +0200)]
Make ext4_xattr & ext4_extents GPL licensed

7 years agoext4: add ext4_inode_exist method
gkostka [Wed, 19 Apr 2017 18:47:14 +0000 (20:47 +0200)]
ext4: add ext4_inode_exist method

7 years agotoolchain: add toolchain files for new MCUs & simplify makefile
gkostka [Wed, 19 Apr 2017 15:55:46 +0000 (17:55 +0200)]
toolchain: add toolchain files for new MCUs & simplify makefile

7 years agoext4_journal: fix error handling in jbd_get_fs
gkostka [Wed, 19 Apr 2017 14:35:14 +0000 (16:35 +0200)]
ext4_journal: fix error handling in jbd_get_fs

7 years agoChange include type policy
gkostka [Wed, 5 Apr 2017 18:12:52 +0000 (20:12 +0200)]
Change include type policy

Since all headers are ins separate directory, includes could be
done by using <> instead of "".

7 years agoName refactiring inside file_windows module
gkostka [Wed, 5 Apr 2017 17:47:04 +0000 (19:47 +0200)]
Name refactiring inside file_windows module

7 years agoRename ext4_filedev to file_dev
gkostka [Wed, 5 Apr 2017 17:43:19 +0000 (19:43 +0200)]
Rename ext4_filedev to file_dev

7 years agoRename io_raw module to more appropriate file_windows
gkostka [Wed, 5 Apr 2017 17:35:46 +0000 (19:35 +0200)]
Rename io_raw module to more appropriate file_windows

7 years agoRemove unused unpack_images make target
gkostka [Wed, 5 Apr 2017 17:30:44 +0000 (19:30 +0200)]
Remove unused unpack_images make target

7 years agoRemove prefix patch directory
gkostka [Wed, 5 Apr 2017 17:28:15 +0000 (19:28 +0200)]
Remove prefix patch directory

Seems to be redundant.

7 years agoRemove 7z archive with test images
gkostka [Wed, 5 Apr 2017 17:26:26 +0000 (19:26 +0200)]
Remove 7z archive with test images

Now images will be created by fsck.extN tool.

7 years agoMerge pull request #22 from branzhu/master
Grzegorz Kostka [Fri, 24 Mar 2017 07:54:22 +0000 (08:54 +0100)]
Merge pull request #22 from branzhu/master

Fix issues with big-endian system

7 years agoFix issues with big-endian system
branzhu [Fri, 24 Mar 2017 04:51:51 +0000 (00:51 -0400)]
Fix issues with big-endian system

7 years agoUpdate README.md
Grzegorz Kostka [Wed, 8 Mar 2017 09:32:52 +0000 (10:32 +0100)]
Update README.md

7 years agoext4_xattr: fix access violation if extra_isize is 0
Kaho Ng [Mon, 27 Feb 2017 16:52:03 +0000 (00:52 +0800)]
ext4_xattr: fix access violation if extra_isize is 0

7 years agoext4_fs: set i_extra_isize to ext4_sblock::min_extra_isize
Kaho Ng [Mon, 27 Feb 2017 16:17:43 +0000 (00:17 +0800)]
ext4_fs: set i_extra_isize to ext4_sblock::min_extra_isize

7 years agoext4_inode: deal with i_extra_isize depending on inode size
Kaho Ng [Mon, 27 Feb 2017 16:05:12 +0000 (00:05 +0800)]
ext4_inode: deal with i_extra_isize depending on inode size

7 years agoext4_xattr: fix trying to read EA block even if it is absent
Kaho Ng [Mon, 27 Feb 2017 14:49:53 +0000 (22:49 +0800)]
ext4_xattr: fix trying to read EA block even if it is absent

7 years agoext4_mkfs: add journal node creation support
gkostka [Tue, 21 Feb 2017 20:30:54 +0000 (21:30 +0100)]
ext4_mkfs: add journal node creation support

7 years agoext4: improve dox documentation style
gkostka [Sun, 19 Feb 2017 21:03:23 +0000 (22:03 +0100)]
ext4: improve dox documentation style

7 years agoext4: little style improvements
Grzegorz Kostka [Fri, 17 Feb 2017 13:30:30 +0000 (14:30 +0100)]
ext4: little style improvements

7 years agoext4: remove dynamic block cache allocation in ext4_mount
Grzegorz Kostka [Fri, 17 Feb 2017 12:44:05 +0000 (13:44 +0100)]
ext4: remove dynamic block cache allocation in ext4_mount

7 years agoUpdate license file (github badge)
gkostka [Fri, 17 Feb 2017 00:36:29 +0000 (01:36 +0100)]
Update license file (github badge)

7 years agoext4: remove block cache parameter from device_register function
gkostka [Fri, 17 Feb 2017 00:26:56 +0000 (01:26 +0100)]
ext4: remove block cache parameter from device_register function

This parameter is useless since cache is always initialized by malloc.

7 years agoUpdate licence file (comment scope remove)
gkostka [Fri, 17 Feb 2017 00:03:31 +0000 (01:03 +0100)]
Update licence file (comment scope remove)

7 years agoext4: add block device unregister by name & all methods
gkostka [Thu, 16 Feb 2017 23:54:06 +0000 (00:54 +0100)]
ext4: add block device unregister by name & all methods

7 years agoext4: remove read-only check in get atime/mtime/ctime/mode/own methods
gkostka [Thu, 16 Feb 2017 22:22:36 +0000 (23:22 +0100)]
ext4: remove read-only check in get atime/mtime/ctime/mode/own methods

7 years agoext4: add methods to access file mode, owner, atime, mtime, ctime
gkostka [Wed, 15 Feb 2017 21:56:06 +0000 (22:56 +0100)]
ext4: add methods to access file mode, owner, atime, mtime, ctime

7 years agoSet theme jekyll-theme-hacker
Grzegorz Kostka [Fri, 3 Feb 2017 08:45:29 +0000 (09:45 +0100)]
Set theme jekyll-theme-hacker

7 years agoext4_journal: improve jbd_journal_alloc_block performance
gkostka [Thu, 19 Jan 2017 00:04:49 +0000 (01:04 +0100)]
ext4_journal: improve jbd_journal_alloc_block performance

Purge only one journal transaction if we are run out of journal
device space.

7 years agoext4: add ext4_cache_flush for explicit cache flush
gkostka [Wed, 18 Jan 2017 21:35:36 +0000 (22:35 +0100)]
ext4: add ext4_cache_flush for explicit cache flush

7 years agoext4_blockdev: don't make zero length block read/write operations
gkostka [Thu, 1 Dec 2016 15:37:23 +0000 (16:37 +0100)]
ext4_blockdev: don't make zero length block read/write operations

Patch submitted by g.tywanczuk@posnet.com.

7 years agoext4_journal: some reworks to stale metadata protection
Kaho Ng [Mon, 21 Nov 2016 21:24:18 +0000 (05:24 +0800)]
ext4_journal: some reworks to stale metadata protection

7 years agoext4_journal: modify the first 4 bytes of the logged block when needed
Kaho Ng [Thu, 22 Sep 2016 07:21:51 +0000 (15:21 +0800)]
ext4_journal: modify the first 4 bytes of the logged block when needed

7 years agoext4_journal: fix JBD_FLAG_ESCAPE handling
Kaho Ng [Thu, 22 Sep 2016 07:17:28 +0000 (15:17 +0800)]
ext4_journal: fix JBD_FLAG_ESCAPE handling

7 years agoMerge pull request #15 from exander77/master
Grzegorz Kostka [Tue, 6 Sep 2016 00:33:12 +0000 (02:33 +0200)]
Merge pull request #15 from exander77/master

fix: mingw build

7 years agofix: mingw build
Ing. Radomír Polách [Mon, 5 Sep 2016 21:29:39 +0000 (23:29 +0200)]
fix: mingw build

7 years agoUpdate README.md
Grzegorz Kostka [Fri, 26 Aug 2016 13:58:41 +0000 (15:58 +0200)]
Update README.md

7 years agoext4_journal: do not replay revoked block within the same transaction
Kaho Ng [Wed, 24 Aug 2016 07:18:09 +0000 (07:18 +0000)]
ext4_journal: do not replay revoked block within the same transaction

7 years agoext4_types: change "user" prefix to "ext4_user"
gkostka [Fri, 19 Aug 2016 11:03:21 +0000 (13:03 +0200)]
ext4_types: change "user" prefix to "ext4_user"

 Prefix ext4_user looks more appropriately.

7 years agoMerge pull request #13 from mmajewicz/malloc_substitution
Grzegorz Kostka [Fri, 19 Aug 2016 11:01:42 +0000 (13:01 +0200)]
Merge pull request #13 from mmajewicz/malloc_substitution

ext4: easy malloc/calloc/realloc/free substitution

7 years agoext4: malloc substitution - moved option definition and changed names
Michał Majewicz [Fri, 19 Aug 2016 10:31:13 +0000 (12:31 +0200)]
ext4: malloc substitution - moved option definition and changed names

7 years agoext4: easy malloc/calloc/realloc/free substitution
Michał Majewicz [Fri, 19 Aug 2016 08:41:47 +0000 (10:41 +0200)]
ext4: easy malloc/calloc/realloc/free substitution

7 years agoMerge pull request #12 from mmajewicz/extern_C_fix
Grzegorz Kostka [Fri, 19 Aug 2016 09:21:11 +0000 (11:21 +0200)]
Merge pull request #12 from mmajewicz/extern_C_fix

ext4_block_group.h: fix lack of extern "C" closing brace

7 years agoext4_block_group.h: fix lack of extern "C" closing brace
Michał Majewicz [Fri, 19 Aug 2016 08:40:50 +0000 (10:40 +0200)]
ext4_block_group.h: fix lack of extern "C" closing brace

7 years agoext4_journal: tune the logic of block zeroing in write_commit_block()
Kaho Ng [Fri, 19 Aug 2016 02:36:57 +0000 (02:36 +0000)]
ext4_journal: tune the logic of block zeroing in write_commit_block()

7 years agoext4_mkfs: little function name refactoring
gkostka [Tue, 16 Aug 2016 18:43:27 +0000 (20:43 +0200)]
ext4_mkfs: little function name refactoring

7 years agoext4_mkfs: improve block group init performance
gkostka [Tue, 16 Aug 2016 18:26:57 +0000 (20:26 +0200)]
ext4_mkfs: improve block group init performance

7 years agoext4_mkfs: merge fill_bgroups and write_bgroups into one function
gkostka [Tue, 16 Aug 2016 16:38:45 +0000 (18:38 +0200)]
ext4_mkfs: merge fill_bgroups and write_bgroups into one function

Previous implementation might alloc a lot of memory to hold
block group descriptors. Now only one block group descriptor
is allocated. However, this might have some performance consequences.

7 years agoext4: add filetype checking to ext4_mknod
Kaho Ng [Wed, 29 Jun 2016 21:30:28 +0000 (05:30 +0800)]
ext4: add filetype checking to ext4_mknod

7 years agoext4: special inode creation support
Kaho Ng [Wed, 29 Jun 2016 21:17:33 +0000 (05:17 +0800)]
ext4: special inode creation support

7 years agoext4: fix possible access violation when copying name fields
Kaho Ng [Tue, 28 Jun 2016 15:02:16 +0000 (23:02 +0800)]
ext4: fix possible access violation when copying name fields

7 years agoext4_journal: fix memory leakage when revoking a block repeatedly
Kaho Ng [Tue, 28 Jun 2016 09:18:52 +0000 (17:18 +0800)]
ext4_journal: fix memory leakage when revoking a block repeatedly

7 years agoext4_journal: fix memory leakage when reallocating a revoked block
Kaho Ng [Tue, 28 Jun 2016 04:03:07 +0000 (12:03 +0800)]
ext4_journal: fix memory leakage when reallocating a revoked block

7 years agoext4: @replace in ext4_setxattr() is deprecated
Kaho Ng [Sun, 19 Jun 2016 18:06:04 +0000 (02:06 +0800)]
ext4: @replace in ext4_setxattr() is deprecated

7 years agoext4_xattr: rework the EA submodule
Kaho Ng [Thu, 9 Jun 2016 14:27:04 +0000 (22:27 +0800)]
ext4_xattr: rework the EA submodule

7 years agoext4_extent: add comments to truncate routines
Kaho Ng [Tue, 31 May 2016 16:06:46 +0000 (00:06 +0800)]
ext4_extent: add comments to truncate routines

7 years agoext4_extent: fix truncate freeing blocks at the wrong boundary
Kaho Ng [Tue, 31 May 2016 11:46:38 +0000 (19:46 +0800)]
ext4_extent: fix truncate freeing blocks at the wrong boundary

7 years agoext4_xattr: fix not considering iter()'s return value
Kaho Ng [Fri, 27 May 2016 01:54:54 +0000 (09:54 +0800)]
ext4_xattr: fix not considering iter()'s return value

7 years agoext4_journal: fix trans_id_diff return value
gkostka [Tue, 24 May 2016 07:27:05 +0000 (09:27 +0200)]
ext4_journal: fix trans_id_diff return value

7 years agoext4_journal: handle trans_id wrapping around cases
Kaho Ng [Tue, 24 May 2016 05:37:12 +0000 (13:37 +0800)]
ext4_journal: handle trans_id wrapping around cases

8 years agoext4_xattr: fix missing a type conversion from int32_t to size_t
Kaho Ng [Mon, 16 May 2016 15:38:07 +0000 (23:38 +0800)]
ext4_xattr: fix missing a type conversion from int32_t to size_t

8 years agoext4_fs: zero the inode when allocated
ngkaho1234 [Mon, 16 May 2016 11:59:46 +0000 (11:59 +0000)]
ext4_fs: zero the inode when allocated

8 years agoext4_xattr: allow more entries to be inserted when space is small
ngkaho1234 [Mon, 16 May 2016 10:19:41 +0000 (10:19 +0000)]
ext4_xattr: allow more entries to be inserted when space is small

8 years agoext4_xattr: fix not computing hash of on-block entries
ngkaho1234 [Mon, 16 May 2016 10:08:14 +0000 (10:08 +0000)]
ext4_xattr: fix not computing hash of on-block entries

I forget to do that, sorry. :-(

8 years agoext4_xattr: type changes
ngkaho1234 [Mon, 16 May 2016 09:12:34 +0000 (09:12 +0000)]
ext4_xattr: type changes

 - struct ext4_xattr_ref::inode_size_rem's type is changed from int32_t to size_t
 - struct ext4_xattr_ref::block_size_rem's type is changed from int32_t to size_t

8 years agoext4_mbr: introduce ext4_mbr_write procedure
gkostka [Mon, 16 May 2016 07:36:07 +0000 (09:36 +0200)]
ext4_mbr: introduce ext4_mbr_write procedure

8 years agoext4_xattr: ext4_xattr_insert_item now returns error code
Kaho Ng [Mon, 16 May 2016 04:27:12 +0000 (12:27 +0800)]
ext4_xattr: ext4_xattr_insert_item now returns error code

8 years agoext4_xattr: invalidate the block buffer when writing fails
Kaho Ng [Sun, 15 May 2016 17:49:26 +0000 (01:49 +0800)]
ext4_xattr: invalidate the block buffer when writing fails

8 years agoext4_xattr: clear the content of acl block buffer before writing
Kaho Ng [Sun, 15 May 2016 17:48:02 +0000 (01:48 +0800)]
ext4_xattr: clear the content of acl block buffer before writing

8 years agoext4_xattr: better handling on some corner error case
Kaho Ng [Sun, 15 May 2016 16:16:37 +0000 (00:16 +0800)]
ext4_xattr: better handling on some corner error case

8 years agoext4_xattr: Changes to EA metadata handling macros
Kaho Ng [Thu, 12 May 2016 14:38:59 +0000 (22:38 +0800)]
ext4_xattr: Changes to EA metadata handling macros

 - Move them from include/ext4_types.h to include/ext4_xattr.h
 - Use ext4_inode_get_extra_isize to better handle extra_isize field
   of inodes.