[PATCH 15/17] Change a EIO by a ENOSPC in case where not enough space

2022-01-22 Thread Etienne Brateau
Return a ENOSPC to notify that not enough space is here after the xattr entry instead of returning an EIO. --- ext2fs/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext2fs/xattr.c b/ext2fs/xattr.c index 45f7febe..7976eaa6 100644 --- a/ext2fs/xattr.c +++ b/ext2fs/xattr.

[PATCH 09/17] ext2fs: set the f_namelen to the correct value

2022-01-22 Thread Etienne Brateau
--- ext2fs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext2fs/inode.c b/ext2fs/inode.c index 47d05f47..511faf6e 100644 --- a/ext2fs/inode.c +++ b/ext2fs/inode.c @@ -541,7 +541,7 @@ diskfs_set_statfs (struct statfs *st) st->f_files = le32toh (sblock->s_inodes_coun

[PATCH 04/17] move to ext2_fs.h a #define

2022-01-22 Thread Etienne Brateau
This makes all #define be grouped at the same place --- ext2fs/ext2_fs.h | 1 + ext2fs/ext2fs.h | 6 -- ext2fs/ialloc.c | 3 +++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ext2fs/ext2_fs.h b/ext2fs/ext2_fs.h index d3701553..d838172a 100644 --- a/ext2fs/ext2_fs.h +++ b/ext

[PATCH 12/17] ext2fs: detect and warn when filesystem is an ext3 fs

2022-01-22 Thread Etienne Brateau
--- ext2fs/hyper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c index 9bff609f..ac18bbf1 100644 --- a/ext2fs/hyper.c +++ b/ext2fs/hyper.c @@ -134,6 +134,8 @@ get_hypermetadata (void) } if (le16toh (sblock->s_inode_size) != EXT2_GOOD_OLD_INOD

[PATCH 01/17] ext2fs Merge 2 headers

2022-01-22 Thread Etienne Brateau
* ext2_fs_i.h: merge it into ext2_fs.h. This is also done in the linux tree --- ext2fs/ext2_fs.h | 22 ++ ext2fs/ext2_fs_i.h | 41 - ext2fs/ext2fs.h| 1 - 3 files changed, 22 insertions(+), 42 deletions(-) delete mode 100644 ext

[PATCH 07/17] ext2fs: use macro to check flags

2022-01-22 Thread Etienne Brateau
* hyper.c: use macros to check flags --- ext2fs/hyper.c | 30 -- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c index 93fb7dbb..6fc95eaf 100644 --- a/ext2fs/hyper.c +++ b/ext2fs/hyper.c @@ -60,6 +60,7 @@ get_hypermetada

[PATCH 02/17] ext2fs: update ext2_fs.h header

2022-01-22 Thread Etienne Brateau
--- ext2fs/ext2_fs.h | 122 ++- ext2fs/ext2fs.h | 3 -- 2 files changed, 89 insertions(+), 36 deletions(-) diff --git a/ext2fs/ext2_fs.h b/ext2fs/ext2_fs.h index 90b1418d..d1a972b7 100644 --- a/ext2fs/ext2_fs.h +++ b/ext2fs/ext2_fs.h @@ -16,17 +16,10

[PATCH 13/17] ext2fs: remove a #define not_yet

2022-01-22 Thread Etienne Brateau
ext2fs will never support time precision better than second --- ext2fs/inode.c | 25 +++-- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/ext2fs/inode.c b/ext2fs/inode.c index 511faf6e..830b17a2 100644 --- a/ext2fs/inode.c +++ b/ext2fs/inode.c @@ -135,23 +135,14

[PATCH 16/17] ext2fs: remove a commented block of code

2022-01-22 Thread Etienne Brateau
--- ext2fs/ialloc.c | 34 -- 1 file changed, 8 insertions(+), 26 deletions(-) diff --git a/ext2fs/ialloc.c b/ext2fs/ialloc.c index 73778bee..568d7eae 100644 --- a/ext2fs/ialloc.c +++ b/ext2fs/ialloc.c @@ -133,36 +133,18 @@ repeat: { avefreei = le32toh (

[PATCH 17/17] ext2fs: remove 2 unused functions

2022-01-22 Thread Etienne Brateau
--- ext2fs/ialloc.c | 72 - 1 file changed, 72 deletions(-) diff --git a/ext2fs/ialloc.c b/ext2fs/ialloc.c index 568d7eae..e1a09a82 100644 --- a/ext2fs/ialloc.c +++ b/ext2fs/ialloc.c @@ -344,75 +344,3 @@ diskfs_alloc_node (struct node *dir, mode_t m

[PATCH 14/17] ext2fs: refactor add a method for dupplicated code

2022-01-22 Thread Etienne Brateau
* xattr: introduce xattr_header_valid method --- ext2fs/xattr.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ext2fs/xattr.c b/ext2fs/xattr.c index 0c855616..45f7febe 100644 --- a/ext2fs/xattr.c +++ b/ext2fs/xattr.c @@ -413,6 +413,16 @@ xattr_entry_r

[PATCH 08/17] ext2fs: Take cares of indiannes

2022-01-22 Thread Etienne Brateau
In ext2 data are stored in little endian to ensure portability. So enforce little endian when manipulating these bytes. --- ext2fs/balloc.c | 130 - ext2fs/dir.c | 61 ++--- ext2fs/ext2_fs.h | 36 ++--- ext2fs/ext2fs.h |

[PATCH 11/17] ext2fs: resolve a todo, check writability before writing

2022-01-22 Thread Etienne Brateau
--- ext2fs/hyper.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c index 65a2937e..9bff609f 100644 --- a/ext2fs/hyper.c +++ b/ext2fs/hyper.c @@ -199,6 +199,9 @@ diskfs_set_hypermetadata (int wait, int clean) if (sblock_dirty) { +

[PATCH 06/17] ext2fs: reindent files

2022-01-22 Thread Etienne Brateau
* balloc.c: reindent * bitmap.c: reindent * dir.c: reindent * ext2fs.c: reindent * getblk.c: reindent * hyper.c: reindent * ialloc.c: reindent * inode.c: reindent * msg.c: reindent * pager.c: reindent * pokel.c: reindent * truncate.c: reindent --- ext2fs/balloc.c| 264 +

[PATCH 10/17] ext2fs: set the writing time in the superblock

2022-01-22 Thread Etienne Brateau
--- ext2fs/hyper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ext2fs/hyper.c b/ext2fs/hyper.c index 1bb74e53..65a2937e 100644 --- a/ext2fs/hyper.c +++ b/ext2fs/hyper.c @@ -199,6 +199,8 @@ diskfs_set_hypermetadata (int wait, int clean) if (sblock_dirty) { + /* Before writing

[PATCH 03/17] ext2fs: remove __KERNEL__

2022-01-22 Thread Etienne Brateau
This makes the header more clear and btw it’s not anymore in the linux tree --- ext2fs/ext2_fs.h | 247 --- 1 file changed, 38 insertions(+), 209 deletions(-) diff --git a/ext2fs/ext2_fs.h b/ext2fs/ext2_fs.h index d1a972b7..d3701553 100644 --- a/ext2fs/

[PATCH 05/17] ext2fs: remove unneeded file

2022-01-22 Thread Etienne Brateau
--- ext2fs/sblock.words | 6 -- 1 file changed, 6 deletions(-) delete mode 100644 ext2fs/sblock.words diff --git a/ext2fs/sblock.words b/ext2fs/sblock.words deleted file mode 100644 index e17b8fa3.. --- a/ext2fs/sblock.words +++ /dev/null @@ -1,6 +0,0 @@ -inodes blocks