void byte_swap_inode_in(struct icommon *dc, struct icommon *ic) { register int i; ic->ic_mode = NXSwapBigShortToHost(dc->ic_mode); ic->ic_nlink = NXSwapBigShortToHost(dc->ic_nlink); // ic->ic_uid = NXSwapBigShortToHost(dc->ic_uid); // ic->ic_gid = NXSwapBigShortToHost(dc->ic_gid); ic->ic_size.val[0] = NXSwapBigLongToHost(dc->ic_size.val[1]); ic->ic_size.val[1] = NXSwapBigLongToHost(dc->ic_size.val[0]); // ic->ic_atime = NXSwapBigLongToHost(dc->ic_atime); // ic->ic_mtime = NXSwapBigLongToHost(dc->ic_mtime); // ic->ic_ctime = NXSwapBigLongToHost(dc->ic_ctime); // ic->ic_atspare = NXSwapBigLongToHost(dc->ic_atspare); // ic->ic_mtspare = NXSwapBigLongToHost(dc->ic_mtspare); // ic->ic_ctspare = NXSwapBigLongToHost(dc->ic_ctspare); ic->ic_flags = NXSwapBigLongToHost(dc->ic_flags); if ((ic->ic_flags & IC_FASTLINK) == 0) { /* not a fast symlink */ for (i=0; i < NDADDR; i++) /* direct blocks */ ic->ic_db[i] = NXSwapBigLongToHost(dc->ic_db[i]); for (i=0; i < NIADDR; i++) /* indirect blocks */ ic->ic_ib[i] = NXSwapBigLongToHost(dc->ic_ib[i]); } else bcopy(dc->ic_symlink, ic->ic_symlink, sizeof(dc->ic_symlink)); ic->ic_blocks = NXSwapBigLongToHost(dc->ic_blocks); ic->ic_gen = NXSwapBigLongToHost(dc->ic_gen); for (i=0; i < sizeof(ic->ic_spare) / sizeof(int); i++) ic->ic_spare[i] = NXSwapBigLongToHost(dc->ic_spare[i]); }
long ntohl(long x) { return NXSwapBigLongToHost(x); }