From owner-svn-src-all@FreeBSD.ORG Sun Jun 15 09:37:07 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84BCD8E3; Sun, 15 Jun 2014 09:37:07 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::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 58421235C; Sun, 15 Jun 2014 09:37:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5F9b7KK035774; Sun, 15 Jun 2014 09:37:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5F9b7HQ035773; Sun, 15 Jun 2014 09:37:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201406150937.s5F9b7HQ035773@svn.freebsd.org> From: Alexander Motin Date: Sun, 15 Jun 2014 09:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267499 - head/sys/cam/ctl 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.18 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: Sun, 15 Jun 2014 09:37:07 -0000 Author: mav Date: Sun Jun 15 09:37:06 2014 New Revision: 267499 URL: http://svnweb.freebsd.org/changeset/base/267499 Log: Remove custom processing for "file" option. Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Sun Jun 15 08:43:52 2014 (r267498) +++ head/sys/cam/ctl/ctl_backend_block.c Sun Jun 15 09:37:06 2014 (r267499) @@ -1821,12 +1821,10 @@ ctl_be_block_create(struct ctl_be_block_ { struct ctl_be_block_lun *be_lun; struct ctl_lun_create_params *params; - struct ctl_be_arg *file_arg; char num_thread_str[16]; char tmpstr[32]; char *value; int retval, num_threads, unmap; - int i; int tmp_num_threads; params = &req->reqdata.create; @@ -1834,8 +1832,6 @@ ctl_be_block_create(struct ctl_be_block_ num_threads = cbb_num_threads; - file_arg = NULL; - be_lun = malloc(sizeof(*be_lun), M_CTLBLK, M_ZERO | M_WAITOK); be_lun->softc = softc; @@ -1861,24 +1857,13 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->ctl_be_lun.lun_type = T_DIRECT; if (be_lun->ctl_be_lun.lun_type == T_DIRECT) { - for (i = 0; i < req->num_be_args; i++) { - if (strcmp(req->kern_be_args[i].kname, "file") == 0) { - file_arg = &req->kern_be_args[i]; - break; - } - } - - if (file_arg == NULL) { + value = ctl_get_opt(&be_lun->ctl_be_lun, "file"); + if (value == NULL) { snprintf(req->error_str, sizeof(req->error_str), "%s: no file argument specified", __func__); goto bailout_error; } - - be_lun->dev_path = malloc(file_arg->vallen, M_CTLBLK, - M_WAITOK | M_ZERO); - - strlcpy(be_lun->dev_path, (char *)file_arg->kvalue, - file_arg->vallen); + be_lun->dev_path = strdup(value, M_CTLBLK); retval = ctl_be_block_open(softc, be_lun, req); if (retval != 0) { @@ -2516,25 +2501,6 @@ ctl_be_block_lun_info(void *be_lun, stru retval = sbuf_printf(sb, ""); - /* - * For processor devices, we don't have a path variable. - */ - if ((retval != 0) - || (lun->dev_path == NULL)) - goto bailout; - - retval = sbuf_printf(sb, ""); - - if (retval != 0) - goto bailout; - - retval = ctl_sbuf_printf_esc(sb, lun->dev_path); - - if (retval != 0) - goto bailout; - - retval = sbuf_printf(sb, "\n"); - bailout: return (retval);