]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Allow c99 code to compile
authorMatthew Ahrens <mahrens@delphix.com>
Wed, 8 Feb 2017 17:27:48 +0000 (09:27 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 8 Feb 2017 17:27:48 +0000 (09:27 -0800)
Add the appropriate compiler flags to accept c99 code.  This will help to
minimize differences with upstream, and aid porting changes.  One change was
necessary in zvol.c because the DEFINE_IDA() macro does not work with the new
compiler flags.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Chunwei Chen <david.chen@osnexus.com>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Matthew Ahrens <mahrens@delphix.com>
Closes #5756

config/Rules.am
config/kernel.m4
module/zfs/dsl_dataset.c
module/zfs/zvol.c

index 20a21e972bcd3e270b760f9c0cc6259cf64c2c91..1d39e7779a7e5c26c4c762afc264b5cb7df1cba2 100644 (file)
@@ -5,6 +5,7 @@ AM_CFLAGS  = ${DEBUG_CFLAGS} -Wall -Wstrict-prototypes
 AM_CFLAGS += ${NO_UNUSED_BUT_SET_VARIABLE}
 AM_CFLAGS += ${NO_BOOL_COMPARE}
 AM_CFLAGS += -fno-strict-aliasing
+AM_CFLAGS += -std=gnu99
 AM_CPPFLAGS  = -D_GNU_SOURCE -D__EXTENSIONS__ -D_REENTRANT
 AM_CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_FILE_OFFSET_BITS=64
 AM_CPPFLAGS += -D_LARGEFILE64_SOURCE -DHAVE_LARGE_STACKS=1
index a441328378bab22bc54521f7bc0db26e62c28562..b8bd41e084d7a9cddfc9194a7dee0ffaf7d64616 100644 (file)
@@ -123,6 +123,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
 
        dnl # -Wall -fno-strict-aliasing -Wstrict-prototypes and other
        dnl # compiler options are added by the kernel build system.
+       KERNELCPPFLAGS="$KERNELCPPFLAGS -std=gnu99"
        KERNELCPPFLAGS="$KERNELCPPFLAGS -Wno-declaration-after-statement"
        KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_UNUSED_BUT_SET_VARIABLE"
        KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_BOOL_COMPARE"
index 0665c12fc0c244a5a66269acca5eed18b3aa15cf..2ea64a2bba144cf43ffcd08ffa809e3d4c5dd16c 100644 (file)
@@ -2956,7 +2956,6 @@ void
 dsl_dataset_clone_swap_sync_impl(dsl_dataset_t *clone,
     dsl_dataset_t *origin_head, dmu_tx_t *tx)
 {
-       spa_feature_t f;
        dsl_pool_t *dp = dmu_tx_pool(tx);
        int64_t unused_refres_delta;
        blkptr_t tmp;
@@ -2974,7 +2973,7 @@ dsl_dataset_clone_swap_sync_impl(dsl_dataset_t *clone,
        /*
         * Swap per-dataset feature flags.
         */
-       for (f = 0; f < SPA_FEATURES; f++) {
+       for (spa_feature_t f = 0; f < SPA_FEATURES; f++) {
                boolean_t clone_inuse;
                boolean_t origin_head_inuse;
 
index e5cd47afd8cb2fd1fe45bfce5c1b2af5714a2f06..abe77ecd4b34040a783024cc0cb9ceb3ca775d4b 100644 (file)
@@ -65,7 +65,8 @@ static list_t zvol_state_list;
 #define        ZVOL_HT_SIZE    1024
 static struct hlist_head *zvol_htable;
 #define        ZVOL_HT_HEAD(hash)      (&zvol_htable[(hash) & (ZVOL_HT_SIZE-1)])
-static DEFINE_IDA(zvol_ida);
+
+static struct ida zvol_ida;
 
 /*
  * The in-core state of each volume.
@@ -2161,6 +2162,7 @@ zvol_init(void)
        list_create(&zvol_state_list, sizeof (zvol_state_t),
            offsetof(zvol_state_t, zv_next));
        mutex_init(&zvol_state_lock, NULL, MUTEX_DEFAULT, NULL);
+       ida_init(&zvol_ida);
 
        zvol_htable = kmem_alloc(ZVOL_HT_SIZE * sizeof (struct hlist_head),
            KM_SLEEP);