lwext4.git
7 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

7 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

7 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

7 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. :-(

7 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

7 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

7 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

7 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

7 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

7 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

7 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.

7 years agoRefine extra_isize field handling
ngkaho1234 [Thu, 12 May 2016 13:59:44 +0000 (13:59 +0000)]
Refine extra_isize field handling

7 years agoext4_xattr: endianness fix.
Kaho Ng [Wed, 11 May 2016 16:24:02 +0000 (00:24 +0800)]
ext4_xattr: endianness fix.

7 years agoext4_xattr: fix freeing inode_ref's buffer when failed to initialize.
Kaho Ng [Wed, 11 May 2016 16:22:22 +0000 (00:22 +0800)]
ext4_xattr: fix freeing inode_ref's buffer when failed to initialize.

8 years agoext4: count on free blocks and inodes number after journal recovery.
ngkaho1234 [Sat, 7 May 2016 08:55:20 +0000 (08:55 +0000)]
ext4: count on free blocks and inodes number after journal recovery.

8 years agoUpdate README.md file
gkostka [Sat, 30 Apr 2016 09:20:58 +0000 (11:20 +0200)]
Update README.md file

8 years agoAdd separate LICENSE file
gkostka [Sat, 30 Apr 2016 09:17:54 +0000 (11:17 +0200)]
Add separate LICENSE file

8 years agoAdd Gitter badge
The Gitter Badger [Sat, 30 Apr 2016 08:53:47 +0000 (08:53 +0000)]
Add Gitter badge

8 years agoext4_journal: numorous changes.
Kaho Ng [Wed, 27 Apr 2016 11:11:31 +0000 (19:11 +0800)]
ext4_journal: numorous changes.

 - Do not utilize jbd_block_rec::buf because it can be unreliable that
   jbd_block_rec::buf may be freed.
 - Do not need to flush buffers before a new transaction is going to reference
   them.
 - add some comments to the changes.

8 years agoext4_journal: fix not wrapping blocks when recovering.
ngkaho1234 [Thu, 28 Apr 2016 17:31:33 +0000 (17:31 +0000)]
ext4_journal: fix not wrapping blocks when recovering.

8 years agoext4_journal: cosmetic fix for jbd_trans_set_block_dirty.
ngkaho1234 [Wed, 27 Apr 2016 06:01:38 +0000 (06:01 +0000)]
ext4_journal: cosmetic fix for jbd_trans_set_block_dirty.

8 years agoext4_journal: add once parameter to loops.
Kaho Ng [Sun, 24 Apr 2016 13:12:43 +0000 (21:12 +0800)]
ext4_journal: add once parameter to loops.

8 years agoext4_balloc: fix not revoking any blocks when freeing blocks.
ngkaho1234 [Sun, 24 Apr 2016 01:05:26 +0000 (01:05 +0000)]
ext4_balloc: fix not revoking any blocks when freeing blocks.

8 years agoext4_fs: fix possible overflow
gkostka [Tue, 12 Apr 2016 15:43:13 +0000 (17:43 +0200)]
ext4_fs: fix possible overflow

8 years agoext4_blockdev: change ERANGE to ENXIO error status
gkostka [Tue, 12 Apr 2016 15:42:09 +0000 (17:42 +0200)]
ext4_blockdev: change ERANGE to ENXIO error status

8 years agoext4_config: set CONFIG_UNALIGNED_ACCESS to 0 as default
gkostka [Fri, 1 Apr 2016 14:00:18 +0000 (16:00 +0200)]
ext4_config: set CONFIG_UNALIGNED_ACCESS to 0 as default

8 years agoext4_config: add CONFIG_UNALIGNED_ACCESS configuration switch
gkostka [Fri, 1 Apr 2016 13:05:29 +0000 (15:05 +0200)]
ext4_config: add CONFIG_UNALIGNED_ACCESS configuration switch

On some targets unaligned 32/16 bit access will raise exeption.

8 years agoext4: add rename/move directory procedure to main API
gkostka [Thu, 31 Mar 2016 18:47:43 +0000 (20:47 +0200)]
ext4: add rename/move directory procedure to main API

8 years agoCMake: add library & headers to make install target
gkostka [Thu, 31 Mar 2016 18:43:31 +0000 (20:43 +0200)]
CMake: add library & headers to make install target

8 years agoext4_mkfs: fix compilation warnings
gkostka [Mon, 21 Mar 2016 22:04:17 +0000 (23:04 +0100)]
ext4_mkfs: fix compilation warnings

8 years agoext4_journal: fix compilation warnings (may be used uninitialized)
gkostka [Mon, 21 Mar 2016 22:01:22 +0000 (23:01 +0100)]
ext4_journal: fix compilation warnings (may be used uninitialized)

8 years agotravis: change toolchain in travis file & add new builds
gkostka [Mon, 21 Mar 2016 21:33:15 +0000 (22:33 +0100)]
travis: change toolchain in travis file & add new builds

8 years agoRemove depreciated blackfin build
gkostka [Mon, 21 Mar 2016 19:39:02 +0000 (20:39 +0100)]
Remove depreciated blackfin build

Blackfin toolchain is too old to build lwext4 correctly

8 years agoext4_xattr: fix xattr functions not recognizing acl attribute name.
ngkaho1234 [Thu, 17 Mar 2016 04:27:53 +0000 (04:27 +0000)]
ext4_xattr: fix xattr functions not recognizing acl attribute name.

8 years agoFix travis build
gkostka [Thu, 18 Feb 2016 21:01:28 +0000 (22:01 +0100)]
Fix travis build

8 years agoFix assertion fault when disk space is full.
ngkaho1234 [Thu, 18 Feb 2016 15:20:25 +0000 (15:20 +0000)]
Fix assertion fault when disk space is full.

8 years agoext4_extent: compiler warning fix
gkostka [Sun, 14 Feb 2016 17:08:27 +0000 (18:08 +0100)]
ext4_extent: compiler warning fix

8 years agoext4_extent: cosmetic fix on code indentation.
ngkaho1234 [Sun, 14 Feb 2016 14:57:11 +0000 (14:57 +0000)]
ext4_extent: cosmetic fix on code indentation.

8 years agoext4_extent: cosmetic fixes on error code handling. Part 2.
ngkaho1234 [Sun, 14 Feb 2016 14:53:58 +0000 (14:53 +0000)]
ext4_extent: cosmetic fixes on error code handling. Part 2.

8 years agoext4_extent: introduce need_split boolean to invoke splitting.
ngkaho1234 [Sun, 14 Feb 2016 14:49:52 +0000 (14:49 +0000)]
ext4_extent: introduce need_split boolean to invoke splitting.

8 years agoext4_extent: cosmetic fixes on error code handling.
ngkaho1234 [Sat, 13 Feb 2016 17:25:25 +0000 (17:25 +0000)]
ext4_extent: cosmetic fixes on error code handling.

Do not detect flaws by seeing whether routines return non-zero value, instead
this should be done by seeing whether return value is not being EOK.

8 years agoext4_extent: Rework extent insertion.
ngkaho1234 [Fri, 12 Feb 2016 05:09:52 +0000 (05:09 +0000)]
ext4_extent: Rework extent insertion.

8 years agoUpdate README.md v1.0.0
gkostka [Tue, 9 Feb 2016 21:30:21 +0000 (22:30 +0100)]
Update README.md

8 years agoBump lwext4 version to 1.0.0 & changelog update
gkostka [Tue, 9 Feb 2016 21:06:05 +0000 (22:06 +0100)]
Bump lwext4 version to 1.0.0 & changelog update

8 years agoUpdate README.md
gkostka [Tue, 9 Feb 2016 20:34:33 +0000 (21:34 +0100)]
Update README.md

8 years agoext4_extent: return immediately when ext4_ext_correct_indexes fails.
ngkaho1234 [Thu, 4 Feb 2016 15:39:00 +0000 (15:39 +0000)]
ext4_extent: return immediately when ext4_ext_correct_indexes fails.

8 years agoext4_extent: fix passing wrong size to memmove.
ngkaho1234 [Thu, 4 Feb 2016 15:28:05 +0000 (15:28 +0000)]
ext4_extent: fix passing wrong size to memmove.

8 years agoFix prefix_patch toolkit.
ngkaho1234 [Wed, 3 Feb 2016 16:40:39 +0000 (16:40 +0000)]
Fix prefix_patch toolkit.

8 years agoFix type mismatch.
ngkaho1234 [Wed, 3 Feb 2016 14:17:47 +0000 (22:17 +0800)]
Fix type mismatch.

8 years agoRemove unnecessary stdio.h .
ngkaho1234 [Wed, 3 Feb 2016 10:29:28 +0000 (10:29 +0000)]
Remove unnecessary stdio.h .

8 years agoAdd toolkit that helps adding prefix to flags and errno V2.
ngkaho1234 [Sat, 30 Jan 2016 14:33:21 +0000 (22:33 +0800)]
Add toolkit that helps adding prefix to flags and errno V2.

8 years agoAdd toolkit that helps adding prefix to flags and errno.
ngkaho1234 [Thu, 28 Jan 2016 14:49:38 +0000 (22:49 +0800)]
Add toolkit that helps adding prefix to flags and errno.

8 years agoext4_mkfs: move roundup and align macros to misc header
gkostka [Mon, 1 Feb 2016 18:50:03 +0000 (19:50 +0100)]
ext4_mkfs: move roundup and align macros to misc header

8 years agoFix travis build
gkostka [Mon, 1 Feb 2016 18:35:50 +0000 (19:35 +0100)]
Fix travis build

Use never version of gcc 4.8

8 years agoRelocate other in-memory data structures from ext4_types.h
ngkaho1234 [Mon, 1 Feb 2016 03:18:15 +0000 (03:18 +0000)]
Relocate other in-memory data structures from ext4_types.h

These include ext4_inode_ref, ext4_dir_iter, ext4_dir_search_result
and ext4_dir_idx_block.

8 years agoRefactor header files dependencies.
ngkaho1234 [Sun, 31 Jan 2016 14:31:05 +0000 (22:31 +0800)]
Refactor header files dependencies.

8 years agoext4_mkfs: field 'len' of ext4_mkfs_info should be unsigned.
ngkaho1234 [Sun, 31 Jan 2016 09:40:09 +0000 (09:40 +0000)]
ext4_mkfs: field 'len' of ext4_mkfs_info should be unsigned.

8 years agoext4_fs: fix read_only not being set on ext4_fs structure.
ngkaho1234 [Sat, 30 Jan 2016 18:28:04 +0000 (18:28 +0000)]
ext4_fs: fix read_only not being set on ext4_fs structure.

8 years agoext4: fix ext4_fread failing when fs on read-only mode.
ngkaho1234 [Sat, 30 Jan 2016 17:25:51 +0000 (17:25 +0000)]
ext4: fix ext4_fread failing when fs on read-only mode.

8 years agoext4: add read_only parameter to ext4_mount routine.
ngkaho1234 [Sat, 30 Jan 2016 15:26:22 +0000 (23:26 +0800)]
ext4: add read_only parameter to ext4_mount routine.

Now users can mount a filesystem as read-only mode explicitly.

8 years agoCMake: now ext4_config.h will be automatically generated.
ngkaho1234 [Thu, 28 Jan 2016 16:18:58 +0000 (00:18 +0800)]
CMake: now ext4_config.h will be automatically generated.

8 years agoReconstruct source directory tree.
ngkaho1234 [Thu, 28 Jan 2016 14:46:36 +0000 (22:46 +0800)]
Reconstruct source directory tree.

8 years agobfin-elf.cmake: set -std=gnu99 for blackfin targets (unsupported gnu11)
gkostka [Wed, 27 Jan 2016 22:50:38 +0000 (23:50 +0100)]
bfin-elf.cmake: set -std=gnu99 for blackfin targets (unsupported gnu11)

8 years agoext4: ext4_chmod now only allows modifying the lowest 12bit of i_mode.
ngkaho1234 [Tue, 26 Jan 2016 06:15:35 +0000 (06:15 +0000)]
ext4: ext4_chmod now only allows modifying the lowest 12bit of i_mode.

8 years agoMove file opening & seeking flags to a separate header file.
ngkaho1234 [Mon, 25 Jan 2016 09:03:44 +0000 (09:03 +0000)]
Move file opening & seeking flags to a separate header file.

8 years agoReduce the number of errno definitions in ext4_errno.h.
root [Sun, 24 Jan 2016 05:53:46 +0000 (05:53 +0000)]
Reduce the number of errno definitions in ext4_errno.h.

8 years agoAdd type cast to eliminate compiler warning messages.
ngkaho1234 [Sun, 24 Jan 2016 04:24:03 +0000 (04:24 +0000)]
Add type cast to eliminate compiler warning messages.

8 years agoext4_ialloc: fix using uint32_t as block address.
ngkaho1234 [Sat, 23 Jan 2016 17:19:11 +0000 (17:19 +0000)]
ext4_ialloc: fix using uint32_t as block address.

8 years agoext4_config: set CONFIG_HAVE_OWN_ERRNO default value to 0
gkostka [Sat, 23 Jan 2016 16:37:24 +0000 (17:37 +0100)]
ext4_config: set CONFIG_HAVE_OWN_ERRNO default value to 0

8 years agoSpecify flags without -Wextra for non-gcc compilers.
ngkaho1234 [Sat, 23 Jan 2016 14:35:58 +0000 (22:35 +0800)]
Specify flags without -Wextra for non-gcc compilers.

8 years agoext4_filedev: use ftello instead of ftell.
ngkaho1234 [Sat, 23 Jan 2016 08:16:42 +0000 (08:16 +0000)]
ext4_filedev: use ftello instead of ftell.

8 years agoext4_debug: eliminate warning messages when assert is disabled.
ngkaho1234 [Sat, 23 Jan 2016 04:20:10 +0000 (04:20 +0000)]
ext4_debug: eliminate warning messages when assert is disabled.

8 years agoAdd 'lib_only' build target.
ngkaho1234 [Sat, 23 Jan 2016 03:28:20 +0000 (03:28 +0000)]
Add 'lib_only' build target.

Under this target, only a basic library will be built.

8 years agoFix __unused definition on non-gnuc platforms.
ngkaho1234 [Fri, 22 Jan 2016 17:31:44 +0000 (17:31 +0000)]
Fix __unused definition on non-gnuc platforms.

8 years agoRewrite __attribute__((packed)) as pragmas.
ngkaho1234 [Fri, 22 Jan 2016 10:51:39 +0000 (18:51 +0800)]
Rewrite __attribute__((packed)) as pragmas.

8 years agoext4_bcache: do not allow cache shaking when callback is invoked.
ngkaho1234 [Thu, 21 Jan 2016 15:53:41 +0000 (23:53 +0800)]
ext4_bcache: do not allow cache shaking when callback is invoked.

8 years agoext4_journal: two changes below.
ngkaho1234 [Thu, 21 Jan 2016 07:59:35 +0000 (07:59 +0000)]
ext4_journal: two changes below.

  - reset end_write(_arg) to NULL when buffer is invalidated.
  - set lb_id to @lba when a direct call to ext4_bcache_find_get succeeds.

8 years agoext4_journal: flush dirty buffers which have BC_TMP flag set.
ngkaho1234 [Thu, 21 Jan 2016 02:24:09 +0000 (02:24 +0000)]
ext4_journal: flush dirty buffers which have BC_TMP flag set.

8 years agoext4_journal: code logic optimization. See below.
ngkaho1234 [Tue, 19 Jan 2016 01:10:37 +0000 (01:10 +0000)]
ext4_journal: code logic optimization. See below.

  - reset buffer's end_write(_arg) fields only when buffer belongs to
    a transaction.

8 years agoext4_journal: abort a buffer when its data is discarded.
ngkaho1234 [Tue, 19 Jan 2016 00:57:59 +0000 (00:57 +0000)]
ext4_journal: abort a buffer when its data is discarded.

8 years agoext4_journal: remove pending transaction support. (useless)
ngkaho1234 [Sun, 17 Jan 2016 04:25:41 +0000 (04:25 +0000)]
ext4_journal: remove pending transaction support. (useless)

8 years agoext4_journal: the allocation in jbd_journal_flush_trans must succeed.
ngkaho1234 [Sun, 17 Jan 2016 02:37:23 +0000 (02:37 +0000)]
ext4_journal: the allocation in jbd_journal_flush_trans must succeed.

8 years agoext4_bcache: remove EXT4_BCACHE_STATIC_INSTANCE obsolete macro
gkostka [Sat, 16 Jan 2016 19:37:29 +0000 (20:37 +0100)]
ext4_bcache: remove EXT4_BCACHE_STATIC_INSTANCE obsolete macro

Cache can't be created in static way anymore

8 years agoext4: remove ext4_test_journal function
gkostka [Sat, 16 Jan 2016 19:31:10 +0000 (20:31 +0100)]
ext4: remove ext4_test_journal function

This function should not be in standard lwext4 API

8 years agoext4_journal: flushes buffers claimed by multiple transactions.
ngkaho1234 [Sat, 16 Jan 2016 18:28:18 +0000 (02:28 +0800)]
ext4_journal: flushes buffers claimed by multiple transactions.

8 years agoext4: complete the descriptions of extended attribute routines.
ngkaho1234 [Sat, 16 Jan 2016 16:06:18 +0000 (00:06 +0800)]
ext4: complete the descriptions of extended attribute routines.

8 years agoext4_fs: a space fix.
ngkaho1234 [Sat, 16 Jan 2016 13:19:58 +0000 (13:19 +0000)]
ext4_fs: a space fix.

8 years agoext4_dir_idx: ext4_dir_dx_init now only append file when necessary.
ngkaho1234 [Sat, 16 Jan 2016 13:19:31 +0000 (13:19 +0000)]
ext4_dir_idx: ext4_dir_dx_init now only append file when necessary.

8 years agoext4: introduce ext4_trunc_dir specific to removing directory.
ngkaho1234 [Sat, 16 Jan 2016 13:18:03 +0000 (13:18 +0000)]
ext4: introduce ext4_trunc_dir specific to removing directory.

8 years agoext4_config: introduce CONFIG_JOURNALING_ENABLE configuration switch
gkostka [Sat, 16 Jan 2016 11:50:13 +0000 (12:50 +0100)]
ext4_config: introduce CONFIG_JOURNALING_ENABLE configuration switch

Disabling journaling at compile time will reduce footprint
size significantly.

8 years agoext4_config: add ul to CONFIG_MAX_TRUNCATE_SIZE
gkostka [Sat, 16 Jan 2016 10:35:29 +0000 (11:35 +0100)]
ext4_config: add ul to CONFIG_MAX_TRUNCATE_SIZE

8 years agoext4: fix entering a dead loop when ext4_dir_rm failed.
ngkaho1234 [Sat, 16 Jan 2016 04:01:17 +0000 (04:01 +0000)]
ext4: fix entering a dead loop when ext4_dir_rm failed.

8 years agoext4: bring the support of recursive removal of directory back.
ngkaho1234 [Fri, 15 Jan 2016 15:41:29 +0000 (23:41 +0800)]
ext4: bring the support of recursive removal of directory back.

8 years agoext4_extent: some comments cleanup in ext4_ext_correct_indexes.
ngkaho1234 [Fri, 15 Jan 2016 09:58:54 +0000 (09:58 +0000)]
ext4_extent: some comments cleanup in ext4_ext_correct_indexes.

8 years agoRemove simple extent implementation.
ngkaho1234 [Fri, 15 Jan 2016 04:33:56 +0000 (04:33 +0000)]
Remove simple extent implementation.

8 years agoNumorous changes. See below:
ngkaho1234 [Thu, 14 Jan 2016 12:02:43 +0000 (12:02 +0000)]
Numorous changes. See below:

  - ext4: ext4_trunc_inode now requires inode index instead of an
          existing inode_ref.
  - ext4: the support of removing directory recursively is temporarily
          dropped.
  - ext4: ext4_dir_rm temporarily relies on ext4_fs_truncate instead of
          ext4_trunc_inode to ensure directory inode not having 0
          length in case of power failure.

  - ext4_journal: connect transactions having reference to the same blocks
                  together.

8 years agoext4_trans: flush the buffer in the following case.
ngkaho1234 [Mon, 11 Jan 2016 11:58:44 +0000 (11:58 +0000)]
ext4_trans: flush the buffer in the following case.

When we are not running a transaction, but have enabled journalling,
we should flush the buffer when we free the corresponding block.

8 years agoext4_journal: fix mistreating an empty journal as a bad one.
ngkaho1234 [Mon, 11 Jan 2016 11:48:16 +0000 (11:48 +0000)]
ext4_journal: fix mistreating an empty journal as a bad one.

8 years agoext4_mkfs: fix mkfs function when journaling is enabled
gkostka [Sun, 10 Jan 2016 11:40:30 +0000 (12:40 +0100)]
ext4_mkfs: fix mkfs function when journaling is enabled

8 years agoext4: introduce ext4_trunc_inode to deal with ftruncate operation
gkostka [Sun, 10 Jan 2016 10:29:54 +0000 (11:29 +0100)]
ext4: introduce ext4_trunc_inode to deal with ftruncate operation

Truncate operations might consume a lot of blocks. New function
will split one big transacion into a numerous of smaller ones.
CONFIG_MAX_TRUNCATE_SIZE limits single inode truncate size.