Changeset d858a660 in mainline
- Timestamp:
- 2017-07-04T15:05:43Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9c2c7d2
- Parents:
- 2456fd0
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/fdisk/fdisk.c
r2456fd0 rd858a660 677 677 char *svcname = NULL; 678 678 char *spkind; 679 const char *label; 679 680 int rc; 680 681 int npart; … … 717 718 fdisk_dev_get_flags(dev, &dflags); 718 719 719 printf("Device: %s , %s\n", sdcap, svcname);720 printf("Device: %s (%s)\n", svcname, sdcap); 720 721 free(sdcap); 721 722 sdcap = NULL; … … 769 770 } 770 771 772 if (str_size(pinfo.label) > 0) 773 label = pinfo.label; 774 else 775 label = "(No label)"; 776 771 777 if (linfo.ltype == lt_none) 772 printf("Entire disk: %s ", scap);778 printf("Entire disk: %s %s", label, scap); 773 779 else 774 printf("Partition %d: %s ", npart, scap);780 printf("Partition %d: %s %s", npart, label, scap); 775 781 776 782 if ((linfo.flags & lf_ext_supp) != 0) { -
uspace/lib/c/include/ipc/vol.h
r2456fd0 rd858a660 36 36 #include <ipc/common.h> 37 37 38 #define VOL_LABEL_MAXLEN 63 39 38 40 typedef enum { 39 41 VOL_GET_PARTS = IPC_FIRST_USER_METHOD, -
uspace/lib/c/include/types/vol.h
r2456fd0 rd858a660 37 37 38 38 #include <async.h> 39 #include <ipc/vol.h> 39 40 40 41 typedef enum { … … 71 72 /** Filesystem type */ 72 73 vol_fstype_t fstype; 74 /** Volume label */ 75 char label[VOL_LABEL_MAXLEN + 1]; 73 76 } vol_part_info_t; 74 77 -
uspace/lib/fdisk/include/types/fdisk.h
r2456fd0 rd858a660 187 187 /** Service ID */ 188 188 service_id_t svc_id; 189 /** Volume label */ 190 char *label; 189 191 } fdisk_part_t; 190 192 … … 209 211 /** File system type */ 210 212 vol_fstype_t fstype; 213 /** Volume label */ 214 char *label; 211 215 } fdisk_part_info_t; 212 216 -
uspace/lib/fdisk/src/fdisk.c
r2456fd0 rd858a660 269 269 part->pcnt = vpinfo.pcnt; 270 270 part->fstype = vpinfo.fstype; 271 part->label = str_dup(vpinfo.label); 271 272 } 272 273 … … 301 302 return EOK; 302 303 error: 304 if (part != NULL) 305 free(part->label); 303 306 free(part); 304 307 return rc; … … 315 318 if (link_used(&part->llog_ba)) 316 319 list_remove(&part->llog_ba); 320 321 free(part->label); 317 322 free(part); 318 323 } … … 667 672 info->fstype = part->fstype; 668 673 info->pkind = part->pkind; 674 info->label = part->label; 669 675 return EOK; 670 676 } -
uspace/srv/volsrv/part.c
r2456fd0 rd858a660 186 186 part->pcnt = vpc_fs; 187 187 part->fstype = fst->fstype; 188 part->label = str_dup(info.label); 189 if (part->label == NULL) 190 goto error; 188 191 } else { 189 192 log_msg(LOG_DEFAULT, LVL_NOTE, "Partition does not contain " … … 198 201 199 202 part->pcnt = empty ? vpc_empty : vpc_unknown; 203 part->label = str_dup(""); 204 if (part->label == NULL) 205 goto error; 200 206 } 201 207 … … 327 333 pinfo->pcnt = part->pcnt; 328 334 pinfo->fstype = part->fstype; 335 str_cpy(pinfo->label, sizeof(pinfo->label), part->label); 329 336 return EOK; 330 337 } -
uspace/srv/volsrv/types/part.h
r2456fd0 rd858a660 52 52 /** Filesystem type */ 53 53 vol_fstype_t fstype; 54 /** Volume label */ 55 char *label; 54 56 } vol_part_t; 55 57
Note:
See TracChangeset
for help on using the changeset viewer.