Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Commit

Permalink
7586 remove #ifdef __lint hack from dmu.h
Browse files Browse the repository at this point in the history
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Pavel Zakharov <pavel.zakharov@delphix.com>

The #ifdef __lint in dmu.h is ugly, and it would be nice not to
duplicate it if we add other inline functions into header files in ZFS,
especially since it is difficult to make any other solution work across
all compilation targets. We should switch to disabling the lint flags
that are failing instead.

Closes #255
  • Loading branch information
dankimmel authored and ahrens committed Dec 2, 2016
1 parent f1c7da7 commit 9728822
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 15 deletions.
6 changes: 6 additions & 0 deletions usr/src/cmd/truss/Makefile.com
Expand Up @@ -20,6 +20,7 @@
#
#
# Copyright 2012 Nexenta Systems, Inc. All rights reserved.
# Copyright (c) 2016 by Delphix. All rights reserved.
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
Expand Down Expand Up @@ -47,6 +48,11 @@ LDLIBS += -lproc -lrtld_db -lc_db -lnsl -lsocket -ltsol -lnvpair
CPPFLAGS += -D_REENTRANT -D_LARGEFILE64_SOURCE=1
CPPFLAGS += -I$(SRC)/uts/common/fs/zfs

LINTFLAGS += -erroff=E_STATIC_UNUSED
LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
LINTFLAGS64 += -erroff=E_STATIC_UNUSED
LINTFLAGS64 += -erroff=E_NAME_USED_NOT_DEF2

.KEEP_STATE:

%.o: ../%.c
Expand Down
5 changes: 4 additions & 1 deletion usr/src/cmd/zhack/Makefile.com
Expand Up @@ -25,7 +25,7 @@
#

#
# Copyright (c) 2012 by Delphix. All rights reserved.
# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
#

PROG= zhack
Expand All @@ -48,6 +48,9 @@ CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT -DDEBUG $(INCS)

LINTFLAGS += -erroff=E_STATIC_UNUSED
LINTFLAGS64 += -erroff=E_STATIC_UNUSED

.KEEP_STATE:

all: $(PROG)
Expand Down
5 changes: 5 additions & 0 deletions usr/src/cmd/zinject/Makefile.com
Expand Up @@ -22,6 +22,8 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Copyright (c) 2016 by Delphix. All rights reserved.
#

PROG:sh= cd ..; basename `pwd`
OBJS= $(PROG).o translate.o
Expand All @@ -42,6 +44,9 @@ CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS)
CERRWARN += -_gcc=-Wno-uninitialized
CERRWARN += -_gcc=-Wno-switch

LINTFLAGS += -erroff=E_STATIC_UNUSED
LINTFLAGS64 += -erroff=E_STATIC_UNUSED

.KEEP_STATE:

all: $(PROG)
Expand Down
5 changes: 4 additions & 1 deletion usr/src/lib/brand/solaris10/s10_brand/Makefile.com
Expand Up @@ -20,6 +20,7 @@
#
#
# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016 by Delphix. All rights reserved.
#

LIBRARY = s10_brand.a
Expand Down Expand Up @@ -52,7 +53,7 @@ SRCS = $(CSRCS)
# normally stable, there are examples, such as with the solaris8 brand, where
# we could not combine the brand's libc with the native linker. Since we want
# to run in a known configuration, we use the S10 libc/linker combination.
#
#
# There is one more non-obvious side effect of using the s10 linker that
# should be mentioned. Since the linker is used to setup processes before
# libc is loaded, it makes system calls directly (ie avoiding libc), and
Expand Down Expand Up @@ -82,6 +83,8 @@ C99LMODE= -Xc99=%all
DYNFLAGS += $(DYNFLAGS_$(CLASS))
DYNFLAGS += $(BLOCAL) $(ZNOVERSION) -Wl,-e_start
LDLIBS += -lc -lmapmalloc
LINTFLAGS += -erroff=E_STATIC_UNUSED
LINTFLAGS64 += -erroff=E_STATIC_UNUSED

CERRWARN += -_gcc=-Wno-uninitialized

Expand Down
5 changes: 4 additions & 1 deletion usr/src/lib/libzfs/Makefile.com
Expand Up @@ -20,8 +20,8 @@
#
#
# Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2015 by Delphix. All rights reserved.
# Copyright 2016 Igor Kozhukhov <ikozhukhov@gmail.com>
# Copyright (c) 2011, 2016 by Delphix. All rights reserved.
#

LIBRARY= libzfs.a
Expand Down Expand Up @@ -76,6 +76,9 @@ CPPFLAGS += $(INCS) -D_LARGEFILE64_SOURCE=1 -D_REENTRANT
# There's no lint library for zlib, so only include this when building
$(DYNLIB) := LDLIBS += -lz

LINTFLAGS += -erroff=E_STATIC_UNUSED
LINTFLAGS64 += -erroff=E_STATIC_UNUSED

