svn commit: r226720 - head/sbin/geom/class/eli
Pawel Jakub Dawidek
pjd at FreeBSD.org
Tue Oct 25 07:44:10 UTC 2011
Author: pjd
Date: Tue Oct 25 07:44:10 2011
New Revision: 226720
URL: http://svn.freebsd.org/changeset/base/226720
Log:
Simplify eli_resize() function.
MFC after: 3 days
Modified:
head/sbin/geom/class/eli/geom_eli.c
Modified: head/sbin/geom/class/eli/geom_eli.c
==============================================================================
--- head/sbin/geom/class/eli/geom_eli.c Tue Oct 25 07:37:02 2011 (r226719)
+++ head/sbin/geom/class/eli/geom_eli.c Tue Oct 25 07:44:10 2011 (r226720)
@@ -1480,18 +1480,12 @@ eli_resize(struct gctl_req *req)
* it back to the correct place on the provider.
*/
md.md_provsize = mediasize;
- eli_metadata_encode(&md, sector);
- if (pwrite(provfd, sector, secsize, mediasize - secsize) != secsize) {
- gctl_error(req, "Cannot write metadata: %s.", strerror(errno));
- goto out;
- }
- (void)g_flush(provfd);
-
+ /* Write metadata to the provider. */
+ (void)eli_metadata_store(req, prov, &md);
/* Now trash the old metadata. */
- if (eli_trash_metadata(req, prov, provfd, oldsize - secsize) == -1)
- goto out;
+ (void)eli_trash_metadata(req, prov, provfd, oldsize - secsize);
out:
- if (provfd >= 0)
+ if (provfd != -1)
(void)g_close(provfd);
if (sector != NULL) {
bzero(sector, secsize);
More information about the svn-src-all
mailing list