udf_strat_bootstrap.c revision 1.1.4.2 1 1.1.4.2 yamt /* $NetBSD: udf_strat_bootstrap.c,v 1.1.4.2 2008/05/18 12:35:06 yamt Exp $ */
2 1.1.4.2 yamt
3 1.1.4.2 yamt /*
4 1.1.4.2 yamt * Copyright (c) 2006, 2008 Reinoud Zandijk
5 1.1.4.2 yamt * All rights reserved.
6 1.1.4.2 yamt *
7 1.1.4.2 yamt * Redistribution and use in source and binary forms, with or without
8 1.1.4.2 yamt * modification, are permitted provided that the following conditions
9 1.1.4.2 yamt * are met:
10 1.1.4.2 yamt * 1. Redistributions of source code must retain the above copyright
11 1.1.4.2 yamt * notice, this list of conditions and the following disclaimer.
12 1.1.4.2 yamt * 2. Redistributions in binary form must reproduce the above copyright
13 1.1.4.2 yamt * notice, this list of conditions and the following disclaimer in the
14 1.1.4.2 yamt * documentation and/or other materials provided with the distribution.
15 1.1.4.2 yamt *
16 1.1.4.2 yamt * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1.4.2 yamt * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.1.4.2 yamt * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1.4.2 yamt * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.1.4.2 yamt * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 1.1.4.2 yamt * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 1.1.4.2 yamt * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 1.1.4.2 yamt * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 1.1.4.2 yamt * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 1.1.4.2 yamt * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 1.1.4.2 yamt *
27 1.1.4.2 yamt */
28 1.1.4.2 yamt
29 1.1.4.2 yamt #include <sys/cdefs.h>
30 1.1.4.2 yamt #ifndef lint
31 1.1.4.2 yamt __KERNEL_RCSID(0, "$NetBSD: udf_strat_bootstrap.c,v 1.1.4.2 2008/05/18 12:35:06 yamt Exp $");
32 1.1.4.2 yamt #endif /* not lint */
33 1.1.4.2 yamt
34 1.1.4.2 yamt
35 1.1.4.2 yamt #if defined(_KERNEL_OPT)
36 1.1.4.2 yamt #include "opt_quota.h"
37 1.1.4.2 yamt #include "opt_compat_netbsd.h"
38 1.1.4.2 yamt #endif
39 1.1.4.2 yamt
40 1.1.4.2 yamt #include <sys/param.h>
41 1.1.4.2 yamt #include <sys/systm.h>
42 1.1.4.2 yamt #include <sys/sysctl.h>
43 1.1.4.2 yamt #include <sys/namei.h>
44 1.1.4.2 yamt #include <sys/proc.h>
45 1.1.4.2 yamt #include <sys/kernel.h>
46 1.1.4.2 yamt #include <sys/vnode.h>
47 1.1.4.2 yamt #include <miscfs/genfs/genfs_node.h>
48 1.1.4.2 yamt #include <sys/mount.h>
49 1.1.4.2 yamt #include <sys/buf.h>
50 1.1.4.2 yamt #include <sys/file.h>
51 1.1.4.2 yamt #include <sys/device.h>
52 1.1.4.2 yamt #include <sys/disklabel.h>
53 1.1.4.2 yamt #include <sys/ioctl.h>
54 1.1.4.2 yamt #include <sys/malloc.h>
55 1.1.4.2 yamt #include <sys/dirent.h>
56 1.1.4.2 yamt #include <sys/stat.h>
57 1.1.4.2 yamt #include <sys/conf.h>
58 1.1.4.2 yamt #include <sys/kauth.h>
59 1.1.4.2 yamt #include <sys/kthread.h>
60 1.1.4.2 yamt #include <dev/clock_subr.h>
61 1.1.4.2 yamt
62 1.1.4.2 yamt #include <fs/udf/ecma167-udf.h>
63 1.1.4.2 yamt #include <fs/udf/udf_mount.h>
64 1.1.4.2 yamt
65 1.1.4.2 yamt #if defined(_KERNEL_OPT)
66 1.1.4.2 yamt #include "opt_udf.h"
67 1.1.4.2 yamt #endif
68 1.1.4.2 yamt
69 1.1.4.2 yamt #include "udf.h"
70 1.1.4.2 yamt #include "udf_subr.h"
71 1.1.4.2 yamt #include "udf_bswap.h"
72 1.1.4.2 yamt
73 1.1.4.2 yamt
74 1.1.4.2 yamt #define VTOI(vnode) ((struct udf_node *) vnode->v_data)
75 1.1.4.2 yamt #define PRIV(ump) ((struct strat_private *) ump->strategy_private)
76 1.1.4.2 yamt
77 1.1.4.2 yamt /* --------------------------------------------------------------------- */
78 1.1.4.2 yamt
79 1.1.4.2 yamt static int
80 1.1.4.2 yamt udf_create_logvol_dscr_bootstrap(struct udf_strat_args *args)
81 1.1.4.2 yamt {
82 1.1.4.2 yamt panic("udf_create_logvol_dscr_bootstrap: not possible\n");
83 1.1.4.2 yamt return 0;
84 1.1.4.2 yamt }
85 1.1.4.2 yamt
86 1.1.4.2 yamt
87 1.1.4.2 yamt static void
88 1.1.4.2 yamt udf_free_logvol_dscr_bootstrap(struct udf_strat_args *args)
89 1.1.4.2 yamt {
90 1.1.4.2 yamt panic("udf_free_logvol_dscr_bootstrap: no node descriptor reading\n");
91 1.1.4.2 yamt }
92 1.1.4.2 yamt
93 1.1.4.2 yamt
94 1.1.4.2 yamt static int
95 1.1.4.2 yamt udf_read_logvol_dscr_bootstrap(struct udf_strat_args *args)
96 1.1.4.2 yamt {
97 1.1.4.2 yamt panic("udf_read_logvol_dscr_bootstrap: no node descriptor reading\n");
98 1.1.4.2 yamt return 0;
99 1.1.4.2 yamt }
100 1.1.4.2 yamt
101 1.1.4.2 yamt
102 1.1.4.2 yamt static int
103 1.1.4.2 yamt udf_write_logvol_dscr_bootstrap(struct udf_strat_args *args)
104 1.1.4.2 yamt {
105 1.1.4.2 yamt panic("udf_write_logvol_dscr_bootstrap: no writing\n");
106 1.1.4.2 yamt }
107 1.1.4.2 yamt
108 1.1.4.2 yamt /* --------------------------------------------------------------------- */
109 1.1.4.2 yamt
110 1.1.4.2 yamt static void
111 1.1.4.2 yamt udf_queuebuf_bootstrap(struct udf_strat_args *args)
112 1.1.4.2 yamt {
113 1.1.4.2 yamt struct udf_mount *ump = args->ump;
114 1.1.4.2 yamt struct buf *buf = args->nestbuf;
115 1.1.4.2 yamt
116 1.1.4.2 yamt KASSERT(ump);
117 1.1.4.2 yamt KASSERT(buf);
118 1.1.4.2 yamt KASSERT(buf->b_iodone == nestiobuf_iodone);
119 1.1.4.2 yamt
120 1.1.4.2 yamt KASSERT(buf->b_flags & B_READ);
121 1.1.4.2 yamt VOP_STRATEGY(ump->devvp, buf);
122 1.1.4.2 yamt }
123 1.1.4.2 yamt
124 1.1.4.2 yamt static void
125 1.1.4.2 yamt udf_discstrat_init_bootstrap(struct udf_strat_args *args)
126 1.1.4.2 yamt {
127 1.1.4.2 yamt /* empty */
128 1.1.4.2 yamt }
129 1.1.4.2 yamt
130 1.1.4.2 yamt
131 1.1.4.2 yamt static void
132 1.1.4.2 yamt udf_discstrat_finish_bootstrap(struct udf_strat_args *args)
133 1.1.4.2 yamt {
134 1.1.4.2 yamt /* empty */
135 1.1.4.2 yamt }
136 1.1.4.2 yamt
137 1.1.4.2 yamt /* --------------------------------------------------------------------- */
138 1.1.4.2 yamt
139 1.1.4.2 yamt struct udf_strategy udf_strat_bootstrap =
140 1.1.4.2 yamt {
141 1.1.4.2 yamt udf_create_logvol_dscr_bootstrap,
142 1.1.4.2 yamt udf_free_logvol_dscr_bootstrap,
143 1.1.4.2 yamt udf_read_logvol_dscr_bootstrap,
144 1.1.4.2 yamt udf_write_logvol_dscr_bootstrap,
145 1.1.4.2 yamt udf_queuebuf_bootstrap,
146 1.1.4.2 yamt udf_discstrat_init_bootstrap,
147 1.1.4.2 yamt udf_discstrat_finish_bootstrap
148 1.1.4.2 yamt };
149 1.1.4.2 yamt
150 1.1.4.2 yamt
151