Deleted Added
full compact
md.c (282064) md.c (298230)
1/*-
2 * Copyright (c) 2009 Marcel Moolenaar
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) 2009 Marcel Moolenaar
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/boot/common/md.c 282064 2015-04-27 07:38:46Z scottl $");
28__FBSDID("$FreeBSD: head/sys/boot/common/md.c 298230 2016-04-18 23:09:22Z allanjude $");
29
30#include <stand.h>
31#include <sys/param.h>
32#include <sys/endian.h>
33#include <sys/queue.h>
34#include <machine/stdarg.h>
35
36#include "bootstrap.h"

--- 18 unchanged lines hidden (view full) ---

55 u_char end[128];
56} md_image = {
57 .start = "MFS Filesystem goes here",
58 .end = "MFS Filesystem had better STOP here",
59};
60
61/* devsw I/F */
62static int md_init(void);
29
30#include <stand.h>
31#include <sys/param.h>
32#include <sys/endian.h>
33#include <sys/queue.h>
34#include <machine/stdarg.h>
35
36#include "bootstrap.h"

--- 18 unchanged lines hidden (view full) ---

55 u_char end[128];
56} md_image = {
57 .start = "MFS Filesystem goes here",
58 .end = "MFS Filesystem had better STOP here",
59};
60
61/* devsw I/F */
62static int md_init(void);
63static int md_strategy(void *, int, daddr_t, size_t, char *, size_t *);
63static int md_strategy(void *, int, daddr_t, size_t, size_t, char *, size_t *);
64static int md_open(struct open_file *, ...);
65static int md_close(struct open_file *);
66static void md_print(int);
67
68struct devsw md_dev = {
69 "md",
70 DEVT_DISK,
71 md_init,

--- 7 unchanged lines hidden (view full) ---

79static int
80md_init(void)
81{
82
83 return (0);
84}
85
86static int
64static int md_open(struct open_file *, ...);
65static int md_close(struct open_file *);
66static void md_print(int);
67
68struct devsw md_dev = {
69 "md",
70 DEVT_DISK,
71 md_init,

--- 7 unchanged lines hidden (view full) ---

79static int
80md_init(void)
81{
82
83 return (0);
84}
85
86static int
87md_strategy(void *devdata, int rw, daddr_t blk, size_t size, char *buf,
88 size_t *rsize)
87md_strategy(void *devdata, int rw, daddr_t blk, size_t offset, size_t size,
88 char *buf, size_t *rsize)
89{
90 struct devdesc *dev = (struct devdesc *)devdata;
91 size_t ofs;
92
93 if (dev->d_unit != 0)
94 return (ENXIO);
95
96 if (blk < 0 || blk >= (MD_IMAGE_SIZE / MD_BLOCK_SIZE))

--- 55 unchanged lines hidden ---
89{
90 struct devdesc *dev = (struct devdesc *)devdata;
91 size_t ofs;
92
93 if (dev->d_unit != 0)
94 return (ENXIO);
95
96 if (blk < 0 || blk >= (MD_IMAGE_SIZE / MD_BLOCK_SIZE))

--- 55 unchanged lines hidden ---