From owner-cvs-src-old@FreeBSD.ORG Sun Feb 15 22:18:26 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F3F9106564A for ; Sun, 15 Feb 2009 22:18:26 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 5BBAC8FC1A for ; Sun, 15 Feb 2009 22:18:26 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n1FMIQhh060436 for ; Sun, 15 Feb 2009 22:18:26 GMT (envelope-from marcel@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n1FMIQQY060435 for cvs-src-old@freebsd.org; Sun, 15 Feb 2009 22:18:26 GMT (envelope-from marcel@repoman.freebsd.org) Message-Id: <200902152218.n1FMIQQY060435@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to marcel@repoman.freebsd.org using -f From: Marcel Moolenaar Date: Sun, 15 Feb 2009 22:18:16 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/geom/part g_part.c g_part.h g_part_if.m X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Feb 2009 22:18:26 -0000 marcel 2009-02-15 22:18:16 UTC FreeBSD src repository Modified files: sys/geom/part g_part.c g_part.h g_part_if.m Log: SVN rev 188659 on 2009-02-15 22:18:16Z by marcel Add method precheck to the g_part interface. The precheck method allows schemes to reject the ctl request, pre-check the parameters and/or modify/set parameters. There are 2 use cases that triggered the addition: 1. When implementing a R/O scheme, deletes will still happen to the in-memory representation. The scheme is not involved in that operation. The pre-check method can be used to fail the delete up-front. Without this the write to disk will typically fail, but at that time the delete already happened. 2. The EBR scheme uses a linked list to record slices. There's no index. The EBR scheme defines the index as a function of the start LBA of the partition. The add verb picks an index for the range and then invokes the add method of the scheme to fill in the blanks. It is too late for the add method to change the index. The pre-check is used to set the index up-front. This also (silently) overrides/nullifies any (pointless) user-specified index value. Revision Changes Path 1.31 +13 -20 src/sys/geom/part/g_part.c 1.13 +17 -0 src/sys/geom/part/g_part.h 1.5 +13 -0 src/sys/geom/part/g_part_if.m