lkml.org 
[lkml]   [1999]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject[RFC] change of lookup() method.
	Folks, right now we have ->lookup() returning 0 in case of success
(in which case the argument gets hashed and becomes either positive or
negative) or a negative integer in case of error (too long name, etc.).
Proposed change: make it return a pointer to struct dentry.
Semantics:
NULL - old one would return 0.
ERR_PTR(-foo) - old one would return foo.
normal pointer - we got an alias dentry; act as if you've passed
it to ->lookup() and it returned 0.
(notice that it is binary compatible with the current variant, i.e. it
doesn't break existing modules).

More on the last case: it allows to reduce the cruft in VFAT *and* gives
us portalfs almost for free.

Impact on the existing filesystems: none for already compiled modules,
to ensure clean compile - trivial change of int foo_lookup(struct dentry
*dentry) to struct dentry *foo_lookup(struct dentry *dentry), along with
replacing return foo; with return ERR_PTR(foo); in said functions.

Comments?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.039 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site