1 diff -aur --new-file linux-2.2.18-pre2-clean/Documentation/Configure.help linux-2.2.18-pre2-beos/Documentation/Configure.help
2 --- linux-2.2.18-pre2-clean/Documentation/Configure.help Thu Aug 24 01:54:28 2000
3 +++ linux-2.2.18-pre2-beos/Documentation/Configure.help Sat Sep 2 12:54:02 2000
6 Say Y if you want to test write support for QNX4 filesystems.
8 +BeOS filesystem support (EXPERIMENTAL)
10 + This is the filesystem used by the BeOS operating system. Say Y if
11 + you want to get read access to file on BeOS partitions of your hard
12 + drive or floppy disk.
14 + This filesystem support is also available as a module ( = code which
15 + can be inserted in and removed from the running kernel whenever you
16 + want). The module is called beos.o. If you want to compile it as a
17 + module, say M here and read Documentation/modules.txt.
21 +Other platform BeOS fs support
23 + Say Y if you want to use other platform BeOS (i.e. mount BeOS(ppc) on
26 Kernel automounter support
28 The automounter is a tool to automatically mount remote filesystems
29 diff -aur --new-file linux-2.2.18-pre2-clean/fs/Config.in linux-2.2.18-pre2-beos/fs/Config.in
30 --- linux-2.2.18-pre2-clean/fs/Config.in Thu Aug 24 01:54:28 2000
31 +++ linux-2.2.18-pre2-beos/fs/Config.in Sat Sep 2 12:51:25 2000
33 bool ' QNX4FS write support (DANGEROUS)' CONFIG_QNX4FS_RW
36 +if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
37 + tristate 'BeOS filesystem support (read only) (EXPERIMENTAL)' CONFIG_BEOS_FS
38 + if [ "$CONFIG_BEOS_FS" != "n" ]; then
39 + bool ' BeOS other platform support' CONFIG_BEOS_CONV
42 tristate 'ROM filesystem support' CONFIG_ROMFS_FS
43 tristate 'Second extended fs support' CONFIG_EXT2_FS
44 tristate 'System V and Coherent filesystem support' CONFIG_SYSV_FS
45 diff -aur --new-file linux-2.2.18-pre2-clean/fs/Makefile linux-2.2.18-pre2-beos/fs/Makefile
46 --- linux-2.2.18-pre2-clean/fs/Makefile Thu Aug 24 01:54:28 2000
47 +++ linux-2.2.18-pre2-beos/fs/Makefile Sat Sep 2 12:51:47 2000
49 MOD_LIST_NAME := FS_MODULES
50 ALL_SUB_DIRS = coda minix ext2 fat msdos vfat proc isofs nfs umsdos ntfs \
51 hpfs sysv smbfs ncpfs ufs affs romfs autofs hfs lockd \
52 - nfsd nls devpts adfs qnx4 efs
53 + nfsd nls devpts adfs qnx4 efs beos
55 ifeq ($(CONFIG_QUOTA),y)
59 ifeq ($(CONFIG_QNX4FS_FS),m)
64 +ifeq ($(CONFIG_BEOS_FS),y)
67 + ifeq ($(CONFIG_BEOS_FS),m)
68 + MOD_SUB_DIRS += beos
72 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/COPYING linux-2.2.18-pre2-beos/fs/beos/COPYING
73 --- linux-2.2.18-pre2-clean/fs/beos/COPYING Wed Dec 31 18:00:00 1969
74 +++ linux-2.2.18-pre2-beos/fs/beos/COPYING Thu May 20 05:41:55 1999
76 + GNU GENERAL PUBLIC LICENSE
77 + Version 2, June 1991
79 + Copyright (C) 1989, 1991 Free Software Foundation, Inc.
80 + 675 Mass Ave, Cambridge, MA 02139, USA
81 + Everyone is permitted to copy and distribute verbatim copies
82 + of this license document, but changing it is not allowed.
86 + The licenses for most software are designed to take away your
87 +freedom to share and change it. By contrast, the GNU General Public
88 +License is intended to guarantee your freedom to share and change free
89 +software--to make sure the software is free for all its users. This
90 +General Public License applies to most of the Free Software
91 +Foundation's software and to any other program whose authors commit to
92 +using it. (Some other Free Software Foundation software is covered by
93 +the GNU Library General Public License instead.) You can apply it to
96 + When we speak of free software, we are referring to freedom, not
97 +price. Our General Public Licenses are designed to make sure that you
98 +have the freedom to distribute copies of free software (and charge for
99 +this service if you wish), that you receive source code or can get it
100 +if you want it, that you can change the software or use pieces of it
101 +in new free programs; and that you know you can do these things.
103 + To protect your rights, we need to make restrictions that forbid
104 +anyone to deny you these rights or to ask you to surrender the rights.
105 +These restrictions translate to certain responsibilities for you if you
106 +distribute copies of the software, or if you modify it.
108 + For example, if you distribute copies of such a program, whether
109 +gratis or for a fee, you must give the recipients all the rights that
110 +you have. You must make sure that they, too, receive or can get the
111 +source code. And you must show them these terms so they know their
114 + We protect your rights with two steps: (1) copyright the software, and
115 +(2) offer you this license which gives you legal permission to copy,
116 +distribute and/or modify the software.
118 + Also, for each author's protection and ours, we want to make certain
119 +that everyone understands that there is no warranty for this free
120 +software. If the software is modified by someone else and passed on, we
121 +want its recipients to know that what they have is not the original, so
122 +that any problems introduced by others will not reflect on the original
123 +authors' reputations.
125 + Finally, any free program is threatened constantly by software
126 +patents. We wish to avoid the danger that redistributors of a free
127 +program will individually obtain patent licenses, in effect making the
128 +program proprietary. To prevent this, we have made it clear that any
129 +patent must be licensed for everyone's free use or not licensed at all.
131 + The precise terms and conditions for copying, distribution and
132 +modification follow.
134 + GNU GENERAL PUBLIC LICENSE
135 + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
137 + 0. This License applies to any program or other work which contains
138 +a notice placed by the copyright holder saying it may be distributed
139 +under the terms of this General Public License. The "Program", below,
140 +refers to any such program or work, and a "work based on the Program"
141 +means either the Program or any derivative work under copyright law:
142 +that is to say, a work containing the Program or a portion of it,
143 +either verbatim or with modifications and/or translated into another
144 +language. (Hereinafter, translation is included without limitation in
145 +the term "modification".) Each licensee is addressed as "you".
147 +Activities other than copying, distribution and modification are not
148 +covered by this License; they are outside its scope. The act of
149 +running the Program is not restricted, and the output from the Program
150 +is covered only if its contents constitute a work based on the
151 +Program (independent of having been made by running the Program).
152 +Whether that is true depends on what the Program does.
154 + 1. You may copy and distribute verbatim copies of the Program's
155 +source code as you receive it, in any medium, provided that you
156 +conspicuously and appropriately publish on each copy an appropriate
157 +copyright notice and disclaimer of warranty; keep intact all the
158 +notices that refer to this License and to the absence of any warranty;
159 +and give any other recipients of the Program a copy of this License
160 +along with the Program.
162 +You may charge a fee for the physical act of transferring a copy, and
163 +you may at your option offer warranty protection in exchange for a fee.
165 + 2. You may modify your copy or copies of the Program or any portion
166 +of it, thus forming a work based on the Program, and copy and
167 +distribute such modifications or work under the terms of Section 1
168 +above, provided that you also meet all of these conditions:
170 + a) You must cause the modified files to carry prominent notices
171 + stating that you changed the files and the date of any change.
173 + b) You must cause any work that you distribute or publish, that in
174 + whole or in part contains or is derived from the Program or any
175 + part thereof, to be licensed as a whole at no charge to all third
176 + parties under the terms of this License.
178 + c) If the modified program normally reads commands interactively
179 + when run, you must cause it, when started running for such
180 + interactive use in the most ordinary way, to print or display an
181 + announcement including an appropriate copyright notice and a
182 + notice that there is no warranty (or else, saying that you provide
183 + a warranty) and that users may redistribute the program under
184 + these conditions, and telling the user how to view a copy of this
185 + License. (Exception: if the Program itself is interactive but
186 + does not normally print such an announcement, your work based on
187 + the Program is not required to print an announcement.)
189 +These requirements apply to the modified work as a whole. If
190 +identifiable sections of that work are not derived from the Program,
191 +and can be reasonably considered independent and separate works in
192 +themselves, then this License, and its terms, do not apply to those
193 +sections when you distribute them as separate works. But when you
194 +distribute the same sections as part of a whole which is a work based
195 +on the Program, the distribution of the whole must be on the terms of
196 +this License, whose permissions for other licensees extend to the
197 +entire whole, and thus to each and every part regardless of who wrote it.
199 +Thus, it is not the intent of this section to claim rights or contest
200 +your rights to work written entirely by you; rather, the intent is to
201 +exercise the right to control the distribution of derivative or
202 +collective works based on the Program.
204 +In addition, mere aggregation of another work not based on the Program
205 +with the Program (or with a work based on the Program) on a volume of
206 +a storage or distribution medium does not bring the other work under
207 +the scope of this License.
209 + 3. You may copy and distribute the Program (or a work based on it,
210 +under Section 2) in object code or executable form under the terms of
211 +Sections 1 and 2 above provided that you also do one of the following:
213 + a) Accompany it with the complete corresponding machine-readable
214 + source code, which must be distributed under the terms of Sections
215 + 1 and 2 above on a medium customarily used for software interchange; or,
217 + b) Accompany it with a written offer, valid for at least three
218 + years, to give any third party, for a charge no more than your
219 + cost of physically performing source distribution, a complete
220 + machine-readable copy of the corresponding source code, to be
221 + distributed under the terms of Sections 1 and 2 above on a medium
222 + customarily used for software interchange; or,
224 + c) Accompany it with the information you received as to the offer
225 + to distribute corresponding source code. (This alternative is
226 + allowed only for noncommercial distribution and only if you
227 + received the program in object code or executable form with such
228 + an offer, in accord with Subsection b above.)
230 +The source code for a work means the preferred form of the work for
231 +making modifications to it. For an executable work, complete source
232 +code means all the source code for all modules it contains, plus any
233 +associated interface definition files, plus the scripts used to
234 +control compilation and installation of the executable. However, as a
235 +special exception, the source code distributed need not include
236 +anything that is normally distributed (in either source or binary
237 +form) with the major components (compiler, kernel, and so on) of the
238 +operating system on which the executable runs, unless that component
239 +itself accompanies the executable.
241 +If distribution of executable or object code is made by offering
242 +access to copy from a designated place, then offering equivalent
243 +access to copy the source code from the same place counts as
244 +distribution of the source code, even though third parties are not
245 +compelled to copy the source along with the object code.
247 + 4. You may not copy, modify, sublicense, or distribute the Program
248 +except as expressly provided under this License. Any attempt
249 +otherwise to copy, modify, sublicense or distribute the Program is
250 +void, and will automatically terminate your rights under this License.
251 +However, parties who have received copies, or rights, from you under
252 +this License will not have their licenses terminated so long as such
253 +parties remain in full compliance.
255 + 5. You are not required to accept this License, since you have not
256 +signed it. However, nothing else grants you permission to modify or
257 +distribute the Program or its derivative works. These actions are
258 +prohibited by law if you do not accept this License. Therefore, by
259 +modifying or distributing the Program (or any work based on the
260 +Program), you indicate your acceptance of this License to do so, and
261 +all its terms and conditions for copying, distributing or modifying
262 +the Program or works based on it.
264 + 6. Each time you redistribute the Program (or any work based on the
265 +Program), the recipient automatically receives a license from the
266 +original licensor to copy, distribute or modify the Program subject to
267 +these terms and conditions. You may not impose any further
268 +restrictions on the recipients' exercise of the rights granted herein.
269 +You are not responsible for enforcing compliance by third parties to
272 + 7. If, as a consequence of a court judgment or allegation of patent
273 +infringement or for any other reason (not limited to patent issues),
274 +conditions are imposed on you (whether by court order, agreement or
275 +otherwise) that contradict the conditions of this License, they do not
276 +excuse you from the conditions of this License. If you cannot
277 +distribute so as to satisfy simultaneously your obligations under this
278 +License and any other pertinent obligations, then as a consequence you
279 +may not distribute the Program at all. For example, if a patent
280 +license would not permit royalty-free redistribution of the Program by
281 +all those who receive copies directly or indirectly through you, then
282 +the only way you could satisfy both it and this License would be to
283 +refrain entirely from distribution of the Program.
285 +If any portion of this section is held invalid or unenforceable under
286 +any particular circumstance, the balance of the section is intended to
287 +apply and the section as a whole is intended to apply in other
290 +It is not the purpose of this section to induce you to infringe any
291 +patents or other property right claims or to contest validity of any
292 +such claims; this section has the sole purpose of protecting the
293 +integrity of the free software distribution system, which is
294 +implemented by public license practices. Many people have made
295 +generous contributions to the wide range of software distributed
296 +through that system in reliance on consistent application of that
297 +system; it is up to the author/donor to decide if he or she is willing
298 +to distribute software through any other system and a licensee cannot
301 +This section is intended to make thoroughly clear what is believed to
302 +be a consequence of the rest of this License.
304 + 8. If the distribution and/or use of the Program is restricted in
305 +certain countries either by patents or by copyrighted interfaces, the
306 +original copyright holder who places the Program under this License
307 +may add an explicit geographical distribution limitation excluding
308 +those countries, so that distribution is permitted only in or among
309 +countries not thus excluded. In such case, this License incorporates
310 +the limitation as if written in the body of this License.
312 + 9. The Free Software Foundation may publish revised and/or new versions
313 +of the General Public License from time to time. Such new versions will
314 +be similar in spirit to the present version, but may differ in detail to
315 +address new problems or concerns.
317 +Each version is given a distinguishing version number. If the Program
318 +specifies a version number of this License which applies to it and "any
319 +later version", you have the option of following the terms and conditions
320 +either of that version or of any later version published by the Free
321 +Software Foundation. If the Program does not specify a version number of
322 +this License, you may choose any version ever published by the Free Software
325 + 10. If you wish to incorporate parts of the Program into other free
326 +programs whose distribution conditions are different, write to the author
327 +to ask for permission. For software which is copyrighted by the Free
328 +Software Foundation, write to the Free Software Foundation; we sometimes
329 +make exceptions for this. Our decision will be guided by the two goals
330 +of preserving the free status of all derivatives of our free software and
331 +of promoting the sharing and reuse of software generally.
335 + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
336 +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
337 +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
338 +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
339 +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
340 +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
341 +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
342 +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
343 +REPAIR OR CORRECTION.
345 + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
346 +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
347 +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
348 +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
349 +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
350 +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
351 +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
352 +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
353 +POSSIBILITY OF SUCH DAMAGES.
355 + END OF TERMS AND CONDITIONS
357 + How to Apply These Terms to Your New Programs
359 + If you develop a new program, and you want it to be of the greatest
360 +possible use to the public, the best way to achieve this is to make it
361 +free software which everyone can redistribute and change under these terms.
363 + To do so, attach the following notices to the program. It is safest
364 +to attach them to the start of each source file to most effectively
365 +convey the exclusion of warranty; and each file should have at least
366 +the "copyright" line and a pointer to where the full notice is found.
368 + <one line to give the program's name and a brief idea of what it does.>
369 + Copyright (C) 19yy <name of author>
371 + This program is free software; you can redistribute it and/or modify
372 + it under the terms of the GNU General Public License as published by
373 + the Free Software Foundation; either version 2 of the License, or
374 + (at your option) any later version.
376 + This program is distributed in the hope that it will be useful,
377 + but WITHOUT ANY WARRANTY; without even the implied warranty of
378 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
379 + GNU General Public License for more details.
381 + You should have received a copy of the GNU General Public License
382 + along with this program; if not, write to the Free Software
383 + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
385 +Also add information on how to contact you by electronic and paper mail.
387 +If the program is interactive, make it output a short notice like this
388 +when it starts in an interactive mode:
390 + Gnomovision version 69, Copyright (C) 19yy name of author
391 + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
392 + This is free software, and you are welcome to redistribute it
393 + under certain conditions; type `show c' for details.
395 +The hypothetical commands `show w' and `show c' should show the appropriate
396 +parts of the General Public License. Of course, the commands you use may
397 +be called something other than `show w' and `show c'; they could even be
398 +mouse-clicks or menu items--whatever suits your program.
400 +You should also get your employer (if you work as a programmer) or your
401 +school, if any, to sign a "copyright disclaimer" for the program, if
402 +necessary. Here is a sample; alter the names:
404 + Yoyodyne, Inc., hereby disclaims all copyright interest in the program
405 + `Gnomovision' (which makes passes at compilers) written by James Hacker.
407 + <signature of Ty Coon>, 1 April 1989
408 + Ty Coon, President of Vice
410 +This General Public License does not permit incorporating your program into
411 +proprietary programs. If your program is a subroutine library, you may
412 +consider it more useful to permit linking proprietary applications with the
413 +library. If this is what you want to do, use the GNU Library General
414 +Public License instead of this License.
415 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/ChangeLog linux-2.2.18-pre2-beos/fs/beos/ChangeLog
416 --- linux-2.2.18-pre2-clean/fs/beos/ChangeLog Wed Dec 31 18:00:00 1969
417 +++ linux-2.2.18-pre2-beos/fs/beos/ChangeLog Sat Sep 2 12:57:10 2000
421 +o Fixed nls conversion routines and changed type of lookup function to
426 +o Modified all to be called beos instead of bfs for future use with 2.4
428 +o Mods to compile/work with 2.2.18-pre2 by Miles Lott <milos@insync.net>
432 +o Added BEOS(ppc) support.
433 +o Added LinuxPPC support.
434 +o Added nls (native language support).
435 +o Fixed using blocksize other than 1024 bytes.
436 +o Fixed memory leaks.
441 +o Added mount option "uid" and "gid".
442 +o Added symbolic link support.
447 +o Release first alpha version.
448 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/Makefile linux-2.2.18-pre2-beos/fs/beos/Makefile
449 --- linux-2.2.18-pre2-clean/fs/beos/Makefile Wed Dec 31 18:00:00 1969
450 +++ linux-2.2.18-pre2-beos/fs/beos/Makefile Thu Aug 24 10:45:24 2000
453 +# Makefile for the linux BEOS-filesystem routines.
455 +# Note! Dependencies are done automagically by 'make dep', which also
456 +# removes any old dependencies. DON'T put your own dependencies here
457 +# unless it's something special (ie not a .c file).
459 +# Note 2! The CFLAGS definitions are now in the main makefile...
462 +O_OBJS := dir.o file.o inode.o namei.o super.o index.o debug.o symlink.o \
464 +M_OBJS := $(O_TARGET)
466 +include $(TOPDIR)/Rules.make
467 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/README linux-2.2.18-pre2-beos/fs/beos/README
468 --- linux-2.2.18-pre2-clean/fs/beos/README Wed Dec 31 18:00:00 1969
469 +++ linux-2.2.18-pre2-beos/fs/beos/README Thu Aug 24 10:45:24 2000
471 +BEOS filesystem for Linux 1999-05-28
476 +Make sure you understand that this is alpha software. This means that the
477 +implementation is neither complete nor well-tested. So using this driver,
483 +This module is BEOS(filesystem of BeOS operating system) driver for Linux
484 +2.2.x / 2.3.x. Current version supports BEOS(x86) and BEOS(ppc).
489 +step 1. Install sources code to source code tree of linux.
493 + tar ~/beos-YYYYMMDD.tar.gz
494 + patch -p1 < linux-2.2.x.patch
496 +step 2. Configuretion & make kernel
500 + make dep; make clean
504 + Note that at 'BEOS Filesystem support', you should answer y(es) ori
505 + m(odule). If you want to use other platform BEOS, you should answer
506 + y(es) aginst 'Other platform BEOS support'.
511 + cp /usr/src/arch/i386/boot/zImage /vmlinuz
512 + make modules_install
517 +To use the BEOS filesystem, use filesystem type 'beos'.
520 + mount -t beos -o type=x86,iocharset=iso8859-1 /dev/fd0 /beos
525 +uid=nnn All files in the partition will be owned by user id nnn.
526 +gid=nnn All files in the partition will be in group nnn.
527 +type=nnn Set filesystem type. nnn is x86 or ppc. Default value is
528 + platform depends (linux-x86 is x86, linux-ppc is ppc).
529 +iocharset=nnn charactor-set. But not support DBCS.
534 +o Current implement supports read-only.
537 +HOW TO GET LASTEST VERSION
538 +==========================
539 +The source and more information can be found in
541 + http://hp.vector.co.jp/authors/VA008030/beos/
546 +Dominic Giampalo ... writing "Practical file system design with Be file
548 +Hiroyuki Yamada ... testing LinuxPPC.
553 +Makoto Kato <m_kato@ga2.so-net.ne.jp>
557 +Miles Lott <milos@insync.net>
558 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/debug.c linux-2.2.18-pre2-beos/fs/beos/debug.c
559 --- linux-2.2.18-pre2-clean/fs/beos/debug.c Wed Dec 31 18:00:00 1969
560 +++ linux-2.2.18-pre2-beos/fs/beos/debug.c Sat Aug 26 09:53:07 2000
563 + * linux/fs/beos/debug.c
565 + * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
571 +#include <linux/kernel.h>
572 +#include <linux/fs.h>
573 +//#include <linux/beos_fs.h>
578 +void beos_dump_inode (beos_inode * inode)
582 + printk (" beos_inode infomation\n");
584 + for (i = 0; i < sizeof(beos_inode); i += 16) {
585 + printk (" %04x:", i);
586 + for (j = 0; j < 16; j++) {
587 + printk (" %02x", *(((char*) inode) + i + j) & 0xff);
592 + printk (" magic1 %08x\n", inode->magic1);
593 + printk (" inode_num %lu, %u %u\n", inode->inode_num.allocation_group,
594 + inode->inode_num.start, inode->inode_num.len);
595 + printk (" uid %lu\n", inode->uid);
596 + printk (" gid %lu\n", inode->gid);
597 + printk (" mode %08x\n", inode->mode);
598 + printk (" flags %08x\n", inode->flags);
599 + printk (" create_time %u\n", inode->create_time >> 8);
600 + printk (" last_modified_time %u\n", inode->last_modified_time >> 8);
601 + printk (" parent %lu, %u, %u\n", inode->parent.allocation_group,
602 + inode->parent.start, inode->parent.len);
603 + printk (" attributes %lu, %u, %u\n",
604 + inode->attributes.allocation_group,
605 + inode->attributes.start, inode->attributes.len);
606 + printk (" type %08x\n", inode->type);
607 + printk (" inode_size %lu\n", inode->inode_size);
609 + if (S_ISLNK(inode->mode)) {
612 + * This is symbolic link.
615 + printk (" Symbolic link [%s]\n", inode->data.symlink);
619 + for (i = 0; i < BEOS_NUM_DIRECT_BLOCKS; i++) {
620 + printk (" direct %d [%lu, %u, %u]\n",
621 + inode->data.datastream.direct[i].allocation_group,
622 + inode->data.datastream.direct[i].start,
623 + inode->data.datastream.direct[i].len);
625 + printk (" max_direct_range %Lu\n",
626 + inode->data.datastream.max_direct_range);
627 + printk (" indirect [%lu, %u, %u]\n",
628 + inode->data.datastream.indirect.allocation_group,
629 + inode->data.datastream.indirect.start,
630 + inode->data.datastream.indirect.len);
631 + printk (" max_indirect_range %016X\n",
632 + inode->data.datastream.max_indirect_range);
633 + printk (" double indirect [%lu, %u, %u]\n",
634 + inode->data.datastream.double_indirect.allocation_group,
635 + inode->data.datastream.double_indirect.start,
636 + inode->data.datastream.double_indirect.len);
637 + printk (" max_double_indirect_range %016X\n",
638 + inode->data.datastream.max_double_indirect_range);
639 + printk (" size %016X\n",
640 + inode->data.datastream.size);
646 + * Display super block structure for debug.
649 +void beos_dump_super_block (beos_super_block * bs)
653 + printk (" beos_super_block information\n");
655 + for (i = 0; i < sizeof(beos_super_block); i += 16) {
656 + printk (" %04x:", i);
657 + for (j = 0; j < 16; j++) {
658 + printk (" %02x", *(((char*) bs) + i + j) & 0xff);
663 + printk (" name %s\n", bs->name);
664 + printk (" magic1 %08x\n", bs->magic1);
665 + printk (" fs_byte_order %08x\n", bs->fs_byte_order);
667 + printk (" block_size %lu\n", bs->block_size);
668 + printk (" block_shift %lu\n", bs->block_shift);
670 + printk (" num_blocks %016X\n", bs->num_blocks);
671 + for (i = 0; i < sizeof(beos_off_t); i++) {
672 + printk( " %02x", *(((char*) &bs->num_blocks) + i) & 0xff);
674 + printk ("\n used_blocks %016X\n", bs->used_blocks);
676 + printk (" magic2 %08x\n", bs->magic2);
677 + printk (" blocks_per_ag %lu\n", bs->blocks_per_ag);
678 + printk (" ag_shift %lu\n", bs->ag_shift);
679 + printk (" num_ags %lu\n", bs->num_ags);
681 + printk (" flags %08x\n", bs->flags);
683 + printk (" log_blocks %lu, %u, %u\n",
684 + bs->log_blocks.allocation_group,
685 + bs->log_blocks.start, bs->log_blocks.len);
686 + printk (" log_start %Ld\n", bs->log_start);
687 + printk (" log_end %Ld\n", bs->log_end);
689 + printk (" magic3 %08x\n", bs->magic3);
690 + printk (" root_dir %lu, %u, %u\n",
691 + bs->root_dir.allocation_group, bs->root_dir.start,
693 + printk (" indices %lu, %u, %u\n",
694 + bs->indices.allocation_group, bs->indices.start,
700 +void beos_dump_small_data (beos_small_data * sd)
706 +void beos_dump_inode_addr (beos_inode_addr iaddr)
708 + printk (" inode addr [%lu, %u, %u]\n",
709 + iaddr.allocation_group, iaddr.start, iaddr.len);
714 +void beos_dump_index_entry (beos_index_entry * entry)
716 + printk (" index entry structure\n");
717 + printk (" magic %08x\n", entry->magic);
718 + printk (" node_size %lu\n", entry->node_size);
719 + printk (" max_number_of_levels %08x\n",
720 + entry->max_number_of_levels);
721 + printk (" data_type %08x\n", entry->data_type);
722 + printk (" root_node_pointer %016X\n", entry->root_node_pointer);
723 + printk (" free_node_pointer %016X\n", entry->free_node_pointer);
724 + printk (" maximum size %016X\n", entry->maximum_size);
728 +void beos_dump_index_node (beos_index_node * node)
730 + printk (" inode of index node structure\n");
731 + printk (" left %016X\n", node->left);
732 + printk (" right %016X\n", node->right);
733 + printk (" overflow %016X\n", node->overflow);
734 + printk (" all_key_count %u\n", node->all_key_count);
735 + printk (" all_key_length %u\n", node->all_key_length);
739 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/dir.c linux-2.2.18-pre2-beos/fs/beos/dir.c
740 --- linux-2.2.18-pre2-clean/fs/beos/dir.c Wed Dec 31 18:00:00 1969
741 +++ linux-2.2.18-pre2-beos/fs/beos/dir.c Sat Sep 2 12:29:12 2000
744 + * linux/fs/beos/dir.c
746 + * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
750 + * linux/fs/minix/dir.c
752 + * Copyright (C) 1991, 1992 Linus Torvalds
755 +#include <asm/uaccess.h>
757 +#include <linux/errno.h>
758 +#include <linux/fs.h>
759 +#include <linux/sched.h>
760 +#include <linux/stat.h>
761 +#include <linux/mm.h>
762 +#include <linux/nls.h>
765 +static ssize_t beos_dir_read (struct file * filp, char * buf, size_t count,
772 +static int beos_readdir(struct file *, void *, filldir_t);
774 +static struct file_operations beos_dir_operations = {
775 + NULL, /* lseek - default */
777 + NULL, /* write - bad */
779 + NULL, /* poll - default */
782 + NULL, /* no special open code */
784 + NULL, /* no special release code */
787 + NULL, /* check_media_change */
788 + NULL /* revalidate */
793 + * directories can handle most operations...
796 +struct inode_operations beos_dir_inode_operations = {
797 + &beos_dir_operations, /* default directory file-ops */
799 + &beos_lookup, /* lookup */
802 + NULL, /* symlink */
807 + NULL, /* readlink */
808 + NULL, /* follow_link */
809 + NULL, /* readpage */
810 + NULL, /* writepage */
812 + NULL, /* truncate */
813 + NULL, /* permission */
820 + * A directory structure of BEOS became index structure.
822 + * struct beos_index_node
825 + * off_t right_link;
826 + * off_t overflow_link;
827 + * short all_node_count;
828 + * short all_key_length
829 + * byte key_data[all_key_length]
830 + * short key_index_count[all_node_count - 1]
831 + * off_t values[all_node_count]
834 + * directry have above key.
835 + * [.] [..] [file and directry] ...
838 +static int beos_readdir(struct file * filp, void * dirent, filldir_t filldir)
840 + struct inode * inode = filp->f_dentry->d_inode;
841 + struct super_block * sb = inode->i_sb;
842 + beos_inode_addr iaddr;
847 + beos_data_stream * ds;
850 + BEOS_OUTPUT (("---> beos_readdir() "
851 + "inode %ld filp->f_pos %lu\n",
852 + inode->i_ino, filp->f_pos));
854 + if (!inode || !S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode))
857 + tmpname = (char *) __getname();
861 + ds = &inode->u.beos_i.i_data.ds;
865 + struct buffer_head * bh;
866 + beos_index_node * bn;
879 + iaddr = beos_read_data_stream (sb, ds, &pos);
880 + if (!pos || BEOS_IS_EMPTY_IADDR(&iaddr))
887 + bh = beos_read_index_node (iaddr, sb, flags, &offset);
890 + BEOS_OUTPUT (("<--- beos_readdir() "
891 + "cannot read index node\n"));
896 + bn = (beos_index_node *) (bh->b_data + offset);
897 + BEOS_DUMP_INDEX_NODE (bn);
900 + * Is there no directry key in this index node?
903 + if (bn->all_key_count + count <= filp->f_pos) {
909 + BEOS_OUTPUT (("key not exist. next...\n"));
910 + count += bn->all_key_count;
916 + k = filp->f_pos - count;
922 + if (!beos_get_key_from_index_node (bn, &k,
923 + sb->u.beos_sb.mount_opts.beos_type, tmpname, &len,
933 + * Convert UTF-8 to nls charset
936 + if (!beos_utf2nls (tmpname, len, &tmpname2, &len_dist, sb)) {
942 + error = filldir (dirent, tmpname2, len_dist, filp->f_pos,
944 + putname (tmpname2);
960 + BEOS_OUTPUT (("<--- beos_readdir() filp->f_pos %d\n",
965 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/file.c linux-2.2.18-pre2-beos/fs/beos/file.c
966 --- linux-2.2.18-pre2-clean/fs/beos/file.c Wed Dec 31 18:00:00 1969
967 +++ linux-2.2.18-pre2-beos/fs/beos/file.c Thu Aug 24 10:45:24 2000
970 + * linux/fs/beos/file.c
972 + * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
976 + * linux/fs/minix/file.c
978 + * Copyright (C) 1991, 1992 Linus Torvalds
981 +#include <asm/uaccess.h>
982 +#include <asm/system.h>
984 +#include <linux/errno.h>
985 +#include <linux/fs.h>
986 +#include <linux/beos_fs.h>
987 +#include <linux/fcntl.h>
988 +#include <linux/sched.h>
989 +#include <linux/stat.h>
990 +#include <linux/locks.h>
991 +#include <linux/mm.h>
992 +#include <linux/pagemap.h>
995 +ssize_t beos_file_read (struct file *, char *, size_t, loff_t *);
996 +static beos_inode_addr beos_startpos_from_ds (struct super_block *,
997 + beos_data_stream *, off_t);
998 +static int beos_read_indirect_block (struct super_block *, const beos_inode_addr,
999 + const int, beos_inode_addr *);
1000 +static int beos_read_double_indirect_block (struct super_block *,
1001 + const beos_inode_addr, const int, beos_inode_addr *);
1002 +static ssize_t beos_file_write (struct file *, const char *, size_t, loff_t *);
1005 +static struct file_operations beos_file_ops =
1009 +#ifdef CONFIG_BEOS_FS_RW
1014 + NULL, /* readdir - bad */
1015 + NULL, /* poll - default */
1016 + NULL, /* ioctl - default */
1017 + generic_file_mmap,
1020 + NULL, /* release */
1024 +struct inode_operations beos_file_inode_operations =
1026 + &beos_file_ops, /* default file operations */
1027 + NULL, /* create */
1028 + NULL, /* lookup */
1030 + NULL, /* unlink */
1031 + NULL, /* symlink */
1035 + NULL, /* rename */
1036 + NULL, /* readlink */
1037 + NULL, /* follow_link */
1038 + generic_readpage, /* readpage */
1039 + NULL, /* writepage */
1040 + &beos_bmap, /* bmap */
1041 + NULL, /* truncate */
1042 + NULL, /* permission */
1047 +ssize_t beos_file_read(struct file *filp, char *buf, size_t count, loff_t *ppos)
1049 + struct inode * inode = filp->f_dentry->d_inode;
1050 + struct super_block * sb = inode->i_sb;
1051 + beos_data_stream * ds = &inode->u.beos_i.i_data.ds;
1052 + beos_inode_addr iaddr;
1053 + beos_inode_addr iaddr2;
1054 + off_t pos = *ppos;
1061 + BEOS_OUTPUT (("---> beos_file_read() "
1062 + "inode %lu count %lu ppos %Lu\n",
1063 + inode->i_ino, (__u32) count, *ppos));
1066 + * Get start position
1070 + iaddr = beos_read_data_stream (sb, ds, &i);
1071 + if (BEOS_IS_EMPTY_IADDR(&iaddr)) {
1072 + BEOS_OUTPUT ((" end data_stream\n"));
1077 + && (pos < sum + iaddr.len * sb->u.beos_sb.block_size)) {
1079 + iaddr.start += (pos - sum) / sb->u.beos_sb.block_size;
1080 + iaddr.len -= (pos - sum) / sb->u.beos_sb.block_size;
1083 + sum += iaddr.len * sb->u.beos_sb.block_size;
1087 + offset = (pos - sum) % sb->u.beos_sb.block_size;
1090 + count = inode->i_size > pos + count ? count : inode->i_size - pos;
1092 + for ( j = 0; j < iaddr.len; j++) {
1094 + struct buffer_head * bh;
1096 + bh = beos_bread2 (sb, iaddr2);
1100 + BEOS_OUTPUT ((" read_count %Ld offset %Ld\n",
1101 + read_count, offset));
1103 + if (count > sb->u.beos_sb.block_size) {
1105 + memcpy (buf + read_count, bh->b_data + offset,
1106 + sb->u.beos_sb.block_size - offset);
1108 + *ppos += sb->u.beos_sb.block_size - offset;
1109 + count -= sb->u.beos_sb.block_size - offset;
1110 + read_count += sb->u.beos_sb.block_size - offset;
1113 + iaddr2.start += 1;
1119 + memcpy (buf + read_count, bh->b_data + offset, count);
1122 + read_count += count;
1129 + ppos += read_count;
1131 + BEOS_OUTPUT (("<--- beos_file_read() "
1132 + "return value %d, ppos %Ld\n", read_count, *ppos));
1134 + return read_count;
1138 + * Read indirect block
1141 +static int beos_read_indirect_block (struct super_block * sb,
1142 + const beos_inode_addr indirect, const int pos,
1143 + beos_inode_addr * iaddr)
1145 + beos_inode_addr * array;
1146 + struct buffer_head * bh;
1147 + beos_inode_addr addr = indirect;
1150 + BEOS_OUTPUT (("---> beos_read_indirect_block()\n"));
1153 + * explore nessealy block
1156 + addr.start += p / BEOS_BLOCK_PER_INODE(sb);
1157 + addr.len -= p / BEOS_BLOCK_PER_INODE(sb);
1159 + if (addr.len < 1) {
1163 + p = p % BEOS_BLOCK_PER_INODE(sb);
1165 + bh = beos_bread2 (sb, addr);
1170 + array = (beos_inode_addr *) bh->b_data;
1173 + * Is this block inode address??
1176 + if (!BEOS_IS_EMPTY_IADDR(&array[p % BEOS_BLOCK_PER_INODE(sb)])) {
1177 + *iaddr = array[p % BEOS_BLOCK_PER_INODE(sb)];
1185 + BEOS_OUTPUT (("<--- beos_read_indirect_block()\n"));
1190 + printk ("BEOS: cannot read indirect block\n");
1195 + * beos_read_double_indirect_block
1198 + * Read double-indirect block
1201 + * sb ... super block
1202 + * double_indirect ... inode address of double-indirect block
1203 + * pos ... position of double-indirect block
1204 + * (*pos - max_direct_block - max_indirect_block)
1210 +static int beos_read_double_indirect_block (struct super_block * sb,
1211 + const beos_inode_addr double_indirect, const int pos,
1212 + beos_inode_addr * iaddr)
1214 + struct buffer_head * bh_indirect;
1216 + beos_inode_addr * indirects;
1217 + beos_inode_addr addr = double_indirect;
1220 + BEOS_OUTPUT (("---> beos_read_double_indirect_block() \n"));
1222 + while (addr.len) {
1223 + bh_indirect = beos_bread2 (sb, addr);
1225 + if (!bh_indirect) {
1226 + BEOS_OUTPUT (("cannot read double-indirect block "
1227 + "[%lu, %u, %u]\n",
1228 + double_indirect.allocation_group,
1229 + double_indirect.start, double_indirect.len));
1236 + indirects = (beos_inode_addr *) bh_indirect->b_data;
1238 + for (i = 0; i < BEOS_BLOCK_PER_INODE(sb); i++) {
1240 + if (p < indirects[i].len * BEOS_BLOCK_PER_INODE(sb)) {
1248 + err = beos_read_indirect_block (sb,
1249 + indirects[i], p, iaddr);
1250 + brelse (bh_indirect);
1255 + p -= indirects[i].len * BEOS_BLOCK_PER_INODE(sb);
1258 + brelse(bh_indirect);
1262 + * cannot find block...
1265 + BEOS_OUTPUT (("cannot find block...\n"));
1271 +beos_inode_addr beos_read_data_stream (struct super_block * sb,
1272 + beos_data_stream * ds, int * pos)
1274 + beos_inode_addr iaddr = {0, 0, 0};
1276 + BEOS_OUTPUT (("---> beos_read_data_stream() "
1277 + "pos %d\n", *pos));
1282 + if (*pos < ds->max_direct_range) {
1285 + * This position is in direct block.
1288 + BEOS_OUTPUT ((" read in direct block [%lu, %u, %u]\n",
1289 + ds->direct[*pos].allocation_group,
1290 + ds->direct[*pos].start, ds->direct[*pos].len));
1293 + * Is this block inode address??
1296 + if (!BEOS_IS_EMPTY_IADDR(&ds->direct[*pos])) {
1297 + iaddr = ds->direct[(*pos)++];
1299 + } else if (*pos < ds->max_indirect_range + ds->max_direct_range) {
1302 + * This position is in in-direct block.
1305 + int p = *pos - ds->max_direct_range;
1307 + BEOS_OUTPUT ((" read in indirect block [%lu, %u, %u]\n",
1308 + ds->indirect.allocation_group, ds->indirect.start,
1309 + ds->indirect.len));
1311 + if (!beos_read_indirect_block (sb, ds->indirect, p, &iaddr)) {
1314 + } else if (*pos < ds->max_double_indirect_range
1315 + + ds->max_direct_range + ds->max_indirect_range) {
1318 + * This position is in double-in-direct block.
1321 + int p = *pos - ds->max_direct_range - ds->max_indirect_range;
1323 + BEOS_OUTPUT ((" read in double indirect block\n"));
1325 + if (!beos_read_double_indirect_block (sb, ds->double_indirect,
1332 + * out of range block
1336 + if (BEOS_IS_EMPTY_IADDR(&iaddr))
1343 + * Get inode address of start position form data stream
1346 +static beos_inode_addr beos_startpos_from_ds (struct super_block * sb,
1347 + beos_data_stream * ds, off_t pos)
1349 + beos_inode_addr iaddr;
1353 + BEOS_OUTPUT (("---> beos_startpos_from_ds()\n"));
1356 + * Get start position
1360 + iaddr = beos_read_data_stream (sb, ds, &i);
1361 + if (BEOS_IS_EMPTY_IADDR(&iaddr)) {
1362 + BEOS_OUTPUT ((" end data_stream\n"));
1367 + && (pos < sum + iaddr.len * sb->u.beos_sb.block_size)) {
1368 + iaddr.start += (pos - sum) / sb->u.beos_sb.block_size;
1369 + iaddr.len -= (pos - sum) / sb->u.beos_sb.block_size;
1372 + sum += iaddr.len * sb->u.beos_sb.block_size;
1375 + BEOS_OUTPUT (("<--- beos_startpos_from_ds()\n"));
1380 +#ifdef CONFIG_BEOS_RW
1381 +static ssize_t beos_file_write (struct file * filp, const char * buf,
1382 + size_t count, loff_t *ppos)
1384 + struct inode * inode = filp->f_dentry->d_inode;
1385 + struct super_block * sb;
1386 +// struct buffer_head * bh;
1387 + beos_data_stream * ds;
1388 + beos_inode_addr iaddr;
1396 + if (!S_ISREG(inode->i_mode)) {
1401 + ds = &inode->u.beos_i.i_data.ds;
1403 + if (filp->f_flags & O_APPEND)
1404 + pos = inode->i_size;
1408 + iaddr = beos_startpos_from_ds (sb, ds, pos);
1411 + if (pos > inode->i_size)
1412 + inode->i_size = pos;
1414 + inode->i_mtime = inode->i_ctime = CURRENT_TIME;
1416 + mark_inode_dirty(inode);
1421 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/index.c linux-2.2.18-pre2-beos/fs/beos/index.c
1422 --- linux-2.2.18-pre2-clean/fs/beos/index.c Wed Dec 31 18:00:00 1969
1423 +++ linux-2.2.18-pre2-beos/fs/beos/index.c Mon Aug 28 18:20:44 2000
1426 + * linux/beos/fs/index.c
1428 + * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
1431 + * Index functions for BEOS.
1434 +#include <asm/uaccess.h>
1436 +#include <linux/errno.h>
1437 +#include <linux/fs.h>
1438 +#include <linux/sched.h>
1439 +#include <linux/stat.h>
1440 +#include <linux/mm.h>
1441 +#include <linux/slab.h>
1444 +static void beos_convert_index_entry (int, beos_index_entry *, beos_index_entry *);
1445 +static void beos_convert_index_node (int, beos_index_node *, beos_index_node *);
1448 + * Convert little-edian and big-edian.
1451 +static void beos_convert_index_entry (int fstype, beos_index_entry * entry,
1452 + beos_index_entry * out)
1457 + out->magic = le32_to_cpu(entry->magic);
1458 + out->node_size = le32_to_cpu(entry->node_size);
1459 + out->max_number_of_levels =
1460 + le32_to_cpu(entry->max_number_of_levels);
1461 + out->data_type = le32_to_cpu(entry->data_type);
1462 + out->root_node_pointer =
1463 + le64_to_cpu(entry->root_node_pointer);
1464 + out->free_node_pointer =
1465 + le64_to_cpu(entry->free_node_pointer);
1466 + out->maximum_size = le64_to_cpu(entry->maximum_size);
1470 + out->magic = be32_to_cpu(entry->magic);
1471 + out->node_size = be32_to_cpu(entry->node_size);
1472 + out->max_number_of_levels =
1473 + be32_to_cpu(entry->max_number_of_levels);
1474 + out->data_type = be32_to_cpu(entry->data_type);
1475 + out->root_node_pointer =
1476 + be64_to_cpu(entry->root_node_pointer);
1477 + out->free_node_pointer =
1478 + be64_to_cpu(entry->free_node_pointer);
1479 + out->maximum_size = be64_to_cpu(entry->maximum_size);
1485 +static void beos_convert_index_node (int fstype, beos_index_node * node,
1486 + beos_index_node * out)
1491 + out->left = le64_to_cpu (node->left);
1492 + out->right = le64_to_cpu (node->right);
1493 + out->overflow = le64_to_cpu (node->overflow);
1494 + out->all_key_count = le16_to_cpu (node->all_key_count);
1495 + out->all_key_length = le16_to_cpu (node->all_key_length);
1499 + out->left = be64_to_cpu (node->left);
1500 + out->right = be64_to_cpu (node->right);
1501 + out->overflow = be64_to_cpu (node->overflow);
1502 + out->all_key_count = be16_to_cpu (node->all_key_count);
1503 + out->all_key_length = be16_to_cpu (node->all_key_length);
1510 + * beos_read_index_node
1513 + * read index node from inode.
1516 + * inode ... address of index node
1517 + * sb ... super block
1518 + * flags ... 0 ... inode is index entry
1519 + * 1 ... inode is index node
1520 + * offset ... offset into index address
1523 +struct buffer_head * beos_read_index_node (beos_inode_addr inode,
1524 + struct super_block * sb, int flags, beos_off_t * offset)
1526 + struct buffer_head * bh;
1527 + beos_inode_addr iaddr;
1528 + beos_index_entry * entry;
1530 + BEOS_OUTPUT (("---> beos_read_index_node() "
1531 + "index [%lu, %u, %u]\n",
1532 + inode.allocation_group, inode.start, inode.len));
1537 + * read index entry
1540 + bh = beos_bread2 (sb, inode);
1542 + printk (KERN_ERR "BEOS: cannot read index entry.\n");
1545 +#ifndef CONFIG_BEOS_CONV
1546 + entry = (beos_index_entry *) bh->b_data;
1548 + entry = (beos_index_entry *) __getname();;
1550 + printk (KERN_ERR "BEOS: cannot allocate memory\n");
1555 + * Convert little-edian and big-edian.
1558 + beos_convert_index_entry (sb->u.beos_sb.mount_opts.beos_type,
1559 + (beos_index_entry *) bh->b_data, entry);
1561 + BEOS_DUMP_INDEX_ENTRY (entry);
1564 + * check magic header
1567 + if (entry->magic != BEOS_INDEX_MAGIC) {
1570 + * bad magic header
1573 + printk (KERN_ERR "BEOS: "
1574 + "magic header of index entry is bad value.\n");
1575 +#ifdef CONFIG_BEOS_CONV
1584 + * set index entry postion
1589 + if (entry->node_size < sb->u.beos_sb.block_size) {
1592 + * exist index node into index entry's block
1595 + *offset = entry->node_size;
1599 + iaddr.start += entry->node_size / sb->u.beos_sb.block_size;
1600 + iaddr.len -= entry->node_size / sb->u.beos_sb.block_size;
1601 + *offset = entry->node_size % sb->u.beos_sb.block_size;
1605 +#ifdef CONFIG_BEOS_CONV
1611 + BEOS_OUTPUT ((" skip index node\n"));
1615 + BEOS_OUTPUT ((" inode of index node\n"));
1616 + BEOS_DUMP_INODE_ADDR (iaddr);
1618 + bh = beos_bread2 (sb, iaddr);
1623 + BEOS_OUTPUT (("<--- beos_read_index_node() offset = %016x\n", *offset));
1630 + * beos_get_key_from_index_node
1633 + * Get key form index node
1636 + * bn ... index node structure
1637 + * pos ... key position
1638 + * fstype ... filesystem type
1639 + * name ... keyname return
1640 + * len ... length of keyname return.
1641 + * iaddr ... key valude return.
1644 +char * beos_get_key_from_index_node (beos_index_node * node, int *pos, int fstype,
1645 + char * name, int * len, beos_off_t * iaddr)
1648 + __u16 * key_array;
1649 + beos_off_t * key_value;
1651 + char * namep = NULL;
1652 + beos_index_node * bn;
1654 + BEOS_OUTPUT (("---> beos_get_key_from_index_node() "
1655 + "pos %d\n", *pos));
1658 + * Convert little-edian and big-edian.
1660 +#ifndef CONFIG_BEOS_CONV
1663 + bn = (beos_index_node *) __getname();
1664 + beos_convert_index_node (fstype, node, bn);
1667 + if (*pos < 0 || bn->all_key_count <= *pos) {
1673 + * Only key_array, byte is 8byte...
1676 + key = (char*) node + sizeof(beos_index_node);
1677 + key_offset = (bn->all_key_length + sizeof(beos_index_node)) % 8;
1678 + key_array = (__u16 *) (key + bn->all_key_length
1679 + + (!key_offset ? 0 : 8 - key_offset));
1680 + key_value = (beos_inode_addr *) (((char *) key_array) + sizeof(__u16)
1681 + * bn->all_key_count);
1685 + char key_test[4096];
1687 + memcpy (key_test, key, bn->all_key_length);
1688 + key_test[bn->all_key_length] = '\0';
1690 + BEOS_OUTPUT ((" key %08x key_array %08x key_value %08x\n",
1691 + (long) key, (long) key_array, (long) key_value));
1693 + BEOS_OUTPUT ((" key content %s\n", key_test));
1695 + for (j = 0; j < *pos; j++) {
1696 + BEOS_OUTPUT ((" key_array[%d] = %Ld ",
1697 + j, key_array[j]));
1698 + BEOS_OUTPUT (("key_value[%d] = %Ld\n", j, key_value[j]));
1707 + *len = le16_to_cpu(key_array[*pos]);
1709 + namep = key + le16_to_cpu(key_array[*pos - 1]);
1710 + *len = le16_to_cpu(key_array[*pos])
1711 + - le16_to_cpu(key_array[*pos - 1]);
1713 + *iaddr = le64_to_cpu(key_value[*pos]);
1719 + *len = be16_to_cpu(key_array[*pos]);
1721 + namep = key + be16_to_cpu(key_array[*pos - 1]);
1722 + *len = be16_to_cpu(key_array[*pos])
1723 + - be16_to_cpu(key_array[*pos - 1]);
1725 + *iaddr = be64_to_cpu(key_value[*pos]);
1730 + * copy from namep to name
1733 + memcpy (name, namep, *len);
1734 + name[*len] = '\0';
1737 +#ifdef CONFIG_BEOS_CONV
1741 + BEOS_OUTPUT (("<--- beos_get_key_from_index_node() "
1742 + "result key [%s], value %Lu\n", name, *iaddr));
1746 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/inode.c linux-2.2.18-pre2-beos/fs/beos/inode.c
1747 --- linux-2.2.18-pre2-clean/fs/beos/inode.c Wed Dec 31 18:00:00 1969
1748 +++ linux-2.2.18-pre2-beos/fs/beos/inode.c Sun Aug 27 21:36:39 2000
1751 + * linux/fs/beos/inode.c
1753 + * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
1757 + * linux/fs/minix/inode.c
1759 + * Copyright (C) 1991, 1992 Linus Torvalds
1762 +#include <asm/uaccess.h>
1763 +#include <asm/system.h>
1765 +#include <linux/errno.h>
1766 +#include <linux/fs.h>
1767 +//#include <linux/beos_fs.h>
1768 +#include <linux/beos_fs_sb.h>
1769 +#include <linux/beos_fs_i.h>
1770 +#include <linux/sched.h>
1771 +#include <linux/stat.h>
1772 +#include <linux/string.h>
1773 +#include <linux/locks.h>
1774 +#include <linux/mm.h>
1777 +//static int beos_update_inode(struct inode *, int);
1780 + * return blocknumber
1783 +int beos_bmap (struct inode * inode, int block)
1785 + struct beos_sb_info bs = inode->i_sb->u.beos_sb;
1786 + struct beos_inode_info bi = inode->u.beos_i;
1788 + BEOS_OUTPUT (("---> Enter beos_bmap\n"));
1790 + BEOS_OUTPUT (("<--- Enter beos_bmap\n"));
1792 + return (bi.i_inode_num.allocation_group << bs.ag_shift)
1793 + + bi.i_inode_num.start;
1798 + * beos_bread function
1800 + * get buffer_header for inode.
1803 +struct buffer_head * beos_bread (struct inode * inode)
1805 + beos_off_t offset;
1806 + struct super_block * sb = inode->i_sb;
1807 + dev_t dev = sb->s_dev;
1809 + BEOS_OUTPUT (("---> Enter beos_read "
1810 + "[%lu, %u, %u]\n",
1811 + inode->u.beos_i.i_inode_num.allocation_group,
1812 + inode->u.beos_i.i_inode_num.start,
1813 + inode->u.beos_i.i_inode_num.len));
1815 + offset = (inode->u.beos_i.i_inode_num.allocation_group
1816 + << sb->u.beos_sb.ag_shift) + inode->u.beos_i.i_inode_num.start;
1818 + BEOS_OUTPUT (("<--- Enter beos_read\n"));
1820 + return bread (dev, offset, sb->s_blocksize);
1824 +struct buffer_head * beos_bread2 (struct super_block * sb, beos_inode_addr inode)
1826 + dev_t dev = sb->s_dev;
1827 + beos_off_t offset;
1829 + BEOS_OUTPUT (("---> Enter beos_read2 "
1830 + "[%lu, %u, %u]\n",
1831 + inode.allocation_group, inode.start, inode.len));
1833 + offset = (inode.allocation_group << sb->u.beos_sb.ag_shift)
1836 + BEOS_OUTPUT (("<--- Enter beos_read2\n"));
1838 + return bread (dev, offset, sb->s_blocksize);
1843 + * Convert little-endian and big-endian
1846 +void beos_convert_inodeaddr (int fstype, beos_inode_addr * iaddr,
1847 + beos_inode_addr * out)
1852 + out->allocation_group = le32_to_cpu(iaddr->allocation_group);
1853 + out->start = le16_to_cpu(iaddr->start);
1854 + out->len = le16_to_cpu(iaddr->len);
1858 + out->allocation_group = be32_to_cpu(iaddr->allocation_group);
1859 + out->start = be16_to_cpu(iaddr->start);
1860 + out->len = be16_to_cpu(iaddr->len);
1865 +static void beos_convert_inode (int fstype, beos_inode *inode, beos_inode * out)
1870 + * Convert data stream.
1876 + out->magic1 = le32_to_cpu(inode->magic1);
1877 + beos_convert_inodeaddr (fstype, &inode->inode_num,
1879 + out->uid = le32_to_cpu(inode->uid);
1880 + out->gid = le32_to_cpu(inode->gid);
1881 + out->mode = le32_to_cpu(inode->mode);
1882 + out->flags = le32_to_cpu(inode->flags);
1883 + out->create_time = le64_to_cpu(inode->create_time);
1884 + out->last_modified_time =
1885 + le64_to_cpu(inode->last_modified_time);
1886 + inode->type = le32_to_cpu(inode->type);
1887 + beos_convert_inodeaddr (fstype, &inode->parent, &out->parent);
1888 + beos_convert_inodeaddr (fstype, &inode->attributes, &out->attributes);
1889 + out->inode_size = le32_to_cpu(inode->inode_size);
1891 + if (!S_ISLNK((umode_t) out->mode)) {
1893 + * Convert data stream.
1896 + for ( i = 0; i < BEOS_NUM_DIRECT_BLOCKS; i++) {
1897 + beos_convert_inodeaddr (fstype,
1898 + &inode->data.datastream.direct[i],
1899 + &out->data.datastream.direct[i]);
1901 + beos_convert_inodeaddr (fstype,
1902 + &inode->data.datastream.indirect,
1903 + &out->data.datastream.indirect);
1904 + beos_convert_inodeaddr (fstype,
1905 + &inode->data.datastream.double_indirect,
1906 + &out->data.datastream.double_indirect);
1908 + out->data.datastream.max_direct_range =
1909 + le64_to_cpu(inode->data.datastream.max_direct_range);
1910 + out->data.datastream.max_indirect_range =
1911 + le64_to_cpu(inode->data.datastream.max_indirect_range);
1912 + out->data.datastream.max_double_indirect_range =
1913 + le64_to_cpu(inode->data.datastream.max_double_indirect_range);
1914 + out->data.datastream.size =
1915 + le64_to_cpu(inode->data.datastream.size);
1920 + out->magic1 = be32_to_cpu(inode->magic1);
1921 + beos_convert_inodeaddr (fstype, &inode->inode_num, &out->inode_num);
1922 + out->uid = be32_to_cpu(inode->uid);
1923 + out->gid = be32_to_cpu(inode->gid);
1924 + out->mode = be32_to_cpu(inode->mode);
1925 + out->flags = be32_to_cpu(inode->flags);
1926 + out->create_time = be64_to_cpu(inode->create_time);
1927 + out->last_modified_time =
1928 + be64_to_cpu(inode->last_modified_time);
1929 + out->type = be32_to_cpu(inode->type);
1930 + beos_convert_inodeaddr (fstype, &inode->parent, &out->parent);
1931 + beos_convert_inodeaddr (fstype, &inode->attributes, &out->attributes);
1932 + out->inode_size = be32_to_cpu(inode->inode_size);
1934 + if (!S_ISLNK((umode_t) out->mode)) {
1937 + * Convert data stream.
1940 + for ( i = 0; i < BEOS_NUM_DIRECT_BLOCKS; i++) {
1941 + beos_convert_inodeaddr (fstype,
1942 + &inode->data.datastream.direct[i],
1943 + &out->data.datastream.direct[i]);
1945 + beos_convert_inodeaddr (fstype,
1946 + &inode->data.datastream.indirect,
1947 + &out->data.datastream.indirect);
1948 + beos_convert_inodeaddr (fstype,
1949 + &inode->data.datastream.double_indirect,
1950 + &out->data.datastream.double_indirect);
1952 + out->data.datastream.max_direct_range =
1953 + be64_to_cpu(inode->data.datastream.max_direct_range);
1954 + out->data.datastream.max_indirect_range =
1955 + be64_to_cpu(inode->data.datastream.max_indirect_range);
1956 + out->data.datastream.max_double_indirect_range =
1957 + be64_to_cpu(inode->data.datastream.max_double_indirect_range);
1958 + out->data.datastream.size =
1959 + be64_to_cpu(inode->data.datastream.size);
1966 +void beos_read_inode (struct inode * inode)
1968 + struct buffer_head * bh = NULL;
1969 + beos_inode * raw_inode = NULL;
1970 + beos_inode * disk_inode;
1974 + BEOS_OUTPUT (("---> beos_read_inode() "
1975 + "inode = %lu[%lu, %u, %u]\n",
1977 + inode->u.beos_i.i_inode_num.allocation_group,
1978 + inode->u.beos_i.i_inode_num.start,
1979 + inode->u.beos_i.i_inode_num.len));
1982 + * convert from vfs's inode number to beos's inode number
1985 + if (inode->i_ino != BEOS_INODE2INO(inode))
1987 + inode->u.beos_i.i_inode_num.allocation_group =
1988 + inode->i_ino >> inode->i_sb->u.beos_sb.ag_shift;
1989 + inode->u.beos_i.i_inode_num.start = inode->i_ino
1990 + & ((2 << inode->i_sb->u.beos_sb.ag_shift) - 1);
1991 + inode->u.beos_i.i_inode_num.len = 1; /* dummy */
1993 + BEOS_OUTPUT ((" real inode number [%lu, %u, %u]\n",
1994 + inode->u.beos_i.i_inode_num.allocation_group,
1995 + inode->u.beos_i.i_inode_num.start,
1996 + inode->u.beos_i.i_inode_num.len));
1999 + bh = beos_bread (inode);
2001 + printk (KERN_ERR "BEOS: unable to read inode block - inode = %lu",
2006 + disk_inode = (beos_inode *) bh->b_data;
2009 + * Convert little-endian or big-endian from beos type.
2011 +#ifdef CONFIG_BEOS_CONV
2012 + raw_inode = (beos_inode *) __getname();
2014 + printk (KERN_ERR "BEOS: not allocate memory - inode = %lu",
2018 + beos_convert_inode (inode->i_sb->u.beos_sb.mount_opts.beos_type,
2019 + disk_inode, raw_inode);
2021 + raw_inode = disk_inode;
2024 + BEOS_DUMP_INODE (raw_inode);
2027 + * inode is current?
2029 + if (raw_inode->magic1 != BEOS_INODE_MAGIC1) {
2031 + "BEOS: this inode is bad magic header - inode = %lu\n",
2036 + if (raw_inode->inode_num != inode->u.beos_i.i_inode_num) {
2037 + printk ("BEOS: huum... there is no inode.\n");
2046 + if (!(raw_inode->flags & BEOS_INODE_IN_USE)) {
2047 + printk (KERN_ERR "BEOS: inode is not used.\n");
2051 + inode->i_mode = (umode_t) raw_inode->mode;
2054 + * set uid and gid. But since current BeOS is single user OS, so
2055 + * you can change by "uid" or "gid" options.
2058 + inode->i_uid = inode->i_sb->u.beos_sb.mount_opts.uid ?
2059 + inode->i_sb->u.beos_sb.mount_opts.uid : (uid_t) raw_inode->uid;
2060 + inode->i_gid = inode->i_sb->u.beos_sb.mount_opts.gid ?
2061 + inode->i_sb->u.beos_sb.mount_opts.gid : (gid_t) raw_inode->gid;
2063 + inode->i_nlink = 1;
2066 + * BEOS don't have access time. So use last modified time.
2069 + inode->i_atime = (time_t) (raw_inode->last_modified_time >> 16);
2072 + * BEOS's time is 64 bits, but current VFS is 32 bits...
2075 + inode->i_ctime = (time_t) (raw_inode->create_time >> 16);
2076 + inode->i_mtime = (time_t) (raw_inode->last_modified_time >> 16);
2078 + inode->i_blksize = raw_inode->inode_size;
2080 + inode->i_blocks = raw_inode->inode_size / inode->i_sb->s_blocksize;
2081 + inode->i_version = ++event;
2082 + inode->u.beos_i.i_inode_num = (beos_inode_addr) raw_inode->inode_num;
2083 + inode->u.beos_i.i_mode = raw_inode->mode;
2084 + inode->u.beos_i.i_flags = raw_inode->flags;
2085 + inode->u.beos_i.i_create_time = raw_inode->create_time;
2086 + inode->u.beos_i.i_last_modified_time = raw_inode->last_modified_time;
2088 + inode->u.beos_i.i_parent = (beos_inode_addr) raw_inode->parent;
2089 + inode->u.beos_i.i_attribute = (beos_inode_addr) raw_inode->attributes;
2092 + * Symbolic link have no data stream.
2093 + * This position is original filename.
2096 + if (!S_ISLNK(inode->i_mode)) {
2097 + inode->i_size = raw_inode->data.datastream.size;
2098 + inode->u.beos_i.i_data.ds = raw_inode->data.datastream;
2100 + inode->i_size = 0;
2101 + memcpy (inode->u.beos_i.i_data.symlink, disk_inode->data.symlink,
2102 + BEOS_SYMLINK_LEN);
2105 + if (S_ISREG(inode->i_mode))
2106 + inode->i_op = &beos_file_inode_operations;
2107 + else if (S_ISDIR(inode->i_mode))
2108 + inode->i_op = &beos_dir_inode_operations;
2109 + else if (S_ISLNK(inode->i_mode))
2110 + inode->i_op = &beos_symlink_inode_operations;
2111 + else if (S_ISCHR(inode->i_mode))
2112 + inode->i_op = &chrdev_inode_operations;
2113 + else if (S_ISBLK(inode->i_mode))
2114 + inode->i_op = &blkdev_inode_operations;
2115 + else if (S_ISFIFO(inode->i_mode))
2118 +#ifdef CONFIG_BEOS_CONV
2119 + putname (raw_inode);
2126 + make_bad_inode(inode);
2127 +#ifdef CONFIG_BEOS_CONV
2129 + putname (raw_inode);
2139 +#ifdef CONFIG_BEOS_RW
2140 +static int beos_update_inode(struct inode * inode, int do_sync)
2142 + struct buffer_head * bh;
2143 + beos_inode * raw_inode;
2146 + bh = beos_bread (inode);
2148 + printk(KERN_ERR "BEOS: "
2149 + "bad inode number on dev %s: %ld is out of range\n",
2150 + bdevname(inode->i_dev), inode->i_ino);
2154 + raw_inode = (beos_inode *) bh->b_data;
2160 + raw_inode->magic1 = BEOS_INODE_MAGIC1;
2161 + raw_inode->inode_num = !IS_EMPTY_IADDR(&inode->u.beos_i.i_inode_num)
2162 + ? inode->u.beos_i.i_inode_num : 0;
2164 + raw_inode->uid = BEOS_DEFAULT_UID;
2165 + raw_inode->gid = BEOS_DEFAULT_GID;
2167 + raw_inode->mode = inode->i_mode;
2168 + raw_inode->flags = inode->u.beos_i.i_flags;
2170 + raw_inode->create_time = ((__u64) inode->i_ctime) << 16;
2171 + raw_inode->last_modified_time = ((__u64) inode->i_mtime) << 16;
2173 + raw_inode->parent = inode->u.beos_i.i_parent;
2174 + raw_inode->attributes = inode->u.beos_i.i_attribute;
2176 + raw_inode->type = inode->u.beos_i.i_type;
2178 + raw_inode->inode_size = inode->i_blksize;
2180 + if (!S_ISLNK(inode->i_mode))
2181 + raw_inode->data.datastream = inode->u.beos_i.i_data.ds;
2183 + memcpy (raw_inode->data.symlink, inode->u.beos_i.i_data.symlink,
2184 + BEOS_SYMLINK_LEN);
2186 + mark_buffer_dirty (bh, 1);
2189 + ll_rw_block (WRITE, 1, &bh);
2190 + wait_on_buffer (bh);
2191 + if (buffer_req (bh) && !buffer_uptodate (bh)) {
2192 + printk (KERN_ERR "BEOS: "
2193 + "IO error syncing inode [%s: %08lx]\n",
2194 + bdevname(inode->i_dev), inode->i_ino);
2204 +void beos_write_inode (struct inode * inode)
2206 + beos_update_inode (inode, 0);
2209 +int beos_sync_inode (struct inode *inode)
2211 + return beos_update_inode (inode, 1);
2214 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/namei.c linux-2.2.18-pre2-beos/fs/beos/namei.c
2215 --- linux-2.2.18-pre2-clean/fs/beos/namei.c Wed Dec 31 18:00:00 1969
2216 +++ linux-2.2.18-pre2-beos/fs/beos/namei.c Sat Sep 2 12:26:55 2000
2219 + * linux/fs/beos/namei.c
2221 + * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
2225 + * linux/fs/minix/namei.c
2227 + * Copyright (C) 1991, 1992 Linus Torvalds
2230 +#include <asm/uaccess.h>
2232 +#include <linux/errno.h>
2233 +#include <linux/fs.h>
2234 +#include <linux/fcntl.h>
2235 +#include <linux/sched.h>
2236 +#include <linux/stat.h>
2237 +#include <linux/string.h>
2238 +#include <linux/locks.h>
2239 +#include <linux/quotaops.h>
2246 + * find file or directory entry
2249 + * dir ... parent's inode
2250 + * name ... file or directry name
2251 + * namelen ... length of name
2254 +static beos_off_t beos_find_entry (struct inode * dir, const char * const name,
2257 + struct buffer_head * bh;
2258 + beos_index_node * bn;
2259 + struct super_block * sb = dir->i_sb;
2262 + char key[BEOS_NAME_LEN + 1];
2267 + printk("BEOS ---> beos_find_entry()\n");
2269 + while (sd_pos >= 0)
2271 + beos_data_stream * ds = &dir->u.beos_i.i_data.ds;
2272 + beos_inode_addr iaddr;
2274 + beos_off_t offset;
2277 + * get index node from small_data.
2279 + * First data stream has index entry, but other than it,
2280 + * doesn't have it.
2288 + iaddr = beos_read_data_stream (sb, ds, &sd_pos);
2292 + * cannot read next data stream
2297 + "BEOS <--- beos_find_entry() cannot read next data stream\n");
2301 + bh = beos_read_index_node (iaddr, sb, flags, &offset);
2305 + * cannot read index node
2310 + "BEOS <--- beos_find_entry() cannot read index node\n");
2314 + bn = (beos_index_node *) (bh->b_data + offset);
2317 + * explore in this block
2321 + while (key_pos >= 0)
2323 + beos_get_key_from_index_node (bn, &key_pos,
2324 + sb->u.beos_sb.mount_opts.beos_type, key,
2325 + &key_len, &value);
2329 + printk("BEOS: key not exist in this block\n");
2333 + if (!strcmp (key, name))
2338 + "BEOS <--- beos_find_entry() value = %Lu\n", value);
2347 + printk("BEOS <--- beos_find_entry() not found\n");
2353 +struct dentry *beos_lookup(struct inode * dir, struct dentry *dentry)
2355 + struct inode * inode = NULL;
2356 + beos_off_t offset;
2357 + unsigned int len = dentry->d_name.len;
2359 + const unsigned char * tmpname = dentry->d_name.name;
2362 + struct super_block * sb = dir->i_sb;
2366 + "BEOS ---> beos_lookup() name '%s' index inode '%ld'\n", tmpname, dir->i_ino);
2369 + * Convert to UTF-8
2371 + // char * beos_nls2utf (unsigned char * src, int srclen, char ** dist,
2372 + // int * len, struct super_block * sb)
2374 + if (!beos_nls2utf (*tmpname, len, &tmpname2, &olen, sb))
2377 + KERN_ERR "BEOS beos_lookup() unable to allocate memory\n");
2378 + return ERR_PTR(-ENOMEM);
2381 + if (olen > BEOS_NAME_LEN)
2384 + KERN_ERR "BEOS beos_lookup() name too long: '\"%s\"'",tmpname2);
2385 + putname (tmpname2);
2386 + return ERR_PTR(-ENAMETOOLONG);
2389 + offset = beos_find_entry (dir, tmpname2, olen);
2390 + putname (tmpname2);
2394 + inode = iget (sb, (ino_t) offset);
2397 + return ERR_PTR(-EACCES);
2401 + d_add (dentry, inode);
2404 + printk("BEOS <--- beos_lookup()\n");
2411 +struct dentry *beos_lookup (struct inode * dir, struct dentry *dentry)
2413 + struct inode * inode = NULL;
2414 + beos_off_t offset;
2415 + unsigned int len = dentry->d_name.len;
2417 + //const unsigned char * tmpname = dentry->d_name.name;
2418 + char * tmpname = dentry->d_name.name;
2420 + struct super_block * sb = dir->i_sb;
2424 + "BEOS ---> beos_lookup() name '%s' index inode '%ld'\n", tmpname, dir->i_ino);
2427 + * Convert to UTF-8
2430 + if (!beos_nls2utf (tmpname, len, &tmpname2, &olen, sb))
2432 + return ERR_PTR(-ENOMEM);
2435 + if (olen > BEOS_NAME_LEN)
2437 + printk("BEOS beos_lookup() name too long: '\"%s\"'",tmpname2);
2438 + putname (tmpname2);
2439 + return ERR_PTR(-ENAMETOOLONG);
2442 + printk("BEOS beos_lookup() name len %i\n",olen);
2444 + offset = beos_find_entry (dir, tmpname2, olen);
2445 + putname (tmpname2);
2449 + inode = iget (sb, (ino_t) offset);
2452 + return ERR_PTR(-EACCES);
2456 + d_add (dentry, inode);
2459 + printk("BEOS <--- beos_lookup()\n");
2466 +int beos_lookup (struct inode * dir, struct dentry *dentry)
2468 + struct inode * inode = NULL;
2469 + beos_off_t offset;
2470 + unsigned int len = dentry->d_name.len;
2472 + //const unsigned char * tmpname = dentry->d_name.name;
2473 + char * tmpname = dentry->d_name.name;
2475 + struct super_block * sb = dir->i_sb;
2479 + "BEOS ---> beos_lookup() name '%s' index inode '%ld'\n", tmpname, dir->i_ino);
2482 + * Convert to UTF-8
2485 + if (!beos_nls2utf (tmpname, len, &tmpname2, &olen, sb))
2490 + if (olen > BEOS_NAME_LEN)
2492 + printk("BEOS beos_lookup() name too long: '\"%s\"'",tmpname2);
2493 + putname (tmpname2);
2494 + return -ENAMETOOLONG;
2497 + printk("BEOS beos_lookup() name len %i\n",olen);
2499 + offset = beos_find_entry (dir, tmpname2, olen);
2500 + putname (tmpname2);
2504 + inode = iget (sb, (ino_t) offset);
2511 + d_add (dentry, inode);
2514 + printk("BEOS <--- beos_lookup()\n");
2519 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/super.c linux-2.2.18-pre2-beos/fs/beos/super.c
2520 --- linux-2.2.18-pre2-clean/fs/beos/super.c Wed Dec 31 18:00:00 1969
2521 +++ linux-2.2.18-pre2-beos/fs/beos/super.c Mon Aug 28 18:02:08 2000
2524 + * linux/fs/beos/super.c
2526 + * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
2530 + * linux/fs/minix/inode.c
2532 + * Copyright (C) 1991, 1992 Linus Torvalds
2535 +#include <linux/module.h>
2537 +#include <stdarg.h>
2539 +#include <asm/bitops.h>
2540 +#include <asm/uaccess.h>
2541 +#include <asm/system.h>
2543 +#include <linux/errno.h>
2544 +#include <linux/fs.h>
2545 +//#include <linux/beos_fs.h>
2546 +#include <linux/malloc.h>
2547 +#include <linux/sched.h>
2548 +#include <linux/stat.h>
2549 +#include <linux/string.h>
2550 +#include <linux/locks.h>
2551 +#include <linux/blkdev.h>
2552 +#include <linux/init.h>
2553 +#include <linux/nls.h>
2556 +void beos_put_super (struct super_block * sb)
2558 + if (sb->u.beos_sb.mount_opts.iocharset) {
2559 + kfree (sb->u.beos_sb.mount_opts.iocharset);
2560 + sb->u.beos_sb.mount_opts.iocharset = NULL;
2563 + if (sb->u.beos_sb.nls) {
2564 + unload_nls (sb->u.beos_sb.nls);
2565 + sb->u.beos_sb.nls = NULL;
2568 + MOD_DEC_USE_COUNT;
2573 +static const struct super_operations beos_sops =
2576 +#ifdef CONFIG_BEOS_FS_RW
2582 + NULL, /* delete */
2583 + NULL, /* notify */
2584 + beos_put_super, /* put_super */
2585 +#ifdef CONFIG_BEOS_FS_RW
2586 + NULL, /* write_super */
2590 + beos_statfs, /* stat_fs */
2591 + beos_remount /* remount_fs */
2595 +static int parse_options (char *, beos_mount_options *);
2596 +static void beos_convert_super_block (int, beos_super_block *, beos_super_block *);
2598 +static int parse_options (char *options, beos_mount_options * opts)
2605 + * Initialize option.
2610 + opts->beos_type = BEOS_PPC;
2612 + opts->beos_type = BEOS_X86;
2618 + for (this_char = strtok (options, ","); this_char != NULL;
2619 + this_char = strtok (NULL, ",")) {
2621 + if ((value = strchr (this_char, '=')) != NULL)
2624 + if (!strcmp (this_char, "uid")) {
2625 + if (!value || !*value) {
2628 + opts->uid = simple_strtoul (value, &value, 0);
2630 + printk (KERN_ERR "BEOS: Invalid uid option: "
2635 + } else if (!strcmp (this_char, "gid")) {
2636 + if (!value || !*value)
2639 + opts->gid = simple_strtoul(value, &value, 0);
2642 + "BEOS: Invalid gid option: "
2647 +#ifdef CONFIG_BEOS_CONV
2648 + } else if (!strcmp (this_char, "type")) {
2649 + if (!value || !*value)
2652 + if (!strcmp (value, "x86")) {
2653 + opts->beos_type = BEOS_X86;
2654 + } else if (!strcmp (value, "ppc")) {
2655 + opts->beos_type = BEOS_PPC;
2658 + "BEOS: unknown filesystem"
2659 + " type: %s\n", value);
2664 + } else if (!strcmp (this_char,"iocharset") && value) {
2668 + while (*value && *value != ',')
2672 + char * buffer = kmalloc (len+1, GFP_KERNEL);
2674 + opts->iocharset = buffer;
2675 + memcpy (buffer, p, len);
2679 + "BEOS: IO charset %s\n", buffer);
2682 + "BEOS: cannot allocate memory\n");
2694 + * Convert big-endian <-> little-endian
2697 +static void beos_convert_super_block (int fstype, beos_super_block * bs,
2698 + beos_super_block * out)
2703 + out->magic1 = le32_to_cpu(bs->magic1);
2704 + out->block_size = le32_to_cpu(bs->block_size);
2705 + out->block_shift = le32_to_cpu(bs->block_shift);
2706 + out->num_blocks = le64_to_cpu(bs->num_blocks);
2707 + out->used_blocks = le64_to_cpu(bs->used_blocks);
2708 + out->inode_size = le32_to_cpu(bs->inode_size);
2709 + out->magic2 = le32_to_cpu(bs->magic2);
2710 + out->blocks_per_ag = le32_to_cpu(bs->blocks_per_ag);
2711 + out->ag_shift = le32_to_cpu(bs->ag_shift);
2712 + out->num_ags = le32_to_cpu(bs->num_ags);
2713 + out->flags = le32_to_cpu(bs->flags);
2714 + beos_convert_inodeaddr (fstype, &(bs->log_blocks),
2715 + &(out->log_blocks));
2716 + out->log_start = le64_to_cpu(bs->log_start);
2717 + out->log_end = le64_to_cpu(bs->log_end);
2718 + out->magic3 = le32_to_cpu(bs->magic3);
2719 + beos_convert_inodeaddr (fstype, &(bs->root_dir),
2720 + &(out->root_dir));
2721 + beos_convert_inodeaddr (fstype, &(bs->indices),
2726 + out->magic1 = be32_to_cpu(bs->magic1);
2727 + out->block_size = be32_to_cpu(bs->block_size);
2728 + out->block_shift = be32_to_cpu(bs->block_shift);
2729 + out->num_blocks = be64_to_cpu(bs->num_blocks);
2730 + out->used_blocks = be64_to_cpu(bs->used_blocks);
2731 + out->inode_size = be32_to_cpu(bs->inode_size);
2732 + out->magic2 = be32_to_cpu(bs->magic2);
2733 + out->blocks_per_ag = be32_to_cpu(bs->blocks_per_ag);
2734 + out->ag_shift = be32_to_cpu(bs->ag_shift);
2735 + out->num_ags = be32_to_cpu(bs->num_ags);
2736 + out->flags = be32_to_cpu(bs->flags);
2737 + beos_convert_inodeaddr (fstype, &(bs->log_blocks),
2738 + &(out->log_blocks));
2739 + out->log_start = be64_to_cpu(bs->log_start);
2740 + out->log_end = be64_to_cpu(bs->log_end);
2741 + out->magic3 = be32_to_cpu(bs->magic3);
2742 + beos_convert_inodeaddr (fstype, &(bs->root_dir),
2743 + &(out->root_dir));
2744 + beos_convert_inodeaddr (fstype, &(bs->indices),
2751 +struct super_block * beos_read_super (struct super_block *sb, void *data,
2754 + beos_super_block * bs = NULL;
2755 + kdev_t dev = sb->s_dev;
2757 + unsigned long logic_sb_block;
2758 + struct buffer_head * bh;
2760 + BEOS_OUTPUT (("---> beos_read_super()\n"));
2766 + if (!parse_options ((char*) data, &sb->u.beos_sb.mount_opts)) {
2767 + printk (KERN_ERR "BEOS: cannot parse mount options\n");
2772 + * Set dummy blocksize to read super block.
2775 + switch (BEOS_TYPE(sb))
2779 + logic_sb_block = 1;
2784 + logic_sb_block = 0;
2788 + printk (KERN_ERR "BEOS: cannot parse filesystem type\n");
2792 + MOD_INC_USE_COUNT;
2794 + set_blocksize (dev, blocksize);
2797 + * Get BEOS super block.
2800 + if (!(bh = bread (dev, logic_sb_block, blocksize))) {
2801 + printk (KERN_ERR "BEOS: unable to read superblock\n");
2802 + goto bad_beos_read_super;
2805 + bs = (beos_super_block *) bh->b_data;
2807 +#ifdef CONFIG_BEOS_CONV
2809 + * Convert byte order
2812 + bs = (beos_super_block *) __getname();
2815 + goto bad_beos_read_super;
2817 + beos_convert_super_block (BEOS_TYPE(sb),
2818 + (beos_super_block *) bh->b_data, bs);
2820 + BEOS_DUMP_SUPER_BLOCK (bs);
2823 + * Check magic headers of super block
2826 + if ((bs->magic1 != BEOS_SUPER_BLOCK_MAGIC1)
2827 + || (bs->magic2 != BEOS_SUPER_BLOCK_MAGIC2)
2828 + || (bs->magic3 != BEOS_SUPER_BLOCK_MAGIC3)) {
2831 + printk (KERN_ERR "BEOS: different magic header\n");
2832 + goto bad_beos_read_super;
2836 + * Check blocksize of BEOS.
2838 + * Blocksize of BEOS is 1024, 2048, 4096 or 8192.
2841 + if( (bs->block_size != 1024)
2842 + && (bs->block_size != 2048)
2843 + && (bs->block_size != 4096)
2844 + && (bs->block_size != 8192)) {
2847 + printk (KERN_ERR "BEOS: different blocksize\n");
2848 + goto bad_beos_read_super;
2851 + set_blocksize (dev, (int) bs->block_size);
2854 + * fill in standard stuff
2857 + sb->s_magic = BEOS_SUPER_MAGIC;
2858 + sb->s_blocksize = (int) bs->block_size;
2860 + sb->u.beos_sb.block_size = bs->block_size;
2861 + sb->u.beos_sb.block_shift = bs->block_shift;
2862 + sb->u.beos_sb.num_blocks = bs->num_blocks;
2863 + sb->u.beos_sb.used_blocks = bs->used_blocks;
2864 + sb->u.beos_sb.inode_size = bs->inode_size;
2866 + sb->u.beos_sb.blocks_per_ag = bs->blocks_per_ag;
2867 + sb->u.beos_sb.ag_shift = bs->ag_shift;
2868 + sb->u.beos_sb.num_ags = bs->num_ags;
2870 + sb->u.beos_sb.log_blocks = bs->log_blocks;
2871 + sb->u.beos_sb.log_start = bs->log_start;
2872 + sb->u.beos_sb.log_end = bs->log_end;
2874 + sb->u.beos_sb.root_dir = bs->root_dir;
2875 + sb->u.beos_sb.indices = bs->indices;
2877 + unlock_super (sb);
2880 + * set up enough so that it can read an inode
2884 + sb->s_op = (struct super_operations *) &beos_sops;
2885 + sb->s_root = d_alloc_root (iget (sb,
2886 + BEOS_IADDR2INO(&(bs->root_dir),bs)), NULL);
2888 + if (!sb->s_root) {
2891 + printk (KERN_ERR "BEOS: get root inode failed\n");
2893 + goto uninit_last_beos_read_super;
2897 + * load nls library
2900 + if (sb->u.beos_sb.mount_opts.iocharset) {
2901 + sb->u.beos_sb.nls =
2902 + load_nls (sb->u.beos_sb.mount_opts.iocharset);
2903 + if (!sb->u.beos_sb.nls) {
2904 + printk (KERN_WARNING "BEOS: cannot load nls/iocharset '%s.' Loading default nls\n",sb->u.beos_sb.mount_opts.iocharset);
2905 + sb->u.beos_sb.nls = load_nls_default ();
2909 + printk (KERN_INFO "BEOS: loaded nls/iocharset '%s'\n",
2910 + sb->u.beos_sb.mount_opts.iocharset);
2917 +#ifdef CONFIG_BEOS_CONV
2923 +bad_beos_read_super:
2925 + unlock_super (sb);
2927 +uninit_last_beos_read_super:
2928 +#ifdef CONFIG_BEOS_CONV
2932 + MOD_DEC_USE_COUNT;
2938 +int beos_remount (struct super_block * sb, int * flags, char * data)
2940 + if (!(*flags & MS_RDONLY))
2946 +static struct file_system_type beos_fs_type = {
2954 +__initfunc(int init_beos_fs(void))
2956 + return register_filesystem(&beos_fs_type);
2960 +MODULE_AUTHOR ("Miles Lott, milos@insync.net");
2961 +MODULE_DESCRIPTION ("BeOS FS Driver for Linux (c)2000");
2964 +int init_module(void)
2966 + printk(KERN_INFO "BEOS: BeOS FS support - http://milosch.net/beos\n");
2967 + return init_beos_fs();
2971 +void cleanup_module(void)
2973 + unregister_filesystem(&beos_fs_type);
2974 + printk(KERN_INFO "BEOS: BeOS FS support unregistered\n");
2980 +int beos_statfs (struct super_block * sb, struct statfs * buf, int bufsiz)
2982 + struct statfs tmp;
2984 + BEOS_OUTPUT (("---> beos_statfs()\n"));
2986 + tmp.f_type = BEOS_SUPER_MAGIC;
2987 + tmp.f_bsize = sb->s_blocksize;
2988 + tmp.f_blocks = sb->u.beos_sb.num_blocks;
2989 + tmp.f_bfree = sb->u.beos_sb.num_blocks - sb->u.beos_sb.used_blocks;
2990 + tmp.f_bavail = sb->u.beos_sb.num_blocks - sb->u.beos_sb.used_blocks;
2993 + tmp.f_namelen = BEOS_NAME_LEN;
2995 + return copy_to_user (buf, &tmp, bufsiz) ? -EFAULT : 0;
2997 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/symlink.c linux-2.2.18-pre2-beos/fs/beos/symlink.c
2998 --- linux-2.2.18-pre2-clean/fs/beos/symlink.c Wed Dec 31 18:00:00 1969
2999 +++ linux-2.2.18-pre2-beos/fs/beos/symlink.c Sun Aug 27 08:49:32 2000
3002 + * linux/fs/beos/symlink.c
3004 + * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
3008 + * linux/fs/minix/symlink.c
3010 + * Copyright (C) 1991, 1992 Linus Torvalds
3013 +#include <asm/uaccess.h>
3015 +#include <linux/errno.h>
3016 +#include <linux/fs.h>
3017 +#include <linux/beos_fs.h>
3018 +#include <linux/sched.h>
3019 +#include <linux/mm.h>
3020 +#include <linux/stat.h>
3022 +static int beos_readlink (struct dentry *, char *, int);
3023 +static struct dentry * beos_follow_link(struct dentry *, struct dentry *,
3027 + * symlinks can't do much...
3029 +struct inode_operations beos_symlink_inode_operations = {
3030 + NULL, /* no file-operations */
3031 + NULL, /* create */
3032 + NULL, /* lookup */
3034 + NULL, /* unlink */
3035 + NULL, /* symlink */
3039 + NULL, /* rename */
3040 + beos_readlink, /* readlink */
3041 + beos_follow_link, /* follow_link */
3042 + NULL, /* readpage */
3043 + NULL, /* writepage */
3045 + NULL, /* truncate */
3046 + NULL, /* permission */
3052 + * The inode of symbolic link is different to data stream.
3053 + * The data stream become link name.
3055 +static struct dentry * beos_follow_link(struct dentry * dentry,
3056 + struct dentry * base, unsigned int follow)
3058 + struct inode * inode = dentry->d_inode;
3059 + char * link = inode->u.beos_i.i_data.symlink;
3061 + UPDATE_ATIME(inode);
3063 + base = lookup_dentry (link, base, follow);
3069 +static int beos_readlink (struct dentry * dentry, char * buffer, int buflen)
3071 + struct inode * inode = dentry->d_inode;
3072 + char * link = inode->u.beos_i.i_data.symlink;
3077 + if (buflen > BEOS_SYMLINK_LEN)
3078 + buflen = BEOS_SYMLINK_LEN;
3080 + while (len < buflen && link[len])
3083 + if (!beos_utf2nls (link, len, &tmpname, &len_dist, inode->i_sb)) {
3087 + if (copy_to_user(buffer, tmpname, len_dist))
3090 + putname (tmpname);
3092 + UPDATE_ATIME(inode);
3096 diff -aur --new-file linux-2.2.18-pre2-clean/fs/beos/util.c linux-2.2.18-pre2-beos/fs/beos/util.c
3097 --- linux-2.2.18-pre2-clean/fs/beos/util.c Wed Dec 31 18:00:00 1969
3098 +++ linux-2.2.18-pre2-beos/fs/beos/util.c Sat Sep 2 12:37:55 2000
3101 + * linux/fs/beos/util.c
3103 + * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
3106 +#include <linux/mm.h>
3107 +#include <linux/fs.h>
3108 +#include <linux/nls.h>
3110 +#define BEOS_UNKNOWN_CHAR '?'
3114 + * UTF-8 to NLS charset convert routine
3116 +char * beos_utf2nls (char * src, int srclen, char ** dist,
3117 + int * len, struct super_block * sb)
3120 + struct nls_table * nls = sb->u.beos_sb.nls;
3121 + char * orig = src;
3124 + BEOS_OUTPUT (("---> utf2nls()\n"));
3126 + *dist = out = (char *) __getname();
3130 + printk(KERN_ERR "BEOS utf2nls: cannot allocate memory\n");
3136 + printk(KERN_INFO "BEOS utf2nls: '%s' not nls\n", src);
3137 + while (*src && srclen-- > 0) { *out++ = *src++; }
3141 + printk(KERN_INFO "BEOS utf2nls: processing nls\n");
3142 + while (*src && srclen > 0)
3145 + unsigned char page;
3149 + * convert from UTF-8 to Unicode
3151 + // int utf8_mbtowc(__u16 *, const __u8 *, int)
3152 + n = utf8_mbtowc(&w, src, srclen);
3156 + * cannot convert from UTF-8 to unicode
3158 + *out++ = BEOS_UNKNOWN_CHAR;
3165 + // printk(KERN_INFO "BEOS utf8_mbtowc: %d\n",w);
3170 + // printk(KERN_INFO "BEOS uni2char: working on %d\n",w);
3171 + nls->uni2char(0x00, w, &page, 20, &olen);
3172 + // printk(KERN_INFO "BEOS uni2char: returned %d\n",page);
3175 + *out++ = BEOS_UNKNOWN_CHAR;
3177 + //*out++ = page[w & 0xff];
3182 + *len = out - (*dist);
3184 + BEOS_OUTPUT (("<--- utf2nls()\n"));
3187 + printk(KERN_INFO "BEOS utf2nls in '%s'\tout '%s' length '%d'\n", orig, *dist, *len);
3193 +char * beos_nls2utf (unsigned char * src, int srclen, char ** dist,
3194 + int * len, struct super_block * sb)
3197 + struct nls_table * nls = sb->u.beos_sb.nls;
3198 + char * orig = src;
3201 + printk(KERN_INFO "BEOS ---> nls2utf()\n");
3203 + *dist = out = (char *) __getname();
3207 + printk(KERN_WARNING "BEOS: cannot allocate memory\n");
3213 + printk(KERN_INFO "BEOS nls2utf: not nls\n");
3214 + while (*src && srclen-- > 0) { *out++ = *src++; }
3218 + printk(KERN_INFO "BEOS nls2utf: processing nls\n");
3219 + while (*src && srclen > 0)
3226 + * convert from nls to unicode
3228 + // printk(KERN_INFO "BEOS char2uni: working on %d\n",*src);
3229 + nls->char2uni(src, &offset, &wh, &wl);
3230 + // printk(KERN_INFO "BEOS char2uni: returned %d\n",wh);
3234 + //w = wh >> 8 << wl;
3236 + //printk(KERN_INFO "BEOS char2uni: %d\n",w);
3238 + * convert from unicode to UTF-8
3240 + n = utf8_wctomb(out, w, 6);
3243 + *out++ = BEOS_UNKNOWN_CHAR;
3251 + *len = out - (*dist);
3254 + printk(KERN_INFO "BEOS <--- nls2utf()\n");
3258 + KERN_INFO "BEOS nls2utf in '%s'\tout '%s' length '%d'\n", orig, *dist,*len);
3262 diff -aur --new-file linux-2.2.18-pre2-clean/fs/filesystems.c linux-2.2.18-pre2-beos/fs/filesystems.c
3263 --- linux-2.2.18-pre2-clean/fs/filesystems.c Thu Aug 24 01:54:28 2000
3264 +++ linux-2.2.18-pre2-beos/fs/filesystems.c Sat Sep 2 12:52:02 2000
3269 +#ifdef CONFIG_BEOS_FS
3273 #ifdef CONFIG_ROMFS_FS
3276 diff -aur --new-file linux-2.2.18-pre2-clean/include/linux/beos_fs.h linux-2.2.18-pre2-beos/include/linux/beos_fs.h
3277 --- linux-2.2.18-pre2-clean/include/linux/beos_fs.h Wed Dec 31 18:00:00 1969
3278 +++ linux-2.2.18-pre2-beos/include/linux/beos_fs.h Sat Sep 2 12:26:25 2000
3281 + * linux/include/linux/beos_fs.h
3283 + * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
3286 +#ifndef _LINUX_BEOS_FS
3287 +#define _LINUX_BEOS_FS
3289 +#include <linux/types.h>
3290 +//#include <linux/fs.h>
3295 +/* #define BEOS_DEBUG */
3298 +#define BEOS_OUTPUT(x) printk x
3299 +#define BEOS_DUMP_SUPER_BLOCK beos_dump_super_block
3300 +#define BEOS_DUMP_INODE beos_dump_inode
3301 +#define BEOS_DUMP_INDEX_ENTRY beos_dump_index_entry
3302 +#define BEOS_DUMP_INDEX_NODE beos_dump_index_node
3303 +#define BEOS_DUMP_INODE_ADDR beos_dump_inode_addr
3305 +#define BEOS_OUTPUT(x)
3306 +#define BEOS_DUMP_SUPER_BLOCK(x)
3307 +#define BEOS_DUMP_INODE(x)
3308 +#define BEOS_DUMP_INDEX_ENTRY(x)
3309 +#define BEOS_DUMP_INDEX_NODE(x)
3310 +#define BEOS_DUMP_INODE_ADDR(x)
3315 + * Flags of superblock
3318 +#define BEOS_CLEAN 0x434c454e
3319 +#define BEOS_DIRTY 0x44495254
3322 + * Max name length of BEOS
3325 +#define BEOS_NAME_LEN 255
3326 +#define BEOS_SYMLINK_LEN 160
3329 + * Magic headers of BEOS's superblock, inode and index
3332 +#define BEOS_SUPER_BLOCK_MAGIC1 0x42465331 /* BEOS1 */
3333 +#define BEOS_SUPER_BLOCK_MAGIC2 0xdd121031
3334 +#define BEOS_SUPER_BLOCK_MAGIC3 0x15b6830e
3336 +#define BEOS_INODE_MAGIC1 0x3bbe0ad9
3338 +#define BEOS_INDEX_MAGIC 0x69f6c2e8
3340 +#define BEOS_SUPER_MAGIC BEOS_SUPER_BLOCK_MAGIC1
3343 +#define BEOS_NUM_DIRECT_BLOCKS 12
3344 +#define BEOS_NAME_LENGTH 32
3347 + * BEOS filesystem type
3354 + * default gid and uid
3357 +#define BEOS_DEFAULT_GID 0
3358 +#define BEOS_DEFAULT_UID 0
3364 +#define BEOS_INODE_IN_USE 0x00000001
3365 +#define BEOS_ATTR_INODE 0x00000004
3366 +#define BEOS_INODE_LOGGED 0x00000008
3367 +#define BEOS_INODE_DELETED 0x00000010
3369 +#define BEOS_PERMANENT_FLAG 0x0000ffff
3371 +#define BEOS_INODE_NO_CREATE 0x00010000
3372 +#define BEOS_INODE_WAS_WRITTEN 0x00020000
3373 +#define BEOS_NO_TRANSACTION 0x00040000
3376 +#define BEOS_IADDR2INO(iaddr,sb) \
3377 + (((iaddr)->allocation_group << (sb)->ag_shift) + (iaddr)->start)
3378 +#define BEOS_INODE2INO(inode) \
3379 + (((inode)->u.beos_i.i_inode_num.allocation_group << \
3380 + (inode)->i_sb->u.beos_sb.ag_shift) \
3381 + + (inode)->u.beos_i.i_inode_num.start)
3383 +#define BEOS_BLOCK_PER_INODE(sb) \
3384 + ((sb)->u.beos_sb.block_size / sizeof(beos_inode_addr))
3386 +#define BEOS_IS_EMPTY_IADDR(iaddr) \
3387 + ((!(iaddr)->allocation_group) && (!(iaddr)->start) && (!(iaddr)->len))
3389 +#define BEOS_TYPE(sb) \
3390 + ((sb)->u.beos_sb.mount_opts.beos_type)
3393 + * special type of BEOS
3396 +typedef long long beos_off_t;
3397 +typedef long long beos_bigtime_t;
3398 +typedef void beos_binode_etc;
3402 +typedef struct _beos_block_run {
3403 + __u32 allocation_group;
3409 +typedef beos_block_run beos_inode_addr;
3413 + * The Superblock Structure
3416 +typedef struct _beos_super_block {
3417 + char name[BEOS_NAME_LENGTH];
3419 + __u32 fs_byte_order;
3422 + __u32 block_shift;
3424 + beos_off_t num_blocks;
3425 + beos_off_t used_blocks;
3430 + __u32 blocks_per_ag;
3436 + beos_block_run log_blocks;
3437 + beos_off_t log_start;
3438 + beos_off_t log_end;
3441 + beos_inode_addr root_dir;
3442 + beos_inode_addr indices;
3445 +} __attribute__ ((packed)) beos_super_block;
3448 +typedef struct _beos_data_stream {
3449 + beos_block_run direct[BEOS_NUM_DIRECT_BLOCKS];
3450 + beos_off_t max_direct_range;
3451 + beos_block_run indirect;
3452 + beos_off_t max_indirect_range;
3453 + beos_block_run double_indirect;
3454 + beos_off_t max_double_indirect_range;
3456 +} __attribute__ ((packed)) beos_data_stream;
3460 +typedef struct _beos_small_data {
3465 +} __attribute__ ((packed)) beos_small_data;
3468 +/* Inode structure */
3469 +typedef struct _beos_inode {
3471 + beos_inode_addr inode_num;
3476 + beos_bigtime_t create_time;
3477 + beos_bigtime_t last_modified_time;
3478 + beos_inode_addr parent;
3479 + beos_inode_addr attributes;
3483 + __u32 etc; /* not use */
3486 + beos_data_stream datastream;
3487 + char symlink[BEOS_SYMLINK_LEN];
3489 + __u32 pad[4]; /* not use */
3490 +} __attribute__ ((packed)) beos_inode;
3493 +typedef struct _beos_index_entry {
3496 + __u32 max_number_of_levels;
3498 + beos_off_t root_node_pointer;
3499 + beos_off_t free_node_pointer;
3500 + beos_off_t maximum_size;
3501 +} __attribute__ ((packed)) beos_index_entry;
3504 +typedef struct _beos_index_node {
3507 + beos_off_t overflow;
3508 + __u16 all_key_count;
3509 + __u16 all_key_length;
3510 +} __attribute__ ((packed)) beos_index_node;
3513 +typedef struct _beos_mount_options {
3518 +} beos_mount_options;
3523 + * Function prototypes
3527 +extern int beos_read (struct inode *, struct file *, char *, int);
3528 +extern beos_inode_addr beos_read_data_stream (struct super_block *,
3529 + beos_data_stream *, int *);
3532 +extern int beos_bmap (struct inode *, int);
3533 +extern void beos_read_inode (struct inode *);
3534 +extern struct buffer_head * beos_bread (struct inode *);
3535 +extern struct buffer_head * beos_bread2 (struct super_block *, beos_inode_addr);
3536 +extern void beos_write_inode (struct inode *);
3537 +extern int beos_sync_inode (struct inode *);
3538 +extern void beos_convert_inodeaddr (
3539 + int fstype, beos_inode_addr * iaddr, beos_inode_addr * out);
3542 +extern void beos_release (struct inode *, struct file *);
3543 +//extern int beos_lookup (struct inode *, struct dentry *);
3544 +extern struct dentry * beos_lookup (struct inode *, struct dentry *);
3547 +extern void beos_put_super (struct super_block *);
3548 +extern int beos_remount (struct super_block *, int *, char *);
3549 +extern struct super_block * beos_read_super (struct super_block *,void *,int);
3550 +extern int init_beos_fs(void);
3551 +extern int beos_statfs (struct super_block *, struct statfs *, int);
3554 +extern char * beos_get_key_from_index_node (beos_index_node *, int *, int,
3555 + char *, int *, beos_off_t *);
3556 +extern struct buffer_head * beos_read_index_node (beos_inode_addr,
3557 + struct super_block *, int, beos_off_t *);
3560 +extern void beos_dump_super_block (beos_super_block *);
3561 +extern void beos_dump_inode (beos_inode *);
3562 +extern void beos_dump_index_entry (beos_index_entry *);
3563 +extern void beos_dump_index_node (beos_index_node *);
3566 +extern char * beos_utf2nls (char *, int, char **, int *, struct super_block *);
3567 +extern char * beos_nls2utf (unsigned char *, int, char **, int *, struct super_block *);
3570 + * Inodes and files operations
3574 +extern struct inode_operations beos_dir_inode_operations;
3577 +extern struct inode_operations beos_file_inode_operations;
3580 +extern struct inode_operations beos_symlink_inode_operations;
3582 +#endif /* __KERNEL__ */
3585 diff -aur --new-file linux-2.2.18-pre2-clean/include/linux/beos_fs_i.h linux-2.2.18-pre2-beos/include/linux/beos_fs_i.h
3586 --- linux-2.2.18-pre2-clean/include/linux/beos_fs_i.h Wed Dec 31 18:00:00 1969
3587 +++ linux-2.2.18-pre2-beos/include/linux/beos_fs_i.h Sat Sep 2 12:26:30 2000
3590 + * linux/include/linux/beos_fs_i.h
3592 + * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
3596 + * linux/include/linux/ex2_fs_i.h
3599 +#ifndef _LINUX_BEOS_FS_I_
3600 +#define _LINUX_BEOS_FS_I_
3602 +#include <linux/beos_fs.h>
3604 +struct beos_inode_info {
3605 + beos_inode_addr i_inode_num;
3611 + beos_bigtime_t i_create_time;
3612 + beos_bigtime_t i_last_modified_time;
3614 + beos_inode_addr i_parent;
3615 + beos_inode_addr i_attribute;
3620 + beos_data_stream ds;
3621 + char symlink[BEOS_SYMLINK_LEN];
3625 +#endif /* _LINUX_BEOS_FS_I_ */
3626 diff -aur --new-file linux-2.2.18-pre2-clean/include/linux/beos_fs_sb.h linux-2.2.18-pre2-beos/include/linux/beos_fs_sb.h
3627 --- linux-2.2.18-pre2-clean/include/linux/beos_fs_sb.h Wed Dec 31 18:00:00 1969
3628 +++ linux-2.2.18-pre2-beos/include/linux/beos_fs_sb.h Sat Sep 2 12:26:30 2000
3631 + * linux/include/linux/beos_fs_sb.h
3633 + * Copyright (C) 1999 Makoto Kato (m_kato@ga2.so-net.ne.jp)
3636 +#ifndef _LINUX_BEOS_FS_SB
3637 +#define _LINUX_BEOS_FS_SB
3639 +#include <linux/types.h>
3640 +#include <linux/beos_fs.h>
3643 +struct beos_sb_info {
3645 + __u32 block_shift;
3646 + beos_off_t num_blocks;
3647 + beos_off_t used_blocks;
3651 + * Allocation group information
3654 + __u32 blocks_per_ag;
3659 + * jornal log entry
3662 + beos_block_run log_blocks;
3663 + beos_off_t log_start;
3664 + beos_off_t log_end;
3666 + beos_inode_addr root_dir;
3667 + beos_inode_addr indices;
3669 + beos_mount_options mount_opts;
3671 + struct nls_table * nls;
3674 diff -aur --new-file linux-2.2.18-pre2-clean/include/linux/fs.h linux-2.2.18-pre2-beos/include/linux/fs.h
3675 --- linux-2.2.18-pre2-clean/include/linux/fs.h.orig Mon Sep 4 20:57:21 2000
3676 +++ linux-2.2.18-pre2-clean/include/linux/fs.h Mon Sep 4 21:01:43 2000
3678 #include <linux/adfs_fs_i.h>
3679 #include <linux/qnx4_fs_i.h>
3680 #include <linux/usbdev_fs_i.h>
3681 +#include <linux/beos_fs_i.h>
3684 * Attribute flags. These should be or-ed together to figure out what
3686 struct qnx4_inode_info qnx4_i;
3687 struct usbdev_inode_info usbdev_i;
3688 struct socket socket_i;
3689 + struct beos_inode_info beos_i;
3694 #include <linux/adfs_fs_sb.h>
3695 #include <linux/qnx4_fs_sb.h>
3696 #include <linux/usbdev_fs_sb.h>
3697 +#include <linux/beos_fs_sb.h>
3699 extern struct list_head super_blocks;
3702 struct adfs_sb_info adfs_sb;
3703 struct qnx4_sb_info qnx4_sb;
3704 struct usbdev_sb_info usbdevfs_sb;
3705 + struct beos_sb_info beos_sb;