summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEtienne Brateau <etienne.brateau@gmail.com>2022-01-23 05:17:02 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-23 10:58:10 +0100
commit607df509321e62279ffb2b267f003dae943bceb1 (patch)
treeb9c19cfd24db119fc473cb7c300b5898cd020fa2
parent070e63450b23f8affce3345c54be35d64eb5bf30 (diff)
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>
-rw-r--r--ext2fs/ext2_fs.h1
-rw-r--r--ext2fs/ext2fs.h6
-rw-r--r--ext2fs/ialloc.c3
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 <pthread.h>
#include <sys/mman.h>
-#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)
{