On Thu, 5 Nov 2009, Noah Watkins wrote:

> Sage
> 
> A large number of le32_to_cpu (and the like) are used throughout the kernel
> client when referencing packed structs that are used OTW. However, I'd argue
> conversion should be done in only two places: before being sent or received.
> This allows non-packed versions of structs to be used only on the local
> machine, and use optimized alignment determined by gcc. Additionally it
> de-clutters the code of all the conversion routines. The patch I attached (not
> ready for use) demonstrates this for struct ceph_file_layout by introducing
> struct __ceph_file_layout for OTW, and does conversion only before sending or
> receiving over the network.
> 
> Comments, suggestions?

With the caveat that the performance advantages here are pretty minimal 
(most users are little endian, struct is i think already aligned), this 
does clean things up a bit.

I wouldn't change the types ceph_fs.[ch], msgr.h, rados.h if you can... 
these are all OTW types and shared between kernel and user space.  Maybe 
make __ceph_file_layout the internal type.  Maybe lose the fl_ prefix to 
catch accidental misuse.

Are there other types you were looking at?  I think most others are in the 
decode/use once category anyway?

sage

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Ceph-devel mailing list
Ceph-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ceph-devel

Reply via email to