Lines Matching refs:part
39 static int BlkpgPartCommand(const Partition &part, struct blkpg_partition &pg, int op) in BlkpgPartCommand() argument
49 ret = ioctl(part.partfd, BLKPG, &args); in BlkpgPartCommand()
52 … LOG(ERROR) << "ioctl of partition " << part.partName << " with operation " << op << " failed"; in BlkpgPartCommand()
57 static int DoUmountDiskPartition(const Partition &part) in DoUmountDiskPartition() argument
59 std::string partName = std::string("/") + part.partName; in DoUmountDiskPartition()
90 static int BlkpgRemovePartition(const Partition &part) in BlkpgRemovePartition() argument
96 blkPart.pno = part.partNum; in BlkpgRemovePartition()
97 return BlkpgPartCommand(part, blkPart, BLKPG_DEL_PARTITION); in BlkpgRemovePartition()
121 Partition *part = nullptr; in DoRmPartition() local
122 part = GetPartition(disk, partn); in DoRmPartition()
123 if (part == nullptr) { in DoRmPartition()
131 part->partfd = disk.dev->fd; in DoRmPartition()
132 int ret = BlkpgRemovePartition(*part); in DoRmPartition()
133 part->partfd = -1; in DoRmPartition()
141 static int BlkpgAddPartition(Partition &part) in BlkpgAddPartition() argument
147 blkPart.start = static_cast<long long>(part.start * SECTOR_SIZE_DEFAULT); in BlkpgAddPartition()
149 blkPart.length = static_cast<long long>(part.length * SECTOR_SIZE_DEFAULT); in BlkpgAddPartition()
151 blkPart.pno = part.partNum; in BlkpgAddPartition()
153 …if (strncpy_s(blkPart.devname, BLKPG_DEVNAMELTH, part.devName.c_str(), part.devName.size()) != EOK… in BlkpgAddPartition()
157 …if (strncpy_s(blkPart.volname, BLKPG_VOLNAMELTH, part.partName.c_str(), part.partName.size()) != E… in BlkpgAddPartition()
161 if (BlkpgPartCommand(part, blkPart, BLKPG_ADD_PARTITION) < 0) { in BlkpgAddPartition()
167 static bool DoAddPartition(const Disk &disk, Partition &part) in DoAddPartition() argument
173 part.partfd = disk.dev->fd; in DoAddPartition()
174 int ret = BlkpgAddPartition(part); in DoAddPartition()
175 part.partfd = -1; in DoAddPartition()