From owner-svn-src-all@freebsd.org Wed Jul 20 22:51:34 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 695B3BA093D; Wed, 20 Jul 2016 22:51:34 +0000 (UTC) (envelope-from cem@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 22C8F1D44; Wed, 20 Jul 2016 22:51:34 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u6KMpXuK042961; Wed, 20 Jul 2016 22:51:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u6KMpX73042960; Wed, 20 Jul 2016 22:51:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201607202251.u6KMpX73042960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 20 Jul 2016 22:51:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r303120 - head/sys/kern X-SVN-Group: head 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: Wed, 20 Jul 2016 22:51:34 -0000 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