From owner-freebsd-arch@FreeBSD.ORG Thu Sep 9 17:46:03 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3177110656AB for ; Thu, 9 Sep 2010 17:46:03 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id D3FA98FC14 for ; Thu, 9 Sep 2010 17:46:02 +0000 (UTC) Received: by gyg4 with SMTP id 4so881611gyg.13 for ; Thu, 09 Sep 2010 10:46:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; bh=5e6wx0jWNcQWEVbqZLcn+/Cb9/S3FFRjVH6YU9ddxPI=; b=qwRW0oUMKH1Pco05QOxfDHw2/wvcHi557mfK7iF/pq1oR7Mkt76/z0FOe2gGMJkjs9 GMtTXgEktGvfyAtvudsRlPX8y+yeXewxJyuPCXDRubM7XkfxW949POT9g9GvqssQD34m BjRn2muzhjhvc6LHnva6FB9x2Lf8os6lcV4qU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=yAz8u5/HvFRANqzJHQjABebFKnVRlWEzZGjYNDtfFvgjcouSk9Gn91cb+KveEi+COG 2AcH8h+geLVYpynrP9WVs+40fLGaySudhLYHYtp7G4AFhTByEXG3bQZxXw6OVcw1qh8x NLObocR0dJ2iTQ6ZO8nCGL+leflX2qpAInIP0= MIME-Version: 1.0 Received: by 10.101.209.31 with SMTP id l31mr421260anq.191.1284054359828; Thu, 09 Sep 2010 10:45:59 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.100.126.20 with HTTP; Thu, 9 Sep 2010 10:45:59 -0700 (PDT) In-Reply-To: <85035.1284017219@critter.freebsd.dk> References: <85035.1284017219@critter.freebsd.dk> Date: Thu, 9 Sep 2010 10:45:59 -0700 X-Google-Sender-Auth: Xmszr27iC8BWHSVzzGF8cV8mUMU Message-ID: From: mdf@FreeBSD.org To: Poul-Henning Kamp Content-Type: text/plain; charset=ISO-8859-1 Cc: FreeBSD Arch Subject: Re: Extending sbufs with a drain, take 2 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2010 17:46:03 -0000 Thank you very much for your continued input. I have incorporated all these ideas and I am committing the patches as I update them and test them. On Thu, Sep 9, 2010 at 12:26 AM, Poul-Henning Kamp wrote: >>Replace sbuf_overflowed() with sbuf_error(), which returns any error >>code associated with overflow or with the drain function. >> >>http://people.freebsd.org/~mdf/0006-Replace-sbuf_overflowed-with-sbuf_error-which-return.patch > > Now that sbuf_finish() returns the error, most applications should > not need to sbuf_finish()/sbuf_error() at all. Right. There were 16 uses in the entire tree (all in the kernel). Several of these were in error; that is checking sbuf_overflowed() after an sbuf_finish(). These uses I fixed to check the return code from sbuf_finish(). I believe 5 were used to determine if the static buffer for sysctl was too small; these uses are removed in my patch. The remaining uses are to check that the data fits in the static sized buffer, e.g. MAXPATHLEN for audit, 1024 bytes for some ioctls, etc. Again, thanks for all your help. One question about the printf expanded args in xprintf.c: Does the extension framework allow for multiple character conversion specifiers? I.e. I see that you added a sample %V and %H and %T in the original version. Could this framework allow a %{} specifier or is it assumed that conversions are a single character (possibly with modifiers)? Thanks, matthew