Merge tag 'xfs-4.13-merge-5' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
[muen/linux.git] / fs / xfs / xfs_mount.c
index 1a98c35e1ccf5e626c0fe3f0c941118f483f1466..40d4e8b4e193b41a123903735736248568bf26b9 100644 (file)
@@ -74,20 +74,19 @@ xfs_uuid_mount(
        int                     hole, i;
 
        /* Publish UUID in struct super_block */
-       BUILD_BUG_ON(sizeof(mp->m_super->s_uuid) != sizeof(uuid_t));
-       memcpy(&mp->m_super->s_uuid, uuid, sizeof(uuid_t));
+       uuid_copy(&mp->m_super->s_uuid, uuid);
 
        if (mp->m_flags & XFS_MOUNT_NOUUID)
                return 0;
 
-       if (uuid_is_nil(uuid)) {
-               xfs_warn(mp, "Filesystem has nil UUID - can't mount");
+       if (uuid_is_null(uuid)) {
+               xfs_warn(mp, "Filesystem has null UUID - can't mount");
                return -EINVAL;
        }
 
        mutex_lock(&xfs_uuid_table_mutex);
        for (i = 0, hole = -1; i < xfs_uuid_table_size; i++) {
-               if (uuid_is_nil(&xfs_uuid_table[i])) {
+               if (uuid_is_null(&xfs_uuid_table[i])) {
                        hole = i;
                        continue;
                }
@@ -124,7 +123,7 @@ xfs_uuid_unmount(
 
        mutex_lock(&xfs_uuid_table_mutex);
        for (i = 0; i < xfs_uuid_table_size; i++) {
-               if (uuid_is_nil(&xfs_uuid_table[i]))
+               if (uuid_is_null(&xfs_uuid_table[i]))
                        continue;
                if (!uuid_equal(uuid, &xfs_uuid_table[i]))
                        continue;
@@ -796,7 +795,10 @@ xfs_mountfs(
         *  Copies the low order bits of the timestamp and the randomly
         *  set "sequence" number out of a UUID.
         */
-       uuid_getnodeuniq(&sbp->sb_uuid, mp->m_fixedfsid);
+       mp->m_fixedfsid[0] =
+               (get_unaligned_be16(&sbp->sb_uuid.b[8]) << 16) |
+                get_unaligned_be16(&sbp->sb_uuid.b[4]);
+       mp->m_fixedfsid[1] = get_unaligned_be32(&sbp->sb_uuid.b[0]);
 
        mp->m_dmevmask = 0;     /* not persistent; set after each mount */
 
@@ -1215,7 +1217,7 @@ xfs_mod_icount(
        struct xfs_mount        *mp,
        int64_t                 delta)
 {
-       __percpu_counter_add(&mp->m_icount, delta, XFS_ICOUNT_BATCH);
+       percpu_counter_add_batch(&mp->m_icount, delta, XFS_ICOUNT_BATCH);
        if (__percpu_counter_compare(&mp->m_icount, 0, XFS_ICOUNT_BATCH) < 0) {
                ASSERT(0);
                percpu_counter_add(&mp->m_icount, -delta);
@@ -1294,7 +1296,7 @@ xfs_mod_fdblocks(
        else
                batch = XFS_FDBLOCKS_BATCH;
 
-       __percpu_counter_add(&mp->m_fdblocks, delta, batch);
+       percpu_counter_add_batch(&mp->m_fdblocks, delta, batch);
        if (__percpu_counter_compare(&mp->m_fdblocks, mp->m_alloc_set_aside,
                                     XFS_FDBLOCKS_BATCH) >= 0) {
                /* we had space! */