> I wonder if it wouldn't be better to make this change as part of a  
> larger change that moves towards an explicit iovec container struct  
> rather than bare 'struct iov *' and 'nr_segs' arguments.  The struct  
> could have a flag that expressed whether the elements had been  
> checked.  A helper could be called by the upper and lower code paths  
> which does the checking, marks the flag, and avoids checking again if  
> the flag is set.
> 
> We've wanted an explicit struct in the past to avoid the multiple  
> walks of iovecs that various paths do for their own reasons.  The  
> iovec walk that is checking for length wrapping could also be  
> building a bitmap of length alignment that O_DIRECT could be using to  
> test 512B alignment without having to walk the iovec again.

I suspect it should be rather trivial to get this started.  As a first
step we simply add a

struct iodesc {
        int nr_segs;
        struct iovec ioc[]
};

And then we can add fields where nessecary.  First a full_length one
to avoid the loops to calculate thw whole I/O size, then flags for
the alignment check, etc..  
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to