[336] in arla-drinkers
Re: get_unused_fd()
daemon@ATHENA.MIT.EDU (Alexander Viro)
Wed Oct 21 18:39:28 1998
From owner-arla-drinkers@stacken.kth.se Wed Oct 21 22:39:27 1998
Return-Path: <owner-arla-drinkers@stacken.kth.se>
Delivered-To: arla-drinkers-mtg@bloom-picayune.mit.edu
Received: (qmail 11402 invoked from network); 21 Oct 1998 22:39:27 -0000
Received: from unknown (HELO sundance.stacken.kth.se) (130.237.234.41)
by bloom-picayune.mit.edu with SMTP; 21 Oct 1998 22:39:27 -0000
Received: (from majordom@localhost)
by sundance.stacken.kth.se (8.8.8/8.8.8) id AAA15839
for arla-drinkers-list; Thu, 22 Oct 1998 00:34:38 +0200 (MET DST)
Received: from math.psu.edu (root@leibniz.math.psu.edu [146.186.130.2])
by sundance.stacken.kth.se (8.8.8/8.8.8) with ESMTP id AAA15831;
Thu, 22 Oct 1998 00:34:33 +0200 (MET DST)
Received: from albert.math.psu.edu (albert.math.psu.edu [146.186.130.220]) by math.psu.edu (8.8.5/8.7.3) with ESMTP id SAA05443; Wed, 21 Oct 1998 18:34:31 -0400 (EDT)
Received: from localhost (viro@localhost) by albert.math.psu.edu (8.8.8/8.6.9) with SMTP id CAA02350; Thu, 22 Oct 1998 02:34:15 -0400 (EDT)
Date: Thu, 22 Oct 1998 02:34:15 -0400 (EDT)
From: Alexander Viro <viro@math.psu.edu>
To: Magnus Ahltorp <map@stacken.kth.se>
cc: Linus Torvalds <torvalds@transmeta.com>, linux-kernel@vger.rutgers.edu,
arla-drinkers@stacken.kth.se
Subject: Re: get_unused_fd()
In-Reply-To: <lv14ssxap3l.fsf@sundance.stacken.kth.se>
Message-ID: <Pine.SOL.3.95.981022021110.2309A-100000@albert.math.psu.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-arla-drinkers@stacken.kth.se
Precedence: bulk
On 21 Oct 1998, Magnus Ahltorp wrote:
> > It would be nice if you'ld show how _exactly_ you are going to use
> > get_empty_filp(). There are several reasons to split inuse_filp into
> > several lists (for superblock; for tty; for protocol family). That would
> > simplify dquot.c and some nasty stuff in tty_io.c. Right now I'm
> > experimenting with such patch and if everything will go OK I'm going to
> > submit it to Linus in a day or two. We got waaay too many leaks/dangling
> > pointers/etc. in the code that deals with struct file's. I'm trying to go
> > through this stuff and massage it into something more coherent. And IMHO
> > get_empty_filp() belongs to guts of that stuff.
>
> First, do you have any objections against the export of the
> get_unused_fd() call?
Umm... Say it, I'ld like to see reasons for that and they'ld
better be very serious. Anyway, it's up to Linus to make any decisions on
that stuff. Exporting something makes it much more permanent. If symbol is
available only from the kernel - well, one has to consider kernel alone
when/if he'll want to change it. If it is exported... any change may break
3rd-party modules. Any additional exported symbol to == potential boat
anchor.
> Regarding the get_empty_filp(), I'm simply using it for allocating a
> struct file. The struct file gets filled in, and fd_install (this
> symbol is exported, wow) is then used to put things where they should
> be.
Wait a bit. If you have dentry and want to fit a struct file atop
of it - you don't need either get_unused_fd() or get_empty_filp(). There
is open_dentry() (fs/exec.c; exported). It looks like cleaner solution.
OTOH you didn't describe your problem, so...
HTH. HAND,
Al
--
"You're one of those condescending Unix computer users!"
"Here's a nickel, kid. Get yourself a better computer" - Dilbert.