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