Browse Source

static part::sysname field

master
Mathieu Serandour 11 months ago
parent
commit
c92c20f506
  1. 7
      kernel/fs/gpt.c
  2. 2
      kernel/fs/gpt.h

7
kernel/fs/gpt.c

@ -2,6 +2,8 @@
#include "../lib/logging.h"
#include "../lib/utf16le.h"
#include "../lib/dump.h"
#include "../lib/assert.h"
#include "../lib/sprintf.h"
#include "../drivers/driver.h"
#include "../drivers/dev.h"
@ -184,15 +186,12 @@ void gpt_scan(const struct storage_interface* sti) {
};
p.sysname = malloc(strlen(sti->driver->device->name.ptr) + 2 + 4);
assert(strlen(sti->driver->device->name.ptr) + 2 + 4 <= sizeof(p.sysname));
sprintf(p.sysname, "%sp%u", sti->driver->device->name.ptr, i+1);
utf16le2ascii(p.name, entry->name, 35);
log_warn("gnezugneu '%s' - '%s'", p.name, p.sysname);
register_partition(&p);
}

2
kernel/fs/gpt.h

@ -24,7 +24,7 @@ typedef struct disk_part {
// name in the system
// Linux-like (nvme0p0, nvme10p4, ...)
// part number begins with 1 begins with
char* sysname;
char sysname[16];
} disk_part_t;
inline

Loading…
Cancel
Save