| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /** |
|---|
| 2 | 3 | * ldm - Support for Windows Logical Disk Manager (Dynamic Disks) |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 6 | 7 | * Copyright (C) 2001,2002 Jakob Kemi <jakob.kemi@telia.com> |
|---|
| 7 | 8 | * |
|---|
| 8 | 9 | * 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 |
|---|
| 24 | 10 | */ |
|---|
| 25 | 11 | |
|---|
| 26 | 12 | #include <linux/slab.h> |
|---|
| .. | .. |
|---|
| 28 | 14 | #include <linux/stringify.h> |
|---|
| 29 | 15 | #include <linux/kernel.h> |
|---|
| 30 | 16 | #include <linux/uuid.h> |
|---|
| 17 | +#include <linux/msdos_partition.h> |
|---|
| 31 | 18 | |
|---|
| 32 | 19 | #include "ldm.h" |
|---|
| 33 | 20 | #include "check.h" |
|---|
| 34 | | -#include "msdos.h" |
|---|
| 35 | 21 | |
|---|
| 36 | | -/** |
|---|
| 22 | +/* |
|---|
| 37 | 23 | * ldm_debug/info/error/crit - Output an error message |
|---|
| 38 | 24 | * @f: A printf format string containing the message |
|---|
| 39 | 25 | * @...: Variables to substitute into @f |
|---|
| .. | .. |
|---|
| 507 | 493 | { |
|---|
| 508 | 494 | Sector sect; |
|---|
| 509 | 495 | u8 *data; |
|---|
| 510 | | - struct partition *p; |
|---|
| 496 | + struct msdos_partition *p; |
|---|
| 511 | 497 | int i; |
|---|
| 512 | 498 | bool result = false; |
|---|
| 513 | 499 | |
|---|
| .. | .. |
|---|
| 522 | 508 | if (*(__le16*) (data + 0x01FE) != cpu_to_le16 (MSDOS_LABEL_MAGIC)) |
|---|
| 523 | 509 | goto out; |
|---|
| 524 | 510 | |
|---|
| 525 | | - p = (struct partition*)(data + 0x01BE); |
|---|
| 511 | + p = (struct msdos_partition *)(data + 0x01BE); |
|---|
| 526 | 512 | for (i = 0; i < 4; i++, p++) |
|---|
| 527 | | - if (SYS_IND (p) == LDM_PARTITION) { |
|---|
| 513 | + if (p->sys_ind == LDM_PARTITION) { |
|---|
| 528 | 514 | result = true; |
|---|
| 529 | 515 | break; |
|---|
| 530 | 516 | } |
|---|
| .. | .. |
|---|
| 924 | 910 | return false; |
|---|
| 925 | 911 | |
|---|
| 926 | 912 | 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); |
|---|
| 928 | 914 | return true; |
|---|
| 929 | 915 | } |
|---|
| 930 | 916 | |
|---|
| .. | .. |
|---|
| 1247 | 1233 | BUG_ON (!data || !frags); |
|---|
| 1248 | 1234 | |
|---|
| 1249 | 1235 | if (size < 2 * VBLK_SIZE_HEAD) { |
|---|
| 1250 | | - ldm_error("Value of size is to small."); |
|---|
| 1236 | + ldm_error("Value of size is too small."); |
|---|
| 1251 | 1237 | return false; |
|---|
| 1252 | 1238 | } |
|---|
| 1253 | 1239 | |
|---|