g_label_ext2fs.c (148978) | g_label_ext2fs.c (149395) |
---|---|
1/*- 2 * Copyright (c) 2005 Stanislav Sedov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2005 Stanislav Sedov 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/geom/label/g_label_ext2fs.c 148978 2005-08-12 00:27:45Z pjd $"); | 28__FBSDID("$FreeBSD: head/sys/geom/label/g_label_ext2fs.c 149395 2005-08-23 18:55:38Z pjd $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/malloc.h> 34 35#include <geom/geom.h> 36#include <geom/label/g_label.h> --- 16 unchanged lines hidden (view full) --- 53{ 54 struct g_provider *pp; 55 e2sb_t *fs; 56 57 g_topology_assert_not(); 58 pp = cp->provider; 59 label[0] = '\0'; 60 | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/malloc.h> 34 35#include <geom/geom.h> 36#include <geom/label/g_label.h> --- 16 unchanged lines hidden (view full) --- 53{ 54 struct g_provider *pp; 55 e2sb_t *fs; 56 57 g_topology_assert_not(); 58 pp = cp->provider; 59 label[0] = '\0'; 60 |
61 if ((EXT2FS_SB_OFFSET % pp->sectorsize) != 0) 62 return; 63 |
|
61 fs = (e2sb_t *)g_read_data(cp, EXT2FS_SB_OFFSET, pp->sectorsize, NULL); 62 if (fs == NULL) 63 return; 64 65 /* Check for magic and versio n*/ 66 if (fs->s_magic == EXT2_SUPER_MAGIC && 67 fs->s_rev_level == EXT2_DYNAMIC_REV) { 68 G_LABEL_DEBUG(1, "ext2fs file system detected on %s.", --- 21 unchanged lines hidden --- | 64 fs = (e2sb_t *)g_read_data(cp, EXT2FS_SB_OFFSET, pp->sectorsize, NULL); 65 if (fs == NULL) 66 return; 67 68 /* Check for magic and versio n*/ 69 if (fs->s_magic == EXT2_SUPER_MAGIC && 70 fs->s_rev_level == EXT2_DYNAMIC_REV) { 71 G_LABEL_DEBUG(1, "ext2fs file system detected on %s.", --- 21 unchanged lines hidden --- |