Re: Communicating FileSystem Structures b/w Two Machines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/10/06, UZAIR LAKHANI <uzairr_bs1b@xxxxxxxxx> wrote:
> In order for client and server to communicate, they
> have to exchange different structures like
> super-block, inode, dentry, vfsmount etc. We have to
> use 2.6.x kernels but since different versions of
> kernel will have differnt sizes for these structures,
> I am getting problems in communicating these
> structures b/w client and server. I therefore want a
> machine and kernel independent way for communicating
> these structures so as to handle the sizes problem.

1. Use types like le32 and u64 and so on so that all fields of the
structures you pass between machines have the same size everywhere.

2. Take care of endianness. (use macros like __cpu_to_le64 and the
like when reading/storing multibyte numbers).

3. Prevent the compiler from padding the structures by using the
__packed__ gcc directive.

I hope that's all.

Examples can be found e.g. in include/linux/eiserfs_fs.h (and many
other places).

HTH

Martin
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux