Thread (45 messages) 45 messages, 9 authors, 2007-10-30

Re: [RFC] add FIEMAP ioctl to efficiently map file allocation

From: Anton Altaparmakov <hidden>
Date: 2007-05-02 09:45:55
Also in: linux-fsdevel, linux-xfs

On 2 May 2007, at 10:15, David Chinner wrote:
On Tue, May 01, 2007 at 07:46:53PM +0100, Anton Altaparmakov wrote:
quoted
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  
flags.
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  
compulsory".

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  
case).
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  
useless crap.
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)
else exit(1);

Every time a new version is added?  And abort for unknown versions?   
Now that is a great interface!  Not.

Best regards,

	Anton
-- 
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/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help