svn commit: r303120 - head/sys/kern

Conrad E. Meyer cem at FreeBSD.org
Wed Jul 20 22:51:34 UTC 2016


Author: cem
Date: Wed Jul 20 22:51:33 2016
New Revision: 303120
URL: https://svnweb.freebsd.org/changeset/base/303120

Log:
  imgact_elf: Rename the segment iterator to match reality
  
  The each_writable_segment routine evaluates segments on a slightly little more
  nuanced metric than simply "writable" or not.  Rename the function to more
  closely match its behavior (each_dumpable_segment).
  
  Suggested by:	jhb
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==============================================================================
--- head/sys/kern/imgact_elf.c	Wed Jul 20 22:49:33 2016	(r303119)
+++ head/sys/kern/imgact_elf.c	Wed Jul 20 22:51:33 2016	(r303120)
@@ -1163,7 +1163,7 @@ static void cb_put_phdr(vm_map_entry_t, 
 static void cb_size_segment(vm_map_entry_t, void *);
 static int core_write(struct coredump_params *, void *, size_t, off_t,
     enum uio_seg);
-static void each_writable_segment(struct thread *, segment_callback, void *);
+static void each_dumpable_segment(struct thread *, segment_callback, void *);
 static int __elfN(corehdr)(struct coredump_params *, int, void *, size_t,
     struct note_info_list *, size_t);
 static void __elfN(prepare_notes)(struct thread *, struct note_info_list *,
@@ -1317,7 +1317,7 @@ __elfN(coredump)(struct thread *td, stru
 	/* Size the program segments. */
 	seginfo.count = 0;
 	seginfo.size = 0;
-	each_writable_segment(td, cb_size_segment, &seginfo);
+	each_dumpable_segment(td, cb_size_segment, &seginfo);
 
 	/*
 	 * Collect info about the core file header area.
@@ -1419,7 +1419,7 @@ done:
 }
 
 /*
- * A callback for each_writable_segment() to write out the segment's
+ * A callback for each_dumpable_segment() to write out the segment's
  * program header entry.
  */
 static void
@@ -1445,7 +1445,7 @@ cb_put_phdr(entry, closure)
 }
 
 /*
- * A callback for each_writable_segment() to gather information about
+ * A callback for each_dumpable_segment() to gather information about
  * the number of segments and their total size.
  */
 static void
@@ -1463,7 +1463,7 @@ cb_size_segment(vm_map_entry_t entry, vo
  * caller-supplied data.
  */
 static void
-each_writable_segment(struct thread *td, segment_callback func, void *closure)
+each_dumpable_segment(struct thread *td, segment_callback func, void *closure)
 {
 	struct proc *p = td->td_proc;
 	vm_map_t map = &p->p_vmspace->vm_map;
@@ -1694,7 +1694,7 @@ __elfN(puthdr)(struct thread *td, void *
 	/* All the writable segments from the program. */
 	phc.phdr = phdr;
 	phc.offset = round_page(hdrsize + notesz);
-	each_writable_segment(td, cb_put_phdr, &phc);
+	each_dumpable_segment(td, cb_put_phdr, &phc);
 }
 
 static size_t


More information about the svn-src-head mailing list