Whamcloud - gitweb
Revert "e2fsck: Change kmem_cache_t to lkmem_cache_t for Solaris"
authorTheodore Ts'o <tytso@mit.edu>
Tue, 12 Nov 2019 15:47:37 +0000 (10:47 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 13 Nov 2019 18:33:44 +0000 (13:33 -0500)
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 <tytso@mit.edu>
contrib/jbd2-resync.sh [deleted file]
e2fsck/jfs_user.h
e2fsck/revoke.c

diff --git a/contrib/jbd2-resync.sh b/contrib/jbd2-resync.sh
deleted file mode 100755 (executable)
index f6b3887..0000000
+++ /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"
index 10baf75..a97fcc1 100644 (file)
@@ -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);
 }
index b8da99b..fa60878 100644 (file)
@@ -92,8 +92,8 @@
 #include <linux/hash.h>
 #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