hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/block/partitions/ldm.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /**
23 * ldm - Support for Windows Logical Disk Manager (Dynamic Disks)
34 *
....@@ -6,21 +7,6 @@
67 * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com>
78 *
89 * Documentation is available at http://www.linux-ntfs.org/doku.php?id=downloads
9
- *
10
- * This program is free software; you can redistribute it and/or modify it under
11
- * the terms of the GNU General Public License as published by the Free Software
12
- * Foundation; either version 2 of the License, or (at your option) any later
13
- * version.
14
- *
15
- * This program is distributed in the hope that it will be useful, but WITHOUT
16
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18
- * details.
19
- *
20
- * You should have received a copy of the GNU General Public License along with
21
- * this program (in the main directory of the source in the file COPYING); if
22
- * not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
23
- * Boston, MA 02111-1307 USA
2410 */
2511
2612 #include <linux/slab.h>
....@@ -28,12 +14,12 @@
2814 #include <linux/stringify.h>
2915 #include <linux/kernel.h>
3016 #include <linux/uuid.h>
17
+#include <linux/msdos_partition.h>
3118
3219 #include "ldm.h"
3320 #include "check.h"
34
-#include "msdos.h"
3521
36
-/**
22
+/*
3723 * ldm_debug/info/error/crit - Output an error message
3824 * @f: A printf format string containing the message
3925 * @...: Variables to substitute into @f
....@@ -507,7 +493,7 @@
507493 {
508494 Sector sect;
509495 u8 *data;
510
- struct partition *p;
496
+ struct msdos_partition *p;
511497 int i;
512498 bool result = false;
513499
....@@ -522,9 +508,9 @@
522508 if (*(__le16*) (data + 0x01FE) != cpu_to_le16 (MSDOS_LABEL_MAGIC))
523509 goto out;
524510
525
- p = (struct partition*)(data + 0x01BE);
511
+ p = (struct msdos_partition *)(data + 0x01BE);
526512 for (i = 0; i < 4; i++, p++)
527
- if (SYS_IND (p) == LDM_PARTITION) {
513
+ if (p->sys_ind == LDM_PARTITION) {
528514 result = true;
529515 break;
530516 }
....@@ -924,7 +910,7 @@
924910 return false;
925911
926912 disk = &vb->vblk.disk;
927
- uuid_copy(&disk->disk_id, (uuid_t *)(buffer + 0x18 + r_name));
913
+ import_uuid(&disk->disk_id, buffer + 0x18 + r_name);
928914 return true;
929915 }
930916
....@@ -1247,7 +1233,7 @@
12471233 BUG_ON (!data || !frags);
12481234
12491235 if (size < 2 * VBLK_SIZE_HEAD) {
1250
- ldm_error("Value of size is to small.");
1236
+ ldm_error("Value of size is too small.");
12511237 return false;
12521238 }
12531239