From 607df509321e62279ffb2b267f003dae943bceb1 Mon Sep 17 00:00:00 2001 From: Etienne Brateau Date: Sun, 23 Jan 2022 05:17:02 +0100 Subject: move to ext2_fs.h a #define This makes all #define be grouped at the same place Message-Id: <20220123041715.19402-4-etienne.brateau@gmail.com> --- 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 b5a3539e..f05abb04 100644 --- a/ext2fs/ext2_fs.h +++ b/ext2fs/ext2_fs.h @@ -286,6 +286,7 @@ struct ext2_inode { #define i_uid_high osd2.hurd2.h_i_uid_high #define i_gid_high osd2.hurd2.h_i_gid_high #define i_author osd2.hurd2.h_i_author +#define i_mode_high osd2.hurd2.h_i_mode_high /* * File system states diff --git a/ext2fs/ext2fs.h b/ext2fs/ext2fs.h index bc60af7b..003e2753 100644 --- a/ext2fs/ext2fs.h +++ b/ext2fs/ext2fs.h @@ -33,8 +33,6 @@ #include #include -#define __hurd__ /* Enable some hurd-specific fields. */ - /* Types used by the ext2 header files. */ typedef u_int32_t __u32; typedef int32_t __s32; @@ -45,8 +43,6 @@ typedef int8_t __s8; #include "ext2_fs.h" -#define i_mode_high osd2.hurd2.h_i_mode_high /* missing from ext2_fs.h */ - /* If ext2_fs.h defined a debug routine, undef it and use our own. */ #undef ext2_debug @@ -62,8 +58,6 @@ extern int ext2_debug_flag; #define ext2_debug(f, a...) (void)0 #endif -#undef __hurd__ - /* Define this if memory objects should not be cached by the kernel. Normally, don't define it, but defining it causes a much greater rate of paging requests, which may be helpful in catching bugs. */ diff --git a/ext2fs/ialloc.c b/ext2fs/ialloc.c index b14ddeec..49122319 100644 --- a/ext2fs/ialloc.c +++ b/ext2fs/ialloc.c @@ -316,6 +316,7 @@ diskfs_alloc_node (struct node *dir, mode_t mode, struct node **node) st->st_blocks = 0; np->dn_set_ctime = 1; } + /* Zero out the block pointers in case there's some noise left on disk. */ for (block = 0; block < EXT2_N_BLOCKS; block++) if (diskfs_node_disknode (np)->info.i_data[block] != 0) @@ -323,11 +324,13 @@ diskfs_alloc_node (struct node *dir, mode_t mode, struct node **node) diskfs_node_disknode (np)->info.i_data[block] = 0; np->dn_set_ctime = 1; } + if (diskfs_node_disknode (np)->info_i_translator != 0) { diskfs_node_disknode (np)->info_i_translator = 0; np->dn_set_ctime = 1; } + st->st_mode &= ~S_IPTRANS; if (np->allocsize) { -- cgit v1.2.3