From: Theodore Ts'o Date: Tue, 12 Nov 2019 15:47:37 +0000 (-0500) Subject: Revert "e2fsck: Change kmem_cache_t to lkmem_cache_t for Solaris" X-Git-Tag: v1.46.0~88 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=2e95a371fa4242b4d1413cd6b6a902868455d74b;p=tools%2Fe2fsprogs.git Revert "e2fsck: Change kmem_cache_t to lkmem_cache_t for Solaris" This is a logical revert of commit 1911bf113ef0, for which the description reads: Solaris polutes the C namespace with kmem_cache_t when you include in/netinet.h is included, so rename kmem_cache_t to lkmem_cache_t. Reverting this change allows us to keep e2fsck/revoke.c in sync with its upstream kernel source of fs/jbd2/revoke.c, and was the last change required to make the e2fsprogs and kernel versions of revoke.c to be bit identical. I've confirmed that this is no longer a problem with OmniOS (an Illumos / Open Solaris derivative). It may be a problem with Solaris, but since I don't have easy access to Solaris, ¯\_(ツ)_/¯ Signed-off-by: Theodore Ts'o --- diff --git a/contrib/jbd2-resync.sh b/contrib/jbd2-resync.sh deleted file mode 100755 index f6b3887..0000000 --- a/contrib/jbd2-resync.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -if [ -z "$1" -o -z "$2" ]; then - echo "Usage: $0 kernel-file e2fsprogs-file" - exit 0 -fi - -# Transform a few things to fit the compatibility things defined in jfs_user.h. -exec sed -e 's/struct kmem_cache/lkmem_cache_t/g' \ - < "$1" > "$2" diff --git a/e2fsck/jfs_user.h b/e2fsck/jfs_user.h index 10baf75..a97fcc1 100644 --- a/e2fsck/jfs_user.h +++ b/e2fsck/jfs_user.h @@ -81,9 +81,9 @@ struct kdev_s { #define buffer_req(bh) 1 #define do_readahead(journal, start) do {} while (0) -typedef struct { +typedef struct kmem_cache { int object_length; -} lkmem_cache_t; +} kmem_cache_t; #define kmem_cache_alloc(cache, flags) malloc((cache)->object_length) #define kmem_cache_free(cache, obj) free(obj) @@ -113,8 +113,8 @@ static inline void *kmalloc_array(unsigned n, unsigned size, int flags) * functions. */ #ifdef NO_INLINE_FUNCS -extern lkmem_cache_t *do_cache_create(int len); -extern void do_cache_destroy(lkmem_cache_t *cache); +extern kmem_cache_t *do_cache_create(int len); +extern void do_cache_destroy(kmem_cache_t *cache); extern size_t journal_tag_bytes(journal_t *journal); extern __u32 __hash_32(__u32 val); extern __u32 hash_32(__u32 val, unsigned int bits); @@ -140,9 +140,9 @@ extern __u32 hash_64(__u64 val, unsigned int bits); #endif /* __STDC_VERSION__ >= 199901L */ #endif /* E2FSCK_INCLUDE_INLINE_FUNCS */ -_INLINE_ lkmem_cache_t *do_cache_create(int len) +_INLINE_ kmem_cache_t *do_cache_create(int len) { - lkmem_cache_t *new_cache; + kmem_cache_t *new_cache; new_cache = malloc(sizeof(*new_cache)); if (new_cache) @@ -150,7 +150,7 @@ _INLINE_ lkmem_cache_t *do_cache_create(int len) return new_cache; } -_INLINE_ void do_cache_destroy(lkmem_cache_t *cache) +_INLINE_ void do_cache_destroy(kmem_cache_t *cache) { free(cache); } diff --git a/e2fsck/revoke.c b/e2fsck/revoke.c index b8da99b..fa60878 100644 --- a/e2fsck/revoke.c +++ b/e2fsck/revoke.c @@ -92,8 +92,8 @@ #include #endif -static lkmem_cache_t *jbd2_revoke_record_cache; -static lkmem_cache_t *jbd2_revoke_table_cache; +static struct kmem_cache *jbd2_revoke_record_cache; +static struct kmem_cache *jbd2_revoke_table_cache; /* Each revoke record represents one single revoked block. During journal replay, this involves recording the transaction ID of the