]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/ufs/ffs/ffs_vfsops.c
xnu-792.21.3.tar.gz
[apple/xnu.git] / bsd / ufs / ffs / ffs_vfsops.c
index 18b090997f0c57a9b20b8a5afd14c56750bf207b..a9e787a49cd772258d6dca729827349d34dc4e62 100644 (file)
@@ -93,7 +93,7 @@
 #include <ufs/ffs/ffs_extern.h>
 #if REV_ENDIAN_FS
 #include <ufs/ufs/ufs_byte_order.h>
-#include <libkern/OSByteOrder.h>
+#include <architecture/byte_order.h>
 #endif /* REV_ENDIAN_FS */
 
 int ffs_sbupdate(struct ufsmount *, int);
@@ -542,6 +542,7 @@ ffs_mountfs(devvp, mp, context)
         /*
          * Buffer cache does not handle multiple pages in a buf when
 
+
        /*
         * Buffer cache does not handle multiple pages in a buf when
         * invalidating incore buffer in pageout. There are no locks 
@@ -983,7 +984,7 @@ ffs_vfs_getattr(mp, fsap, context)
                        length = ulp->ul_namelen;
 #if REV_ENDIAN_FS
                        if (mp->mnt_flag & MNT_REVEND)
-                               length = OSSwapInt16(length);
+                               length = NXSwapShort(length);
 #endif
                        if (length > 0 && length <= UFS_MAX_LABEL_NAME) {
                                bcopy(ulp->ul_name, fsap->f_vol_name, length);
@@ -1111,14 +1112,13 @@ ffs_vfs_setattr(mp, fsap, context)
 
                /* Copy new name over existing name */
                ulp->ul_namelen = strlen(fsap->f_vol_name);
-               bcopy(fsap->f_vol_name, ulp->ul_name, ulp->ul_namelen);
-               ulp->ul_name[UFS_MAX_LABEL_NAME - 1] = '\0';
-               ulp->ul_name[ulp->ul_namelen] = '\0';
-
 #if REV_ENDIAN_FS
                if (mp->mnt_flag & MNT_REVEND)
-                       ulp->ul_namelen = OSSwapInt16(ulp->ul_namelen);
+                       ulp->ul_namelen = NXSwapShort(ulp->ul_namelen);
 #endif
+               bcopy(fsap->f_vol_name, ulp->ul_name, ulp->ul_namelen);
+               ulp->ul_name[UFS_MAX_LABEL_NAME - 1] = '\0';
+               ulp->ul_name[ulp->ul_namelen] = '\0';
 
                /* Update the checksum */
                ulp->ul_checksum = 0;
@@ -1461,22 +1461,21 @@ ffs_fhtovp(mp, fhlen, fhp, vpp, context)
        struct vnode *nvp;
        struct fs *fs;
        int error;
-       ino_t     ino;
 
        if (fhlen < (int)sizeof(struct ufid))
                return (EINVAL);
        ufhp = (struct ufid *)fhp;
        fs = VFSTOUFS(mp)->um_fs;
-       ino = ntohl(ufhp->ufid_ino);
-       if (ino < ROOTINO || ino >= fs->fs_ncg * fs->fs_ipg)
+       if (ufhp->ufid_ino < ROOTINO ||
+           ufhp->ufid_ino >= fs->fs_ncg * fs->fs_ipg)
                return (ESTALE);
-       error = ffs_vget_internal(mp, ino, &nvp, NULL, NULL, 0, 1);
+       error = ffs_vget_internal(mp, ufhp->ufid_ino, &nvp, NULL, NULL, 0, 1);
        if (error) {
                *vpp = NULLVP;
                return (error);
        }
        ip = VTOI(nvp);
-       if (ip->i_mode == 0 || ip->i_gen != ntohl(ufhp->ufid_gen)) {
+       if (ip->i_mode == 0 || ip->i_gen != ufhp->ufid_gen) {
                vnode_put(nvp);
                *vpp = NULLVP;
                return (ESTALE);
@@ -1503,8 +1502,8 @@ ffs_vptofh(vp, fhlenp, fhp, context)
                return (EOVERFLOW);
        ip = VTOI(vp);
        ufhp = (struct ufid *)fhp;
-       ufhp->ufid_ino = htonl(ip->i_number);
-       ufhp->ufid_gen = htonl(ip->i_gen);
+       ufhp->ufid_ino = ip->i_number;
+       ufhp->ufid_gen = ip->i_gen;
        *fhlenp = sizeof(struct ufid);
        return (0);
 }
@@ -1630,7 +1629,7 @@ ffs_sbupdate(mp, waitfor)
        *  before writing
        */
        if (rev_endian) {
-               dfs->fs_maxfilesize = OSSwapInt64(mp->um_savedmaxfilesize);             /* XXX */
+               dfs->fs_maxfilesize = NXSwapLongLong(mp->um_savedmaxfilesize);          /* XXX */
        } else {
 #endif /* REV_ENDIAN_FS */
                dfs->fs_maxfilesize = mp->um_savedmaxfilesize;  /* XXX */