From owner-svn-src-all@freebsd.org Sat May 7 08:26:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D2C9B31E81; Sat, 7 May 2016 08:26:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 039691059; Sat, 7 May 2016 08:26:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u478Q6dU019972; Sat, 7 May 2016 08:26:06 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u478Q5hN019966; Sat, 7 May 2016 08:26:05 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201605070826.u478Q5hN019966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 7 May 2016 08:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r299214 - in stable/9/sys: compat/svr4 dev/streams modules/streams modules/svr4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 08:26:07 -0000 Author: dchagin Date: Sat May 7 08:26:05 2016 New Revision: 299214 URL: https://svnweb.freebsd.org/changeset/base/299214 Log: MFC r298519: Fix streams and svr4 module dependency. Both modules are complaining about undefined symbol svr4_delete_socket which was moved from streams to the svr4 module in r160558 that created a two-way dependency between them. MFC r298520: Allow to build svr4 module with SYSV support separatelly from the kernel build. PR: 208464 Reported by: Kristoffer Eriksson Modified: stable/9/sys/compat/svr4/svr4_ipc.c stable/9/sys/compat/svr4/svr4_socket.c stable/9/sys/compat/svr4/svr4_sysvec.c stable/9/sys/dev/streams/streams.c stable/9/sys/modules/streams/Makefile stable/9/sys/modules/svr4/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/modules/svr4/ (props changed) Modified: stable/9/sys/compat/svr4/svr4_ipc.c ============================================================================== --- stable/9/sys/compat/svr4/svr4_ipc.c Sat May 7 03:41:29 2016 (r299213) +++ stable/9/sys/compat/svr4/svr4_ipc.c Sat May 7 08:26:05 2016 (r299214) @@ -86,14 +86,10 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM) static void svr4_to_bsd_ipc_perm(const struct svr4_ipc_perm *, struct ipc_perm *); static void bsd_to_svr4_ipc_perm(const struct ipc_perm *, struct svr4_ipc_perm *); -#endif - -#ifdef SYSVSEM static void bsd_to_svr4_semid_ds(const struct semid_ds *, struct svr4_semid_ds *); static void svr4_to_bsd_semid_ds(const struct svr4_semid_ds *, @@ -101,9 +97,6 @@ static void svr4_to_bsd_semid_ds(const s static int svr4_semop(struct thread *, void *); static int svr4_semget(struct thread *, void *); static int svr4_semctl(struct thread *, void *); -#endif - -#ifdef SYSVMSG static void bsd_to_svr4_msqid_ds(const struct msqid_ds *, struct svr4_msqid_ds *); static void svr4_to_bsd_msqid_ds(const struct svr4_msqid_ds *, @@ -112,9 +105,6 @@ static int svr4_msgsnd(struct thread *, static int svr4_msgrcv(struct thread *, void *); static int svr4_msgget(struct thread *, void *); static int svr4_msgctl(struct thread *, void *); -#endif - -#ifdef SYSVSHM static void bsd_to_svr4_shmid_ds(const struct shmid_ds *, struct svr4_shmid_ds *); static void svr4_to_bsd_shmid_ds(const struct svr4_shmid_ds *, @@ -123,9 +113,6 @@ static int svr4_shmat(struct thread *, v static int svr4_shmdt(struct thread *, void *); static int svr4_shmget(struct thread *, void *); static int svr4_shmctl(struct thread *, void *); -#endif - -#if defined(SYSVMSG) || defined(SYSVSHM) || defined(SYSVSEM) static void svr4_to_bsd_ipc_perm(spp, bpp) @@ -154,9 +141,7 @@ bsd_to_svr4_ipc_perm(bpp, spp) spp->mode = bpp->mode; spp->seq = bpp->seq; } -#endif -#ifdef SYSVSEM static void bsd_to_svr4_semid_ds(bds, sds) const struct semid_ds *bds; @@ -331,10 +316,7 @@ svr4_sys_semsys(td, uap) } } -MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1); -#endif -#ifdef SYSVMSG static void bsd_to_svr4_msqid_ds(bds, sds) const struct msqid_ds *bds; @@ -421,7 +403,7 @@ svr4_msgrcv(td, v) return sys_msgrcv(td, &ap); } - + struct svr4_sys_msgget_args { int what; svr4_key_t key; @@ -504,10 +486,6 @@ svr4_sys_msgsys(td, uap) } } -MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1); -#endif - -#ifdef SYSVSHM static void bsd_to_svr4_shmid_ds(bds, sds) @@ -657,7 +635,7 @@ svr4_shmctl(td, v) default: return (EINVAL); } - + error = kern_shmctl(td, uap->shmid, cmd, &bs, &bufsize); if (error) return (error); @@ -697,4 +675,5 @@ svr4_sys_shmsys(td, uap) } MODULE_DEPEND(svr4elf, sysvshm, 1, 1, 1); -#endif /* SYSVSHM */ +MODULE_DEPEND(svr4elf, sysvmsg, 1, 1, 1); +MODULE_DEPEND(svr4elf, sysvsem, 1, 1, 1); Modified: stable/9/sys/compat/svr4/svr4_socket.c ============================================================================== --- stable/9/sys/compat/svr4/svr4_socket.c Sat May 7 03:41:29 2016 (r299213) +++ stable/9/sys/compat/svr4/svr4_socket.c Sat May 7 08:26:05 2016 (r299214) @@ -66,6 +66,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include struct svr4_sockcache_entry { struct proc *p; /* Process for the socket */ @@ -168,6 +169,19 @@ svr4_delete_socket(p, fp) mtx_unlock(&svr4_sockcache_lock); } +struct svr4_strm * +svr4_stream_get(fp) + struct file *fp; +{ + struct socket *so; + + if (fp == NULL || fp->f_type != DTYPE_SOCKET) + return NULL; + + so = fp->f_data; + return so->so_emuldata; +} + void svr4_purge_sockcache(arg, p) void *arg; Modified: stable/9/sys/compat/svr4/svr4_sysvec.c ============================================================================== --- stable/9/sys/compat/svr4/svr4_sysvec.c Sat May 7 03:41:29 2016 (r299213) +++ stable/9/sys/compat/svr4/svr4_sysvec.c Sat May 7 08:26:05 2016 (r299214) @@ -311,4 +311,4 @@ static moduledata_t svr4_elf_mod = { 0 }; DECLARE_MODULE_TIED(svr4elf, svr4_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY); -MODULE_DEPEND(svr4elf, streams, 1, 1, 1); +MODULE_VERSION(svr4elf, 1); Modified: stable/9/sys/dev/streams/streams.c ============================================================================== --- stable/9/sys/dev/streams/streams.c Sat May 7 03:41:29 2016 (r299213) +++ stable/9/sys/dev/streams/streams.c Sat May 7 08:26:05 2016 (r299214) @@ -175,6 +175,7 @@ static moduledata_t streams_mod = { }; DECLARE_MODULE(streams, streams_mod, SI_SUB_DRIVERS, SI_ORDER_ANY); MODULE_VERSION(streams, 1); +MODULE_DEPEND(streams, svr4elf, 1, 1, 1); /* * We only need open() and close() routines. open() calls socreate() @@ -328,19 +329,6 @@ svr4_ptm_alloc(td) } -struct svr4_strm * -svr4_stream_get(fp) - struct file *fp; -{ - struct socket *so; - - if (fp == NULL || fp->f_type != DTYPE_SOCKET) - return NULL; - - so = fp->f_data; - return so->so_emuldata; -} - static int svr4_soo_close(struct file *fp, struct thread *td) { Modified: stable/9/sys/modules/streams/Makefile ============================================================================== --- stable/9/sys/modules/streams/Makefile Sat May 7 03:41:29 2016 (r299213) +++ stable/9/sys/modules/streams/Makefile Sat May 7 08:26:05 2016 (r299214) @@ -5,10 +5,6 @@ KMOD= streams SRCS= streams.c -EXPORT_SYMS= svr4_str_initialized \ - svr4_stream_get \ - svr4_delete_socket - .if defined(DEBUG) CFLAGS+= -DDEBUG_SVR4 .endif Modified: stable/9/sys/modules/svr4/Makefile ============================================================================== --- stable/9/sys/modules/svr4/Makefile Sat May 7 03:41:29 2016 (r299213) +++ stable/9/sys/modules/svr4/Makefile Sat May 7 08:26:05 2016 (r299214) @@ -8,6 +8,7 @@ SRCS= svr4_sysent.c svr4_sysvec.c opt_co svr4_termios.c svr4_stream.c svr4_socket.c svr4_sockio.c \ svr4_machdep.c svr4_resource.c svr4_ipc.c OBJS= svr4_locore.o +EXPORT_SYMS= svr4_delete_socket SRCS+= opt_ktrace.h opt_sysvipc.h