PERFORCE change 181396 for review
Benjamin Fiedler
bfiedler at FreeBSD.org
Fri Jul 23 22:25:24 UTC 2010
http://p4web.freebsd.org/@@181396?ac=10
Change 181396 by bfiedler at freebsd-7803 on 2010/07/23 22:25:15
IFC + makefile changes
Affected files ...
.. //depot/projects/soc2010/bsdtextproc/src/sys/amd64/linux32/linux32_machdep.c#2 integrate
.. //depot/projects/soc2010/bsdtextproc/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c#2 integrate
.. //depot/projects/soc2010/bsdtextproc/src/sys/compat/freebsd32/freebsd32_misc.c#2 integrate
.. //depot/projects/soc2010/bsdtextproc/src/sys/dev/e1000/if_igb.c#2 integrate
.. //depot/projects/soc2010/bsdtextproc/src/sys/kern/kern_exec.c#2 integrate
.. //depot/projects/soc2010/bsdtextproc/src/sys/sys/imgact.h#2 integrate
.. //depot/projects/soc2010/bsdtextproc/src/usr.bin/Makefile#4 edit
.. //depot/projects/soc2010/bsdtextproc/src/usr.bin/grep/grep.1#2 integrate
.. //depot/projects/soc2010/bsdtextproc/src/usr.bin/grep/grep.c#2 integrate
.. //depot/projects/soc2010/bsdtextproc/src/usr.bin/grep/nls/Makefile.inc#2 integrate
.. //depot/projects/soc2010/bsdtextproc/src/usr.bin/grep/nls/ru_RU.KOI8-R.msg#1 branch
.. //depot/projects/soc2010/bsdtextproc/src/usr.bin/grep/util.c#2 integrate
Differences ...
==== //depot/projects/soc2010/bsdtextproc/src/sys/amd64/linux32/linux32_machdep.c#2 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.55 2010/06/10 17:59:47 kan Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/linux32/linux32_machdep.c,v 1.56 2010/07/23 18:58:27 alc Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -200,9 +200,7 @@
return (0);
err_exit:
- kmem_free_wakeup(exec_map, (vm_offset_t)args->buf,
- PATH_MAX + ARG_MAX + MAXSHELLCMDLEN);
- args->buf = NULL;
+ exec_free_args(args);
return (error);
}
==== //depot/projects/soc2010/bsdtextproc/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c#2 (text+ko) ====
@@ -3653,7 +3653,8 @@
arc_memory_throttle(uint64_t reserve, uint64_t inflight_data, uint64_t txg)
{
#ifdef _KERNEL
- uint64_t available_memory = ptoa((uintmax_t)cnt.v_free_count);
+ uint64_t available_memory = ptoa((uintmax_t)cnt.v_free_count
+ + cnt.v_cache_count);
static uint64_t page_load = 0;
static uint64_t last_txg = 0;
==== //depot/projects/soc2010/bsdtextproc/src/sys/compat/freebsd32/freebsd32_misc.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.106 2010/07/04 11:43:53 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/freebsd32/freebsd32_misc.c,v 1.107 2010/07/23 18:58:27 alc Exp $");
#include "opt_compat.h"
#include "opt_inet.h"
@@ -355,9 +355,7 @@
return (0);
err_exit:
- kmem_free_wakeup(exec_map, (vm_offset_t)args->buf,
- PATH_MAX + ARG_MAX + MAXSHELLCMDLEN);
- args->buf = NULL;
+ exec_free_args(args);
return (error);
}
==== //depot/projects/soc2010/bsdtextproc/src/sys/dev/e1000/if_igb.c#2 (text+ko) ====
@@ -30,7 +30,7 @@
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
-/*$FreeBSD: src/sys/dev/e1000/if_igb.c,v 1.51 2010/07/09 17:11:29 jfv Exp $*/
+/*$FreeBSD: src/sys/dev/e1000/if_igb.c,v 1.52 2010/07/23 17:53:39 gnn Exp $*/
#ifdef HAVE_KERNEL_OPTION_HEADERS
@@ -4927,6 +4927,74 @@
}
+/** igb_sysctl_tdh_handler - Handler function
+ * Retrieves the TDH value from the hardware
+ */
+static int igb_sysctl_tdh_handler(SYSCTL_HANDLER_ARGS)
+{
+ int error;
+
+ struct tx_ring *txr = ((struct tx_ring *)oidp->oid_arg1);
+ if (!txr) return 0;
+
+ unsigned val = E1000_READ_REG(&txr->adapter->hw, E1000_TDH(txr->me));
+ error = sysctl_handle_int(oidp, &val, 0, req);
+ if (error || !req->newptr)
+ return error;
+ return 0;
+}
+
+/** igb_sysctl_tdt_handler - Handler function
+ * Retrieves the TDT value from the hardware
+ */
+static int igb_sysctl_tdt_handler(SYSCTL_HANDLER_ARGS)
+{
+ int error;
+
+ struct tx_ring *txr = ((struct tx_ring *)oidp->oid_arg1);
+ if (!txr) return 0;
+
+ unsigned val = E1000_READ_REG(&txr->adapter->hw, E1000_TDT(txr->me));
+ error = sysctl_handle_int(oidp, &val, 0, req);
+ if (error || !req->newptr)
+ return error;
+ return 0;
+}
+
+/** igb_sysctl_rdh_handler - Handler function
+ * Retrieves the RDH value from the hardware
+ */
+static int igb_sysctl_rdh_handler(SYSCTL_HANDLER_ARGS)
+{
+ int error;
+
+ struct rx_ring *rxr = ((struct rx_ring *)oidp->oid_arg1);
+ if (!rxr) return 0;
+
+ unsigned val = E1000_READ_REG(&rxr->adapter->hw, E1000_RDH(rxr->me));
+ error = sysctl_handle_int(oidp, &val, 0, req);
+ if (error || !req->newptr)
+ return error;
+ return 0;
+}
+
+/** igb_sysctl_rdt_handler - Handler function
+ * Retrieves the RDT value from the hardware
+ */
+static int igb_sysctl_rdt_handler(SYSCTL_HANDLER_ARGS)
+{
+ int error;
+
+ struct rx_ring *rxr = ((struct rx_ring *)oidp->oid_arg1);
+ if (!rxr) return 0;
+
+ unsigned val = E1000_READ_REG(&rxr->adapter->hw, E1000_RDT(rxr->me));
+ error = sysctl_handle_int(oidp, &val, 0, req);
+ if (error || !req->newptr)
+ return error;
+ return 0;
+}
+
/*
* Add sysctl variables, one per statistic, to the system.
*/
@@ -4992,12 +5060,14 @@
CTLFLAG_RD, NULL, "Queue Name");
queue_list = SYSCTL_CHILDREN(queue_node);
- SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "txd_head",
- CTLFLAG_RD, &txr->tdh, 0,
- "Transmit Descriptor Head");
- SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "txd_tail",
- CTLFLAG_RD, &txr->tdt, 0,
- "Transmit Descriptor Tail");
+ SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head",
+ CTLFLAG_RD, txr, sizeof(txr),
+ igb_sysctl_tdh_handler, "IU",
+ "Transmit Descriptor Head");
+ SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_tail",
+ CTLFLAG_RD, txr, sizeof(txr),
+ igb_sysctl_tdt_handler, "IU",
+ "Transmit Descriptor Tail");
SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "no_desc_avail",
CTLFLAG_RD, &txr->no_desc_avail,
"Queue No Descriptor Available");
@@ -5019,11 +5089,13 @@
CTLFLAG_RD, NULL, "Queue Name");
queue_list = SYSCTL_CHILDREN(queue_node);
- SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "rxd_head",
- CTLFLAG_RD, &rxr->rdh, 0,
+ SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_head",
+ CTLFLAG_RD, rxr, sizeof(rxr),
+ igb_sysctl_rdh_handler, "IU",
"Receive Descriptor Head");
- SYSCTL_ADD_UINT(ctx, queue_list, OID_AUTO, "rxd_tail",
- CTLFLAG_RD, &rxr->rdt, 0,
+ SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "rxd_tail",
+ CTLFLAG_RD, rxr, sizeof(rxr),
+ igb_sysctl_rdt_handler, "IU",
"Receive Descriptor Tail");
SYSCTL_ADD_QUAD(ctx, queue_list, OID_AUTO, "rx_packets",
CTLFLAG_RD, &rxr->rx_packets,
==== //depot/projects/soc2010/bsdtextproc/src/sys/kern/kern_exec.c#2 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_exec.c,v 1.351 2010/07/09 13:59:53 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_exec.c,v 1.352 2010/07/23 18:58:27 alc Exp $");
#include "opt_hwpmc_hooks.h"
#include "opt_kdtrace.h"
@@ -105,7 +105,6 @@
static int sysctl_kern_stackprot(SYSCTL_HANDLER_ARGS);
static int do_execve(struct thread *td, struct image_args *args,
struct mac *mac_p);
-static void exec_free_args(struct image_args *);
/* XXX This should be vm_size_t. */
SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD,
@@ -1155,11 +1154,11 @@
return (error);
}
-static void
+void
exec_free_args(struct image_args *args)
{
- if (args->buf) {
+ if (args->buf != NULL) {
kmem_free_wakeup(exec_map, (vm_offset_t)args->buf,
PATH_MAX + ARG_MAX + MAXSHELLCMDLEN);
args->buf = NULL;
==== //depot/projects/soc2010/bsdtextproc/src/sys/sys/imgact.h#2 (text+ko) ====
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/sys/imgact.h,v 1.46 2010/03/25 14:31:26 nwhitehorn Exp $
+ * $FreeBSD: src/sys/sys/imgact.h,v 1.47 2010/07/23 18:58:27 alc Exp $
*/
#ifndef _SYS_IMGACT_H_
@@ -80,6 +80,7 @@
int exec_check_permissions(struct image_params *);
register_t *exec_copyout_strings(struct image_params *);
+void exec_free_args(struct image_args *);
int exec_new_vmspace(struct image_params *, struct sysentvec *);
void exec_setregs(struct thread *, struct image_params *, u_long);
int exec_shell_imgact(struct image_params *);
==== //depot/projects/soc2010/bsdtextproc/src/usr.bin/Makefile#4 (text+ko) ====
@@ -122,7 +122,6 @@
${_mail} \
${_make} \
${_makewhatis} \
- mdocml \
mesg \
minigzip \
ministat \
@@ -244,6 +243,10 @@
${_ypmatch} \
${_ypwhich}
+.if defined(WITH_MANDOC)
+SUBDIR+= mdocml
+.endif
+
.if ${MACHINE_ARCH} != "arm"
_truss= truss
.endif
==== //depot/projects/soc2010/bsdtextproc/src/usr.bin/grep/grep.1#2 (text+ko) ====
@@ -1,4 +1,4 @@
-.\" $FreeBSD: src/usr.bin/grep/grep.1,v 1.1 2010/07/22 19:11:57 gabor Exp $
+.\" $FreeBSD: src/usr.bin/grep/grep.1,v 1.2 2010/07/23 17:42:42 gabor Exp $
.\" $OpenBSD: grep.1,v 1.38 2010/04/05 06:30:59 jmc Exp $
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)grep.1 8.3 (Berkeley) 4/18/94
.\"
-.Dd 19 September, 2009
+.Dd September 19, 2009
.Dt GREP 1
.Os
.Sh NAME
@@ -374,7 +374,7 @@
.Pp
.El
If no file arguments are specified, the standard input is used.
-.Sh RETURN VALUES
+.Sh EXIT STATUS
The
.Nm grep
utility exits with one of the following values:
==== //depot/projects/soc2010/bsdtextproc/src/usr.bin/grep/grep.c#2 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/grep/grep.c,v 1.1 2010/07/22 19:11:57 gabor Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/grep/grep.c,v 1.2 2010/07/23 19:36:11 delphij Exp $");
#include <sys/stat.h>
#include <sys/types.h>
@@ -351,8 +351,8 @@
}
eargv[++eargc] = NULL;
- aargv = (char **)grep_malloc(sizeof(char *) *
- (eargc + argc + 1));
+ aargv = (char **)grep_calloc(eargc + argc + 1,
+ sizeof(char *));
aargv[0] = argv[0];
for(i = 1; i < eargc; i++)
==== //depot/projects/soc2010/bsdtextproc/src/usr.bin/grep/nls/Makefile.inc#2 (text+ko) ====
@@ -1,12 +1,13 @@
-# $FreeBSD: src/usr.bin/grep/nls/Makefile.inc,v 1.1 2010/07/22 19:11:57 gabor Exp $
-NLSNAME= grep
+# $FreeBSD: src/usr.bin/grep/nls/Makefile.inc,v 1.2 2010/07/23 17:42:42 gabor Exp $
+NLSNAME= grep
NLS= es_ES.ISO8859-1
NLS+= gl_ES.ISO8859-1
NLS+= hu_HU.ISO8859-2
NLS+= pt_BR.ISO8859-1
+NLS+= ru_RU.KOI8-R
-NLSSRCDIR= ${.CURDIR}/nls
+NLSSRCDIR= ${.CURDIR}/nls
.for lang in ${NLS}
NLSSRCFILES_${lang}=${lang}.msg
.endfor
==== //depot/projects/soc2010/bsdtextproc/src/usr.bin/grep/util.c#2 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/usr.bin/grep/util.c,v 1.1 2010/07/22 19:11:57 gabor Exp $");
+__FBSDID("$FreeBSD: src/usr.bin/grep/util.c,v 1.2 2010/07/23 19:36:11 delphij Exp $");
#include <sys/stat.h>
#include <sys/types.h>
@@ -60,7 +60,7 @@
{
FTS *fts;
FTSENT *p;
- char *d, *dir;
+ char *d, *dir = NULL;
unsigned int i;
int c, fts_flags;
bool ok;
@@ -82,7 +82,7 @@
fts_flags |= FTS_NOSTAT | FTS_NOCHDIR;
if (!(fts = fts_open(argv, fts_flags, NULL)))
- err(2, NULL);
+ err(2, "fts_open");
while ((p = fts_read(fts)) != NULL) {
switch (p->fts_info) {
case FTS_DNR:
@@ -103,11 +103,12 @@
/* Check for file exclusion/inclusion */
ok = true;
if (exclflag) {
- d = strrchr(p->fts_path, '/');
- dir = grep_malloc(sizeof(char) *
- (d - p->fts_path + 2));
- strlcpy(dir, p->fts_path,
- (d - p->fts_path + 1));
+ if ((d = strrchr(p->fts_path, '/')) != NULL) {
+ dir = grep_malloc(sizeof(char) *
+ (d - p->fts_path + 2));
+ strlcpy(dir, p->fts_path,
+ (d - p->fts_path + 1));
+ }
for (i = 0; i < epatterns; ++i) {
switch(epattern[i].type) {
case FILE_PAT:
@@ -116,13 +117,14 @@
ok = epattern[i].mode != EXCL_PAT;
break;
case DIR_PAT:
- if (strstr(dir,
+ if (dir != NULL && strstr(dir,
epattern[i].pat) != NULL)
ok = epattern[i].mode != EXCL_PAT;
break;
}
}
- free(dir);
+ free(dir);
+ dir = NULL;
}
if (ok)
@@ -131,6 +133,7 @@
}
}
+ fts_close(fts);
return (c);
}
@@ -196,6 +199,7 @@
/* Return if we need to skip a binary file */
if (f->binary && binbehave == BINFILE_SKIP) {
grep_close(f);
+ free(ln.file);
free(f);
return (0);
}
@@ -230,6 +234,7 @@
binbehave == BINFILE_BIN && f->binary && !qflag)
printf(getstr(9), fn);
+ free(ln.file);
free(f);
return (c);
}
More information about the p4-projects
mailing list