Warning, file /system/kpmcore/src/core/volumemanagerdevice.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     SPDX-FileCopyrightText: 2016 Chantara Tith <tith.chantara@gmail.com>
0003     SPDX-FileCopyrightText: 2016-2018 Andrius Štikonas <andrius@stikonas.eu>
0004     SPDX-FileCopyrightText: 2019 Yuri Chornoivan <yurchor@ukr.net>
0005 
0006     SPDX-License-Identifier: GPL-3.0-or-later
0007 */
0008 
0009 #include "core/volumemanagerdevice.h"
0010 #include "core/volumemanagerdevice_p.h"
0011 #include "core/device_p.h"
0012 #include "core/lvmdevice.h"
0013 #include "core/raid/softwareraid.h"
0014 
0015 /** Constructs an abstract Volume Manager Device with an empty PartitionTable.
0016  *
0017  * @param name the Device's name
0018  * @param deviceNode the Device's node
0019  * @param logicalExtentSize the logical extent size that device uses
0020 */
0021 VolumeManagerDevice::VolumeManagerDevice(std::shared_ptr<VolumeManagerDevicePrivate> d,
0022                                          const QString& name,
0023                                          const QString& deviceNode,
0024                                          const qint64 logicalExtentSize,
0025                                          const qint64 totalLogical,
0026                                          const QString& iconName,
0027                                          Device::Type type)
0028     : Device(std::static_pointer_cast<DevicePrivate>(d), name, deviceNode, logicalExtentSize, totalLogical, iconName, type)
0029 {
0030 }
0031 
0032 void VolumeManagerDevice::scanDevices(QList<Device*>& devices)
0033 {
0034     SoftwareRAID::scanSoftwareRAID(devices);
0035     LvmDevice::scanSystemLVM(devices); // LVM scanner needs all other devices, so should be last
0036 }
0037 
0038 QString VolumeManagerDevice::prettyDeviceNodeList() const
0039 {
0040     return deviceNodes().join(QStringLiteral(", "));
0041 }
0042 
0043 void VolumeManagerDevice::setTotalLogical(qint64 n)
0044 {
0045     Q_ASSERT(n > 0);
0046     d->m_TotalLogical = n;
0047 }