Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Oct 2012 17:51:05 +0000 (UTC)
From:      Matthew D Fleming <mdf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r242152 - in head: lib/libmemstat sys/vm
Message-ID:  <201210261751.q9QHp5VL055596@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mdf
Date: Fri Oct 26 17:51:05 2012
New Revision: 242152
URL: http://svn.freebsd.org/changeset/base/242152

Log:
  Const-ify the zone name argument to uma_zcreate(9).
  
  MFC after:	3 days

Modified:
  head/lib/libmemstat/memstat_uma.c
  head/sys/vm/uma.h
  head/sys/vm/uma_core.c
  head/sys/vm/uma_int.h

Modified: head/lib/libmemstat/memstat_uma.c
==============================================================================
--- head/lib/libmemstat/memstat_uma.c	Fri Oct 26 17:31:35 2012	(r242151)
+++ head/lib/libmemstat/memstat_uma.c	Fri Oct 26 17:51:05 2012	(r242152)
@@ -254,7 +254,7 @@ kread(kvm_t *kvm, void *kvm_pointer, voi
 }
 
 static int
-kread_string(kvm_t *kvm, void *kvm_pointer, char *buffer, int buflen)
+kread_string(kvm_t *kvm, const void *kvm_pointer, char *buffer, int buflen)
 {
 	ssize_t ret;
 	int i;

Modified: head/sys/vm/uma.h
==============================================================================
--- head/sys/vm/uma.h	Fri Oct 26 17:31:35 2012	(r242151)
+++ head/sys/vm/uma.h	Fri Oct 26 17:51:05 2012	(r242152)
@@ -165,9 +165,9 @@ typedef void (*uma_fini)(void *mem, int 
  *	A pointer to a structure which is intended to be opaque to users of
  *	the interface.  The value may be null if the wait flag is not set.
  */
-uma_zone_t uma_zcreate(char *name, size_t size, uma_ctor ctor, uma_dtor dtor,
-			uma_init uminit, uma_fini fini, int align,
-			u_int32_t flags);
+uma_zone_t uma_zcreate(const char *name, size_t size, uma_ctor ctor,
+		    uma_dtor dtor, uma_init uminit, uma_fini fini,
+		    int align, u_int32_t flags);
 
 /*
  * Create a secondary uma zone

Modified: head/sys/vm/uma_core.c
==============================================================================
--- head/sys/vm/uma_core.c	Fri Oct 26 17:31:35 2012	(r242151)
+++ head/sys/vm/uma_core.c	Fri Oct 26 17:51:05 2012	(r242152)
@@ -158,7 +158,7 @@ static struct callout uma_callout;
  * a special allocation function just for zones.
  */
 struct uma_zctor_args {
-	char *name;
+	const char *name;
 	size_t size;
 	uma_ctor ctor;
 	uma_dtor dtor;
@@ -1828,7 +1828,7 @@ uma_set_align(int align)
 
 /* See uma.h */
 uma_zone_t
-uma_zcreate(char *name, size_t size, uma_ctor ctor, uma_dtor dtor,
+uma_zcreate(const char *name, size_t size, uma_ctor ctor, uma_dtor dtor,
 		uma_init uminit, uma_fini fini, int align, u_int32_t flags)
 
 {

Modified: head/sys/vm/uma_int.h
==============================================================================
--- head/sys/vm/uma_int.h	Fri Oct 26 17:31:35 2012	(r242151)
+++ head/sys/vm/uma_int.h	Fri Oct 26 17:51:05 2012	(r242152)
@@ -202,7 +202,7 @@ struct uma_keg {
 	struct mtx	uk_lock;	/* Lock for the keg */
 	struct uma_hash	uk_hash;
 
-	char		*uk_name;		/* Name of creating zone. */
+	const char	*uk_name;		/* Name of creating zone. */
 	LIST_HEAD(,uma_zone)	uk_zones;	/* Keg's zones */
 	LIST_HEAD(,uma_slab)	uk_part_slab;	/* partially allocated slabs */
 	LIST_HEAD(,uma_slab)	uk_free_slab;	/* empty slab list */
@@ -305,7 +305,7 @@ typedef struct uma_klink *uma_klink_t;
  *
  */
 struct uma_zone {
-	char		*uz_name;	/* Text name of the zone */
+	const char	*uz_name;	/* Text name of the zone */
 	struct mtx	*uz_lock;	/* Lock for the zone (keg's lock) */
 
 	LIST_ENTRY(uma_zone)	uz_link;	/* List of all zones in keg */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210261751.q9QHp5VL055596>