| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) International Business Machines Corp., 2000-2004 |
|---|
| 3 | 4 | * Portions Copyright (C) Christoph Hellwig, 2001-2002 |
|---|
| 4 | | - * |
|---|
| 5 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 6 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 7 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 8 | | - * (at your option) any later version. |
|---|
| 9 | | - * |
|---|
| 10 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
|---|
| 13 | | - * the GNU General Public License for more details. |
|---|
| 14 | | - * |
|---|
| 15 | | - * You should have received a copy of the GNU General Public License |
|---|
| 16 | | - * along with this program; if not, write to the Free Software |
|---|
| 17 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 18 | 5 | */ |
|---|
| 19 | 6 | |
|---|
| 20 | 7 | /* |
|---|
| .. | .. |
|---|
| 1092 | 1079 | mutex_lock(&jfs_log_mutex); |
|---|
| 1093 | 1080 | list_for_each_entry(log, &jfs_external_logs, journal_list) { |
|---|
| 1094 | 1081 | if (log->bdev->bd_dev == sbi->logdev) { |
|---|
| 1095 | | - if (memcmp(log->uuid, sbi->loguuid, |
|---|
| 1096 | | - sizeof(log->uuid))) { |
|---|
| 1082 | + if (!uuid_equal(&log->uuid, &sbi->loguuid)) { |
|---|
| 1097 | 1083 | jfs_warn("wrong uuid on JFS journal"); |
|---|
| 1098 | 1084 | mutex_unlock(&jfs_log_mutex); |
|---|
| 1099 | 1085 | return -EINVAL; |
|---|
| .. | .. |
|---|
| 1130 | 1116 | } |
|---|
| 1131 | 1117 | |
|---|
| 1132 | 1118 | log->bdev = bdev; |
|---|
| 1133 | | - memcpy(log->uuid, sbi->loguuid, sizeof(log->uuid)); |
|---|
| 1119 | + uuid_copy(&log->uuid, &sbi->loguuid); |
|---|
| 1134 | 1120 | |
|---|
| 1135 | 1121 | /* |
|---|
| 1136 | 1122 | * initialize log: |
|---|
| .. | .. |
|---|
| 1336 | 1322 | jfs_info("lmLogInit: inline log:0x%p base:0x%Lx size:0x%x", |
|---|
| 1337 | 1323 | log, (unsigned long long)log->base, log->size); |
|---|
| 1338 | 1324 | } else { |
|---|
| 1339 | | - if (memcmp(logsuper->uuid, log->uuid, 16)) { |
|---|
| 1325 | + if (!uuid_equal(&logsuper->uuid, &log->uuid)) { |
|---|
| 1340 | 1326 | jfs_warn("wrong uuid on JFS log device"); |
|---|
| 1341 | 1327 | rc = -EINVAL; |
|---|
| 1342 | 1328 | goto errout20; |
|---|
| .. | .. |
|---|
| 1733 | 1719 | int i; |
|---|
| 1734 | 1720 | struct logsuper *logsuper; |
|---|
| 1735 | 1721 | struct lbuf *bpsuper; |
|---|
| 1736 | | - char *uuid = sbi->uuid; |
|---|
| 1722 | + uuid_t *uuid = &sbi->uuid; |
|---|
| 1737 | 1723 | |
|---|
| 1738 | 1724 | /* |
|---|
| 1739 | 1725 | * insert/remove file system device to log active file system list. |
|---|
| .. | .. |
|---|
| 1744 | 1730 | logsuper = (struct logsuper *) bpsuper->l_ldata; |
|---|
| 1745 | 1731 | if (activate) { |
|---|
| 1746 | 1732 | for (i = 0; i < MAX_ACTIVE; i++) |
|---|
| 1747 | | - if (!memcmp(logsuper->active[i].uuid, NULL_UUID, 16)) { |
|---|
| 1748 | | - memcpy(logsuper->active[i].uuid, uuid, 16); |
|---|
| 1733 | + if (uuid_is_null(&logsuper->active[i].uuid)) { |
|---|
| 1734 | + uuid_copy(&logsuper->active[i].uuid, uuid); |
|---|
| 1749 | 1735 | sbi->aggregate = i; |
|---|
| 1750 | 1736 | break; |
|---|
| 1751 | 1737 | } |
|---|
| .. | .. |
|---|
| 1756 | 1742 | } |
|---|
| 1757 | 1743 | } else { |
|---|
| 1758 | 1744 | for (i = 0; i < MAX_ACTIVE; i++) |
|---|
| 1759 | | - if (!memcmp(logsuper->active[i].uuid, uuid, 16)) { |
|---|
| 1760 | | - memcpy(logsuper->active[i].uuid, NULL_UUID, 16); |
|---|
| 1745 | + if (uuid_equal(&logsuper->active[i].uuid, uuid)) { |
|---|
| 1746 | + uuid_copy(&logsuper->active[i].uuid, |
|---|
| 1747 | + &uuid_null); |
|---|
| 1761 | 1748 | break; |
|---|
| 1762 | 1749 | } |
|---|
| 1763 | 1750 | if (i == MAX_ACTIVE) { |
|---|