On 2 May 2007, at 10:15, David Chinner wrote:
On Tue, May 01, 2007 at 07:46:53PM +0100, Anton Altaparmakov wrote:
And all applications will run against a multitude of
kernels. So version X of the application will run on kernel 2.4.*,
2.6.*, a.b.*, etc... For future expandability of the interface I
think it is important to have both compulsory and non-compulsory
Ah, so that's what you want - a mutable interface. i.e. versioning.
So how does compusory flags help here?
A concrete example:
Let's say that the FIEMAP interface goes live as is without any flags
at all and just defined bits for "these are optional and those are
Then the next kernel adds support for optional flag HSM_READ and
compulsory flag XATTR_READ.
FS that do not support XATTR_READ will return -ENOTSUP as they cannot
return the wanted data.
FS that do not support HSM_READ will still return the correct data in
majority of cases (except when the FS supports HSM and the data is
actually OFFLINE which the application will need to be able to cope
with anyway incase the FS failed to bring the file ONLINE even if it
supports the HSM_READ flag so no added complexity for handling this
What happens if a voluntary flag now becomes compulsory? Or vice
versa? How is the application supposed to deal with this dynamically?
Forgot to answer this bit: This cannot happen. There cannot be
flags that move from compulsory to non-compulsory or anything stupid
like that. It would have to be a totally new flag otherwise it
breaks backwards compatibility and hence this interface becomes
I suggested a version number for this right back at the start of
this discussion and got told that we don't want versioned interfaces
because we should make the effort to get it right the first time.
I don't think this can be called "getting it right".
So all applications end up doing:
if (version X, do blah)
else if (version Y, do blob)
else if (version Z, do foo)
else if (version A, do bar)
Every time a new version is added? And abort for unknown versions?
Now that is a great interface! Not.
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer, http://www.linux-ntfs.org/