type.c (194030) | type.c (207141) |
---|---|
1/* 2 * Copyright (c) 2002 Juli Mallett. All rights reserved. 3 * 4 * This software was written by Juli Mallett <jmallett@FreeBSD.org> for the 5 * FreeBSD project. Redistribution and use in source and binary forms, with 6 * or without modification, are permitted provided that the following 7 * conditions are met: 8 * --- 12 unchanged lines hidden (view full) --- 21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2002 Juli Mallett. All rights reserved. 3 * 4 * This software was written by Juli Mallett <jmallett@FreeBSD.org> for the 5 * FreeBSD project. Redistribution and use in source and binary forms, with 6 * or without modification, are permitted provided that the following 7 * conditions are met: 8 * --- 12 unchanged lines hidden (view full) --- 21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/lib/libufs/type.c 194030 2009-06-11 18:04:57Z jmallett $"); | 29__FBSDID("$FreeBSD: head/lib/libufs/type.c 207141 2010-04-24 07:05:35Z jeff $"); |
30 31#include <sys/param.h> 32#include <sys/mount.h> 33#include <sys/disklabel.h> 34#include <sys/stat.h> 35 36#include <ufs/ufs/ufsmount.h> 37#include <ufs/ufs/dinode.h> --- 23 unchanged lines hidden (view full) --- 61 if (disk->d_inoblock != NULL) { 62 free(disk->d_inoblock); 63 disk->d_inoblock = NULL; 64 } 65 if (disk->d_mine & MINE_NAME) { 66 free((char *)(uintptr_t)disk->d_name); 67 disk->d_name = NULL; 68 } | 30 31#include <sys/param.h> 32#include <sys/mount.h> 33#include <sys/disklabel.h> 34#include <sys/stat.h> 35 36#include <ufs/ufs/ufsmount.h> 37#include <ufs/ufs/dinode.h> --- 23 unchanged lines hidden (view full) --- 61 if (disk->d_inoblock != NULL) { 62 free(disk->d_inoblock); 63 disk->d_inoblock = NULL; 64 } 65 if (disk->d_mine & MINE_NAME) { 66 free((char *)(uintptr_t)disk->d_name); 67 disk->d_name = NULL; 68 } |
69 if (disk->d_sbcsum != NULL) { 70 free(disk->d_sbcsum); 71 disk->d_sbcsum = NULL; 72 } |
|
69 return (0); 70} 71 72int 73ufs_disk_fillout(struct uufsd *disk, const char *name) 74{ 75 if (ufs_disk_fillout_blank(disk, name) == -1) { 76 return (-1); --- 74 unchanged lines hidden (view full) --- 151 disk->d_fd = fd; 152 disk->d_inoblock = NULL; 153 disk->d_inomin = 0; 154 disk->d_inomax = 0; 155 disk->d_lcg = 0; 156 disk->d_mine = 0; 157 disk->d_ufs = 0; 158 disk->d_error = NULL; | 73 return (0); 74} 75 76int 77ufs_disk_fillout(struct uufsd *disk, const char *name) 78{ 79 if (ufs_disk_fillout_blank(disk, name) == -1) { 80 return (-1); --- 74 unchanged lines hidden (view full) --- 155 disk->d_fd = fd; 156 disk->d_inoblock = NULL; 157 disk->d_inomin = 0; 158 disk->d_inomax = 0; 159 disk->d_lcg = 0; 160 disk->d_mine = 0; 161 disk->d_ufs = 0; 162 disk->d_error = NULL; |
163 disk->d_sbcsum = NULL; |
|
159 160 if (oname != name) { 161 name = strdup(name); 162 if (name == NULL) { 163 ERROR(disk, "could not allocate memory for disk name"); 164 return (-1); 165 } 166 disk->d_mine |= MINE_NAME; --- 26 unchanged lines hidden --- | 164 165 if (oname != name) { 166 name = strdup(name); 167 if (name == NULL) { 168 ERROR(disk, "could not allocate memory for disk name"); 169 return (-1); 170 } 171 disk->d_mine |= MINE_NAME; --- 26 unchanged lines hidden --- |