SRCS= $(OBJS_COMMON:%.o=$(SRCDIR)/%.c) \
$(OBJS_SHARED:%.o=$(SRC)/common/zfs/%.c)
$(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC)
Expand Down
8 changes: 1 addition & 7 deletions usr/src/uts/common/fs/zfs/sys/dmu.h
Expand Up @@ -565,12 +565,7 @@ typedef struct dmu_buf_user {
* NOTE: This function should only be called once on a given dmu_buf_user_t.
* To allow enforcement of this, dbu must already be zeroed on entry.
*/
#ifdef __lint
/* Very ugly, but it beats issuing suppression directives in many Makefiles. */
extern void
dmu_buf_init_user(dmu_buf_user_t *dbu, dmu_buf_evict_func_t *evict_func,
dmu_buf_evict_func_t *evict_func_async, dmu_buf_t **clear_on_evict_dbufp);
#else /* __lint */
/*ARGSUSED*/
inline void
dmu_buf_init_user(dmu_buf_user_t *dbu, dmu_buf_evict_func_t *evict_func_sync,
dmu_buf_evict_func_t *evict_func_async, dmu_buf_t **clear_on_evict_dbufp)
Expand All @@ -586,7 +581,6 @@ dmu_buf_init_user(dmu_buf_user_t *dbu, dmu_buf_evict_func_t *evict_func_sync,
dbu->dbu_clear_on_evict_dbufp = clear_on_evict_dbufp;
#endif
}
#endif /* __lint */

/*
* Attach user data to a dbuf and mark it for normal (when the dbuf's
Expand Down
5 changes: 2 additions & 3 deletions usr/src/uts/common/fs/zfs/sys/spa.h
Expand Up @@ -20,7 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014 by Delphix. All rights reserved.
* Copyright (c) 2011, 2016 by Delphix. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
* Copyright 2013 Saso Kiselkov. All rights reserved.
Expand All @@ -36,6 +36,7 @@
#include <sys/sysmacros.h>
#include <sys/types.h>
#include <sys/fs/zfs.h>
#include <sys/dmu.h>

#ifdef __cplusplus
extern "C" {
Expand Down Expand Up @@ -595,8 +596,6 @@ _NOTE(CONSTCOND) } while (0)
ASSERT(len < size); \
}

#include <sys/dmu.h>

#define BP_GET_BUFC_TYPE(bp) \
(((BP_GET_LEVEL(bp) > 0) || (DMU_OT_IS_METADATA(BP_GET_TYPE(bp)))) ? \
ARC_BUFC_METADATA : ARC_BUFC_DATA)
Expand Down
5 changes: 5 additions & 0 deletions usr/src/uts/intel/dev/Makefile
Expand Up @@ -23,6 +23,8 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Copyright (c) 2016 by Delphix. All rights reserved.
#
# This makefile drives the production of the dev file system
# kernel module.
#
Expand Down Expand Up @@ -63,6 +65,9 @@ LDFLAGS += -dy -Nfs/devfs -Nmisc/dls
INC_PATH += -I$(UTSBASE)/common/fs/zfs
INC_PATH += -I$(UTSBASE)/common/io/bpf

LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
LINTTAGS += -erroff=E_STATIC_UNUSED

CERRWARN += -_gcc=-Wno-parentheses
CERRWARN += -_gcc=-Wno-unused-label
CERRWARN += -_gcc=-Wno-uninitialized
Expand Down
4 changes: 3 additions & 1 deletion usr/src/uts/intel/stmf_sbd/Makefile
Expand Up @@ -20,8 +20,9 @@
#
#
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016 by Delphix. All rights reserved.
#
# This makefile drives the production of the stmf_sbd driver for
# This makefile drives the production of the stmf_sbd driver for
# COMSTAR.

#
Expand Down Expand Up @@ -68,6 +69,7 @@ C99LMODE= -Xc99=%all
# to investigate and remove these for maximum lint coverage.
#
LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
LINTTAGS += -erroff=E_STATIC_UNUSED

CERRWARN += -_gcc=-Wno-switch
CERRWARN += -_gcc=-Wno-parentheses
Expand Down
5 changes: 5 additions & 0 deletions usr/src/uts/sparc/dev/Makefile
Expand Up @@ -21,6 +21,8 @@
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# Copyright (c) 2016 by Delphix. All rights reserved.
#
# uts/sparc/dev/Makefile
# This makefile drives the production of the /dev file system
# kernel module.
Expand Down Expand Up @@ -64,6 +66,9 @@ LDFLAGS += -dy -Nfs/devfs -Nmisc/dls
INC_PATH += -I$(UTSBASE)/common/fs/zfs
INC_PATH += -I$(UTSBASE)/common/io/bpf

LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
LINTTAGS += -erroff=E_STATIC_UNUSED

CERRWARN += -_gcc=-Wno-parentheses
CERRWARN += -_gcc=-Wno-unused-label
CERRWARN += -_gcc=-Wno-uninitialized
Expand Down
4 changes: 3 additions & 1 deletion usr/src/uts/sparc/stmf_sbd/Makefile
Expand Up @@ -20,8 +20,9 @@
#
#
# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016 by Delphix. All rights reserved.
#
# This makefile drives the production of the stmf_sbd driver for
# This makefile drives the production of the stmf_sbd driver for
# COMSTAR.

#
Expand Down Expand Up @@ -68,6 +69,7 @@ C99LMODE= -Xc99=%all
# to investigate and remove these for maximum lint coverage.
#
LINTTAGS += -erroff=E_BAD_PTR_CAST_ALIGN
LINTTAGS += -erroff=E_STATIC_UNUSED

CERRWARN += -_gcc=-Wno-switch
CERRWARN += -_gcc=-Wno-parentheses
Expand Down

0 comments on commit 9728822

Please sign in to comment.