diff options
author | ae <ae@FreeBSD.org> | 2013-10-17 16:18:43 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2013-10-17 16:18:43 +0000 |
commit | 05ca533af6819555c1c445085cd62d92ae824773 (patch) | |
tree | d6dabf99cb440907a870facf2c88d50d546c19fb /sys/geom/part/g_part_gpt.c | |
parent | 2a36c1745bb5c396e5e5d8f8afa1a5234a17b16a (diff) | |
download | FreeBSD-src-05ca533af6819555c1c445085cd62d92ae824773.zip FreeBSD-src-05ca533af6819555c1c445085cd62d92ae824773.tar.gz |
Add an automatic resize support to the GEOM_PART class.
When parent provider has been resized, the scheme specific G_PART_RESIZE
method does an update of scheme's metadata. But all changes are not saved
to disk, until `gpart commit` will be called.
Discussed with: trasz
MFC after: 1 month
Diffstat (limited to 'sys/geom/part/g_part_gpt.c')
-rw-r--r-- | sys/geom/part/g_part_gpt.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/geom/part/g_part_gpt.c b/sys/geom/part/g_part_gpt.c index 8634b1e..13adf47 100644 --- a/sys/geom/part/g_part_gpt.c +++ b/sys/geom/part/g_part_gpt.c @@ -731,8 +731,11 @@ g_part_gpt_resize(struct g_part_table *basetable, struct g_part_entry *baseentry, struct g_part_parms *gpp) { struct g_part_gpt_entry *entry; - entry = (struct g_part_gpt_entry *)baseentry; + if (baseentry == NULL) + return (EOPNOTSUPP); + + entry = (struct g_part_gpt_entry *)baseentry; baseentry->gpe_end = baseentry->gpe_start + gpp->gpp_size - 1; entry->ent.ent_lba_end = baseentry->gpe_end; |