[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/17] move to ext2_fs.h a #define
From: |
Etienne Brateau |
Subject: |
[PATCH 04/17] move to ext2_fs.h a #define |
Date: |
Sun, 23 Jan 2022 05:17:02 +0100 |
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/ext2fs/ext2_fs.h
@@ -268,6 +268,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 9f2b6907..f8e3ba45 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 */
-
#ifdef EXT2FS_DEBUG
#include <stdio.h>
@@ -59,8 +55,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)
{
--
2.34.1
- [PATCH 16/17] ext2fs: remove a commented block of code, (continued)
- [PATCH 16/17] ext2fs: remove a commented block of code, Etienne Brateau, 2022/01/22
- [PATCH 02/17] ext2fs: update ext2_fs.h header, Etienne Brateau, 2022/01/22
- [PATCH 13/17] ext2fs: remove a #define not_yet, Etienne Brateau, 2022/01/22
- [PATCH 12/17] ext2fs: detect and warn when filesystem is an ext3 fs, Etienne Brateau, 2022/01/22
- [PATCH 07/17] ext2fs: use macro to check flags, Etienne Brateau, 2022/01/22
- [PATCH 04/17] move to ext2_fs.h a #define,
Etienne Brateau <=
- [PATCH 09/17] ext2fs: set the f_namelen to the correct value, Etienne Brateau, 2022/01/22
- [PATCH 15/17] Change a EIO by a ENOSPC in case where not enough space, Etienne Brateau, 2022/01/22
- Re: [PATCH 01/17] ext2fs Merge 2 headers, Samuel Thibault, 2022/01/23