get_unused_fd()

Magnus Ahltorp map at stacken.kth.se
Wed Oct 21 01:27:50 CEST 1998


> > Does anyone have religious problems with this patch?
> 
> I'd like to know who and why needs it..

I sent a message to the list some weeks ago (included below) and since
no one has commented on that, I supposed that there were no
objections.

The thing is, it's very hard to do some serious file system modules
hacking without these functions. Since the Linux module system is
built the way it is, symbol names have to, as you know, be explicitly
exported.

This is all very good (since you get nice things like version
symbols), but it relies on the fact that someone puts the
EXPORT_SYMBOL lines in the kernel. Therefore, I am now proposing this
patch.

The particular purpose is an open split into two parts (the lookup
phase and the opening phase). Cookies are used to divide the process
between two syscalls. This is used in Arla, the free AFS client from
KTH.

Since the symbol has not been exported, development code must look
like this:

int (* get_unused_fd_p)(void) = 0xf0043c3c;

This is what I'm trying to avoid.

/Magnus
map at stacken.kth.se

---------------------------------------------------------------
From: Magnus Ahltorp <map at stacken.kth.se>
Subject: get_unused_fd & get_empty_filp
To: linux-kernel at vger.rutgers.edu
Date: 08 Oct 1998 21:56:28 +0200
X-From-Line: nobody Thu Oct  8 21:56:32 1998
Sender: map at yakko.stacken.kth.se
Message-ID: <lv1sogyakur.fsf at yakko.stacken.kth.se>
X-Mailer: Gnus v5.3/Emacs 19.34
Lines: 12
Xref: yakko.stacken.kth.se sent-mail:151
X-Gnus-Article-Number: 151   Thu Oct  8 21:56:32 1998

Would it be very bad if get_unused_fd() and get_empty_filp() were
exported, so that modules are able to allocate entries in the file
table?

This is absolutely necessary for "half way" open system calls, that
does the file name lookup in one part, and the actual opening in the
second part.

/Magnus
map at stacken.kth.se





More information about the Arla-drinkers mailing list