Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263427AbTKQJub (ORCPT ); Mon, 17 Nov 2003 04:50:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263439AbTKQJub (ORCPT ); Mon, 17 Nov 2003 04:50:31 -0500 Received: from holomorphy.com ([199.26.172.102]:24483 "EHLO holomorphy") by vger.kernel.org with ESMTP id S263427AbTKQJu3 (ORCPT ); Mon, 17 Nov 2003 04:50:29 -0500 Date: Mon, 17 Nov 2003 01:50:24 -0800 From: William Lee Irwin III To: Tigran Aivazian Cc: viro@parcelfarce.linux.theplanet.co.uk, linux-kernel@vger.kernel.org Subject: Re: seq_file and exporting dynamically allocated data Message-ID: <20031117095024.GD22764@holomorphy.com> Mail-Followup-To: William Lee Irwin III , Tigran Aivazian , viro@parcelfarce.linux.theplanet.co.uk, linux-kernel@vger.kernel.org References: <20031117090339.GC22764@holomorphy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: The Domain of Holomorphy User-Agent: Mutt/1.5.4i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1098 Lines: 23 On Mon, Nov 17, 2003 at 09:42:09AM +0000, Tigran Aivazian wrote: > Here are two files: simple.c kernel module and user.c user test program. > If you (or anyone) believe it is possible to return more than a single > page on a read(2) please change them accordingly and let me know. Sorry, I needed to amend that. It's not a fixed PAGE_SIZE buffer; the buffer is only resized up to the point it allows a single ->show() call to succeed, and then you get short reads if you try to go beyond the buffer size in a single read. You could (in theory) get this to succeed > PAGE_SIZE reads by doing the operation all in a single ->show() call, but that will have some large overheads and will also have a retry loop where the buffer size is doubled until the ->show() call succeeds incurred at least once per open() at the time of the first read(). -- wli - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/