md.c (118467) | md.c (118607) |
---|---|
1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 * | 1/* 2 * ---------------------------------------------------------------------------- 3 * "THE BEER-WARE LICENSE" (Revision 42): 4 * <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you 5 * can do whatever you want with this stuff. If we meet some day, and you think 6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 7 * ---------------------------------------------------------------------------- 8 * |
9 * $FreeBSD: head/sys/dev/md/md.c 118467 2003-08-05 06:54:44Z phk $ | 9 * $FreeBSD: head/sys/dev/md/md.c 118607 2003-08-07 15:04:27Z jhb $ |
10 * 11 */ 12 13/* 14 * The following functions are based in the vn(4) driver: mdstart_swap(), 15 * mdstart_vnode(), mdcreate_swap(), mdcreate_vnode() and mddestroy(), 16 * and as such under the following copyright: 17 * --- 109 unchanged lines hidden (view full) --- 127static LIST_HEAD(, md_s) md_softc_list = LIST_HEAD_INITIALIZER(&md_softc_list); 128 129#define NINDIR (PAGE_SIZE / sizeof(uintptr_t)) 130#define NMASK (NINDIR-1) 131static int nshift; 132 133struct indir { 134 uintptr_t *array; | 10 * 11 */ 12 13/* 14 * The following functions are based in the vn(4) driver: mdstart_swap(), 15 * mdstart_vnode(), mdcreate_swap(), mdcreate_vnode() and mddestroy(), 16 * and as such under the following copyright: 17 * --- 109 unchanged lines hidden (view full) --- 127static LIST_HEAD(, md_s) md_softc_list = LIST_HEAD_INITIALIZER(&md_softc_list); 128 129#define NINDIR (PAGE_SIZE / sizeof(uintptr_t)) 130#define NMASK (NINDIR-1) 131static int nshift; 132 133struct indir { 134 uintptr_t *array; |
135 uint total; 136 uint used; 137 uint shift; | 135 u_int total; 136 u_int used; 137 u_int shift; |
138}; 139 140struct md_s { 141 int unit; 142 LIST_ENTRY(md_s) list; 143 struct bio_queue_head bio_queue; 144 struct mtx queue_mtx; 145 dev_t dev; --- 23 unchanged lines hidden (view full) --- 169 170 /* MD_SWAP related fields */ 171 vm_object_t object; 172}; 173 174static int mddestroy(struct md_s *sc, struct thread *td); 175 176static struct indir * | 138}; 139 140struct md_s { 141 int unit; 142 LIST_ENTRY(md_s) list; 143 struct bio_queue_head bio_queue; 144 struct mtx queue_mtx; 145 dev_t dev; --- 23 unchanged lines hidden (view full) --- 169 170 /* MD_SWAP related fields */ 171 vm_object_t object; 172}; 173 174static int mddestroy(struct md_s *sc, struct thread *td); 175 176static struct indir * |
177new_indir(uint shift) | 177new_indir(u_int shift) |
178{ 179 struct indir *ip; 180 181 ip = malloc(sizeof *ip, M_MD, M_NOWAIT | M_ZERO); 182 if (ip == NULL) 183 return (NULL); 184 ip->array = malloc(sizeof(uintptr_t) * NINDIR, 185 M_MDSECT, M_NOWAIT | M_ZERO); --- 1058 unchanged lines hidden --- | 178{ 179 struct indir *ip; 180 181 ip = malloc(sizeof *ip, M_MD, M_NOWAIT | M_ZERO); 182 if (ip == NULL) 183 return (NULL); 184 ip->array = malloc(sizeof(uintptr_t) * NINDIR, 185 M_MDSECT, M_NOWAIT | M_ZERO); --- 1058 unchanged lines hidden --- |