From owner-freebsd-current@FreeBSD.ORG Tue Jul 5 17:33:54 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3FADF16A41C for ; Tue, 5 Jul 2005 17:33:54 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 275E843D46 for ; Tue, 5 Jul 2005 17:33:54 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id j65HXreg008865; Tue, 5 Jul 2005 10:33:53 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id j65HXrb8008864; Tue, 5 Jul 2005 10:33:53 -0700 (PDT) (envelope-from rizzo) Date: Tue, 5 Jul 2005 10:33:53 -0700 From: Luigi Rizzo To: Poul-Henning Kamp Message-ID: <20050705103353.A8185@xorpc.icir.org> References: <20050705053114.A96381@xorpc.icir.org> <35386.1120575587@phk.freebsd.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <35386.1120575587@phk.freebsd.dk>; from phk@haven.freebsd.dk on Tue, Jul 05, 2005 at 04:59:47PM +0200 Cc: s223560@studenti.ing.unipi.it, current@freebsd.org Subject: Re: struct buf_queue_head still existing in 5.x/6.x ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jul 2005 17:33:54 -0000 On Tue, Jul 05, 2005 at 04:59:47PM +0200, Poul-Henning Kamp wrote: > In message <20050705053114.A96381@xorpc.icir.org>, Luigi Rizzo writes: > > >Can someone explain why in both 5.x and 6.x, we still have > >"struct buf_queue_head" defined in sys/buf.h ? > > Because things take time :-) ok thanks. Then i have a few hopefully easy questions. (background - this is related to the work my SoC student Emiliano, in Cc, is doing on the disk scheduler) The disk scheduler operates on struct bio_queue_head objects (which include CSCAN scheduler info) and uses 5 methods: bioq_init() initializes the queue. bioq_disksort() to add requests to the queue bioq_first() to peek at the head of the queue bioq_remove() to remove the first element. bioq_flush() right now simply a wrapper around bioq_first() and bioq_remove(), but one could imagine the need for a specific destructor to free memory etc. bioq_insert_head() and bioq_insert_tail() do operate on the same objects; however my impression is that they are used just because they need a TAILQ of struct bio, and bio_queue_head happened to be there - in a perfect world they would be methods of a different class, right ? cheers luigi