]> git.saurik.com Git - apple/xnu.git/blob - bsd/ufs/ufs/ufs_bmap.c
86cf8a596a8ad88c8cf2eea4ff6a3c769ec8d99b
[apple/xnu.git] / bsd / ufs / ufs / ufs_bmap.c
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22 /* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
23 /*
24 * Copyright (c) 1989, 1991, 1993
25 * The Regents of the University of California. All rights reserved.
26 * (c) UNIX System Laboratories, Inc.
27 * All or some portions of this file are derived from material licensed
28 * to the University of California by American Telephone and Telegraph
29 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
30 * the permission of UNIX System Laboratories, Inc.
31 *
32 * Redistribution and use in source and binary forms, with or without
33 * modification, are permitted provided that the following conditions
34 * are met:
35 * 1. Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * 2. Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in the
39 * documentation and/or other materials provided with the distribution.
40 * 3. All advertising materials mentioning features or use of this software
41 * must display the following acknowledgement:
42 * This product includes software developed by the University of
43 * California, Berkeley and its contributors.
44 * 4. Neither the name of the University nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
47 *
48 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
49 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE.
59 *
60 * @(#)ufs_bmap.c 8.7 (Berkeley) 3/21/95
61 */
62 /*
63 * HISTORY
64 * 11-July-97 Umesh Vaishampayan (umeshv@apple.com)
65 * Cleanup. Fixed compilation error when tracing is turned on.
66 */
67 #include <rev_endian_fs.h>
68 #include <sys/param.h>
69 #include <sys/buf.h>
70 #include <sys/proc.h>
71 #include <sys/vnode.h>
72 #include <sys/mount.h>
73 #include <sys/resourcevar.h>
74 #include <sys/trace.h>
75 #include <sys/quota.h>
76
77 #include <miscfs/specfs/specdev.h>
78
79 #include <ufs/ufs/quota.h>
80 #include <ufs/ufs/inode.h>
81 #include <ufs/ufs/ufsmount.h>
82 #include <ufs/ufs/ufs_extern.h>
83 #if REV_ENDIAN_FS
84 #include <ufs/ufs/ufs_byte_order.h>
85 #include <architecture/byte_order.h>
86 #endif /* REV_ENDIAN_FS */
87
88 /*
89 * Bmap converts a the logical block number of a file to its physical block
90 * number on the disk. The conversion is done by using the logical block
91 * number to index into the array of block pointers described by the dinode.
92 */
93 int
94 ufs_bmap(ap)
95 struct vop_bmap_args /* {
96 struct vnode *a_vp;
97 ufs_daddr_t a_bn;
98 struct vnode **a_vpp;
99 ufs_daddr_t *a_bnp;
100 int *a_runp;
101 } */ *ap;
102 {
103 /*
104 * Check for underlying vnode requests and ensure that logical
105 * to physical mapping is requested.
106 */
107 if (ap->a_vpp != NULL)
108 *ap->a_vpp = VTOI(ap->a_vp)->i_devvp;
109 if (ap->a_bnp == NULL)
110 return (0);
111
112 return (ufs_bmaparray(ap->a_vp, ap->a_bn, ap->a_bnp, NULL, NULL,
113 ap->a_runp));
114 }
115
116 /*
117 * Indirect blocks are now on the vnode for the file. They are given negative
118 * logical block numbers. Indirect blocks are addressed by the negative
119 * address of the first data block to which they point. Double indirect blocks
120 * are addressed by one less than the address of the first indirect block to
121 * which they point. Triple indirect blocks are addressed by one less than
122 * the address of the first double indirect block to which they point.
123 *
124 * ufs_bmaparray does the bmap conversion, and if requested returns the
125 * array of logical blocks which must be traversed to get to a block.
126 * Each entry contains the offset into that block that gets you to the
127 * next block and the disk address of the block (if it is assigned).
128 */
129
130 int
131 ufs_bmaparray(vp, bn, bnp, ap, nump, runp)
132 struct vnode *vp;
133 ufs_daddr_t bn;
134 ufs_daddr_t *bnp;
135 struct indir *ap;
136 int *nump;
137 int *runp;
138 {
139 register struct inode *ip;
140 struct buf *bp;
141 struct ufsmount *ump;
142 struct mount *mp;
143 struct vnode *devvp;
144 struct indir a[NIADDR], *xap;
145 ufs_daddr_t daddr;
146 long metalbn;
147 int error, maxrun, num;
148 #if REV_ENDIAN_FS
149 int rev_endian=0;
150 #endif /* REV_ENDIAN_FS */
151
152 ip = VTOI(vp);
153 mp = vp->v_mount;
154 ump = VFSTOUFS(mp);
155
156 #if REV_ENDIAN_FS
157 rev_endian=(mp->mnt_flag & MNT_REVEND);
158 #endif /* REV_ENDIAN_FS */
159
160 #if DIAGNOSTIC
161 if (ap != NULL && nump == NULL || ap == NULL && nump != NULL)
162 panic("ufs_bmaparray: invalid arguments");
163 #endif
164
165 if (runp) {
166 /*
167 * XXX
168 * If MAXPHYSIO is the largest transfer the disks can handle,
169 * we probably want maxrun to be 1 block less so that we
170 * don't create a block larger than the device can handle.
171 */
172 *runp = 0;
173 maxrun = MAXPHYSIO / mp->mnt_stat.f_iosize - 1;
174 }
175
176 xap = ap == NULL ? a : ap;
177 if (!nump)
178 nump = &num;
179 if (error = ufs_getlbns(vp, bn, xap, nump))
180 return (error);
181
182 num = *nump;
183 if (num == 0) {
184 *bnp = blkptrtodb(ump, ip->i_db[bn]);
185 if (*bnp == 0)
186 *bnp = -1;
187 else if (runp)
188 for (++bn; bn < NDADDR && *runp < maxrun &&
189 is_sequential(ump, ip->i_db[bn - 1], ip->i_db[bn]);
190 ++bn, ++*runp);
191 return (0);
192 }
193
194
195 /* Get disk address out of indirect block array */
196 daddr = ip->i_ib[xap->in_off];
197
198 devvp = VFSTOUFS(vp->v_mount)->um_devvp;
199 for (bp = NULL, ++xap; --num; ++xap) {
200 /*
201 * Exit the loop if there is no disk address assigned yet and
202 * the indirect block isn't in the cache, or if we were
203 * looking for an indirect block and we've found it.
204 */
205
206 metalbn = xap->in_lbn;
207 if (daddr == 0 && !incore(vp, metalbn) || metalbn == bn)
208 break;
209 /*
210 * If we get here, we've either got the block in the cache
211 * or we have a disk address for it, go fetch it.
212 */
213 if (bp)
214 brelse(bp);
215
216 xap->in_exists = 1;
217 bp = getblk(vp, metalbn, mp->mnt_stat.f_iosize, 0, 0, BLK_META);
218 if (bp->b_flags & (B_DONE | B_DELWRI)) {
219 trace(TR_BREADHIT, pack(vp, mp->mnt_stat.f_iosize), metalbn);
220 }
221 #if DIAGNOSTIC
222 else if (!daddr)
223 panic("ufs_bmaparry: indirect block not in cache");
224 #endif
225 else {
226 trace(TR_BREADMISS, pack(vp, mp->mnt_stat.f_iosize), metalbn);
227 bp->b_blkno = blkptrtodb(ump, daddr);
228 bp->b_flags |= B_READ;
229 VOP_STRATEGY(bp);
230 current_proc()->p_stats->p_ru.ru_inblock++; /* XXX */
231 if (error = biowait(bp)) {
232 brelse(bp);
233 return (error);
234 }
235 }
236
237 daddr = ((ufs_daddr_t *)bp->b_data)[xap->in_off];
238 #if REV_ENDIAN_FS
239 if (rev_endian)
240 daddr = NXSwapLong(daddr);
241 #endif /* REV_ENDIAN_FS */
242 if (num == 1 && daddr && runp) {
243 #if REV_ENDIAN_FS
244 if (rev_endian) {
245 for (bn = xap->in_off + 1;
246 bn < MNINDIR(ump) && *runp < maxrun &&
247 is_sequential(ump,
248 NXSwapLong(((ufs_daddr_t *)bp->b_data)[bn - 1]),
249 NXSwapLong(((ufs_daddr_t *)bp->b_data)[bn]));
250 ++bn, ++*runp);
251 } else {
252 #endif /* REV_ENDIAN_FS */
253 for (bn = xap->in_off + 1;
254 bn < MNINDIR(ump) && *runp < maxrun &&
255 is_sequential(ump,
256 ((ufs_daddr_t *)bp->b_data)[bn - 1],
257 ((ufs_daddr_t *)bp->b_data)[bn]);
258 ++bn, ++*runp);
259 #if REV_ENDIAN_FS
260 }
261 #endif /* REV_ENDIAN_FS */
262 }
263 }
264 if (bp)
265 brelse(bp);
266
267 daddr = blkptrtodb(ump, daddr);
268 *bnp = daddr == 0 ? -1 : daddr;
269 return (0);
270 }
271
272 /*
273 * Create an array of logical block number/offset pairs which represent the
274 * path of indirect blocks required to access a data block. The first "pair"
275 * contains the logical block number of the appropriate single, double or
276 * triple indirect block and the offset into the inode indirect block array.
277 * Note, the logical block number of the inode single/double/triple indirect
278 * block appears twice in the array, once with the offset into the i_ib and
279 * once with the offset into the page itself.
280 */
281 int
282 ufs_getlbns(vp, bn, ap, nump)
283 struct vnode *vp;
284 ufs_daddr_t bn;
285 struct indir *ap;
286 int *nump;
287 {
288 long metalbn, realbn;
289 struct ufsmount *ump;
290 int blockcnt, i, numlevels, off;
291
292 ump = VFSTOUFS(vp->v_mount);
293 if (nump)
294 *nump = 0;
295 numlevels = 0;
296 realbn = bn;
297 if ((long)bn < 0)
298 bn = -(long)bn;
299
300 /* The first NDADDR blocks are direct blocks. */
301 if (bn < NDADDR)
302 return (0);
303
304 /*
305 * Determine the number of levels of indirection. After this loop
306 * is done, blockcnt indicates the number of data blocks possible
307 * at the given level of indirection, and NIADDR - i is the number
308 * of levels of indirection needed to locate the requested block.
309 */
310 for (blockcnt = 1, i = NIADDR, bn -= NDADDR;; i--, bn -= blockcnt) {
311 if (i == 0)
312 return (EFBIG);
313 blockcnt *= MNINDIR(ump);
314 if (bn < blockcnt)
315 break;
316 }
317
318 /* Calculate the address of the first meta-block. */
319 if (realbn >= 0)
320 metalbn = -(realbn - bn + NIADDR - i);
321 else
322 metalbn = -(-realbn - bn + NIADDR - i);
323
324 /*
325 * At each iteration, off is the offset into the bap array which is
326 * an array of disk addresses at the current level of indirection.
327 * The logical block number and the offset in that block are stored
328 * into the argument array.
329 */
330 ap->in_lbn = metalbn;
331 ap->in_off = off = NIADDR - i;
332 ap->in_exists = 0;
333 ap++;
334 for (++numlevels; i <= NIADDR; i++) {
335 /* If searching for a meta-data block, quit when found. */
336 if (metalbn == realbn)
337 break;
338
339 blockcnt /= MNINDIR(ump);
340 off = (bn / blockcnt) % MNINDIR(ump);
341
342 ++numlevels;
343 ap->in_lbn = metalbn;
344 ap->in_off = off;
345 ap->in_exists = 0;
346 ++ap;
347
348 metalbn -= -1 + off * blockcnt;
349 }
350 if (nump)
351 *nump = numlevels;
352 return (0);
353 }
354 /*
355 * Cmap converts a the file offset of a file to its physical block
356 * number on the disk And returns contiguous size for transfer.
357 */
358 int
359 ufs_cmap(ap)
360 struct vop_cmap_args /* {
361 struct vnode *a_vp;
362 off_t a_foffset;
363 size_t a_size;
364 daddr_t *a_bpn;
365 size_t *a_run;
366 void *a_poff;
367 } */ *ap;
368 {
369 struct vnode * vp = ap->a_vp;
370 ufs_daddr_t *bnp = ap->a_bpn;
371 size_t *runp = ap->a_run;
372 int size = ap->a_size;
373 daddr_t bn;
374 int nblks;
375 register struct inode *ip;
376 ufs_daddr_t daddr = 0;
377 int devBlockSize=0;
378 struct fs *fs;
379 int retsize=0;
380 int error=0;
381
382 ip = VTOI(vp);
383 fs = ip->i_fs;
384
385
386 if (blkoff(fs, ap->a_foffset)) {
387 panic("ufs_cmap; allocation requested inside a block");
388 }
389
390 bn = (daddr_t)lblkno(fs, ap->a_foffset);
391 VOP_DEVBLOCKSIZE(ip->i_devvp, &devBlockSize);
392
393 if (size % devBlockSize) {
394 panic("ufs_cmap: size is not multiple of device block size\n");
395 }
396
397 if (error = VOP_BMAP(vp, bn, (struct vnode **) 0, &daddr, &nblks)) {
398 return(error);
399 }
400
401 retsize = nblks * fs->fs_bsize;
402
403 if (bnp)
404 *bnp = daddr;
405
406 if (ap->a_poff)
407 *(int *)ap->a_poff = 0;
408
409 if (daddr == -1) {
410 if (size < fs->fs_bsize) {
411 retsize = fragroundup(fs, size);
412 if(size >= retsize)
413 *runp = retsize;
414 else
415 *runp = size;
416 } else {
417 *runp = fs->fs_bsize;
418 }
419 return(0);
420 }
421
422 if (runp) {
423 if ((size < fs->fs_bsize)) {
424 *runp = size;
425 return(0);
426 }
427 if (retsize) {
428 retsize += fs->fs_bsize;
429 if(size >= retsize)
430 *runp = retsize;
431 else
432 *runp = size;
433 } else {
434 if (size < fs->fs_bsize) {
435 retsize = fragroundup(fs, size);
436 if(size >= retsize)
437 *runp = retsize;
438 else
439 *runp = size;
440 } else {
441 *runp = fs->fs_bsize;
442 }
443 }
444 }
445 return (0);
446 }
447
448
449 #if NOTTOBEUSED
450 /*
451 * Cmap converts a the file offset of a file to its physical block
452 * number on the disk And returns contiguous size for transfer.
453 */
454 int
455 ufs_cmap(ap)
456 struct vop_cmap_args /* {
457 struct vnode *a_vp;
458 off_t a_foffset;
459 size_t a_size;
460 daddr_t *a_bpn;
461 size_t *a_run;
462 void *a_poff;
463 } */ *ap;
464 {
465 struct vnode * vp = ap->a_vp;
466 ufs_daddr_t *bnp = ap->a_bpn;
467 size_t *runp = ap->a_run;
468 daddr_t bn;
469 int nblks, blks;
470 int *nump;
471 register struct inode *ip;
472 struct buf *bp;
473 struct ufsmount *ump;
474 struct mount *mp;
475 struct vnode *devvp;
476 struct indir a[NIADDR], *xap;
477 ufs_daddr_t daddr;
478 long metalbn;
479 int error, maxrun, num;
480 int devBlockSize=0;
481 struct fs *fs;
482 int size = ap->a_size;
483 int block_offset=0;
484 int retsize=0;
485 #if 1
486 daddr_t orig_blkno;
487 daddr_t orig_bblkno;
488 #endif /* 1 */
489 #if REV_ENDIAN_FS
490 int rev_endian=0;
491 #endif /* REV_ENDIAN_FS */
492
493 ip = VTOI(vp);
494 fs = ip->i_fs;
495
496 mp = vp->v_mount;
497 ump = VFSTOUFS(mp);
498
499 VOP_DEVBLOCKSIZE(ip->i_devvp, &devBlockSize);
500 bn = (daddr_t)lblkno(fs, ap->a_foffset);
501
502 if (size % devBlockSize) {
503 panic("ufs_cmap: size is not multiple of device block size\n");
504 }
505
506 block_offset = blkoff(fs, ap->a_foffset);
507 if (block_offset) {
508 panic("ufs_cmap; allocation requested inside a block");
509 }
510
511 #if 1
512 VOP_OFFTOBLK(vp, ap->a_foffset, & orig_blkno);
513 #endif /* 1 */
514 /* less than block size and not block offset aligned */
515 if ( (size < fs->fs_bsize) && fragoff(fs, size) && block_offset ) {
516 panic("ffs_cmap: size not a mult of fragment\n");
517 }
518 #if 0
519 if (size > fs->fs_bsize && fragoff(fs, size)) {
520 panic("ffs_cmap: more than bsize & not a multiple of fragment\n");
521 }
522 #endif /* 0 */
523 #if REV_ENDIAN_FS
524 rev_endian=(mp->mnt_flag & MNT_REVEND);
525 #endif /* REV_ENDIAN_FS */
526
527 if(runp)
528 *runp = 0;
529
530 if ( size > MAXPHYSIO)
531 size = MAXPHYSIO;
532 nblks = (blkroundup(fs, size))/fs->fs_bsize;
533
534 xap = a;
535 num = 0;
536 if (error = ufs_getlbns(vp, bn, xap, &num))
537 return (error);
538
539 blks = 0;
540 if (num == 0) {
541 daddr = blkptrtodb(ump, ip->i_db[bn]);
542 *bnp = ((daddr == 0) ? -1 : daddr);
543 if (daddr && runp) {
544 for (++bn; bn < NDADDR && blks < nblks &&
545 ip->i_db[bn] &&
546 is_sequential(ump, ip->i_db[bn - 1], ip->i_db[bn]);
547 ++bn, ++blks);
548
549 if (blks) {
550 retsize = lblktosize(fs, blks);
551 if(size >= retsize)
552 *runp = retsize;
553 else
554 *runp = size;
555 } else {
556 if (size < fs->fs_bsize) {
557 retsize = fragroundup(fs, size);
558 if(size >= retsize)
559 *runp = retsize;
560 else
561 *runp = size;
562 } else {
563 *runp = fs->fs_bsize;
564 }
565 }
566 if (ap->a_poff)
567 *(int *)ap->a_poff = 0;
568 }
569 #if 1
570 if (VOP_BMAP(vp, orig_blkno, NULL, &orig_bblkno, NULL)) {
571 panic("vop_bmap failed\n");
572 }
573 if(daddr != orig_bblkno) {
574 panic("vop_bmap and vop_cmap differ\n");
575 }
576 #endif /* 1 */
577 return (0);
578 }
579
580
581 /* Get disk address out of indirect block array */
582 daddr = ip->i_ib[xap->in_off];
583
584 devvp = VFSTOUFS(vp->v_mount)->um_devvp;
585 for (bp = NULL, ++xap; --num; ++xap) {
586 /*
587 * Exit the loop if there is no disk address assigned yet
588 * or if we were looking for an indirect block and we've
589 * found it.
590 */
591
592 metalbn = xap->in_lbn;
593 if (daddr == 0 || metalbn == bn)
594 break;
595 /*
596 * We have a disk address for it, go fetch it.
597 */
598 if (bp)
599 brelse(bp);
600
601 xap->in_exists = 1;
602 bp = getblk(vp, metalbn, mp->mnt_stat.f_iosize, 0, 0, BLK_META);
603 if (bp->b_flags & (B_DONE | B_DELWRI)) {
604 trace(TR_BREADHIT, pack(vp, mp->mnt_stat.f_iosize), metalbn);
605 }
606 else {
607 trace(TR_BREADMISS, pack(vp, mp->mnt_stat.f_iosize), metalbn);
608 bp->b_blkno = blkptrtodb(ump, daddr);
609 bp->b_flags |= B_READ;
610 VOP_STRATEGY(bp);
611 current_proc()->p_stats->p_ru.ru_inblock++; /* XXX */
612 if (error = biowait(bp)) {
613 brelse(bp);
614 return (error);
615 }
616 }
617
618 daddr = ((ufs_daddr_t *)bp->b_data)[xap->in_off];
619 #if REV_ENDIAN_FS
620 if (rev_endian)
621 daddr = NXSwapLong(daddr);
622 #endif /* REV_ENDIAN_FS */
623 if (num == 1 && daddr && runp) {
624 blks = 0;
625 #if REV_ENDIAN_FS
626 if (rev_endian) {
627 for (bn = xap->in_off + 1;
628 bn < MNINDIR(ump) && blks < maxrun &&
629 is_sequential(ump,
630 NXSwapLong(((ufs_daddr_t *)bp->b_data)[bn - 1]),
631 NXSwapLong(((ufs_daddr_t *)bp->b_data)[bn]));
632 ++bn, ++blks);
633 } else {
634 #endif /* REV_ENDIAN_FS */
635 for (bn = xap->in_off + 1;
636 bn < MNINDIR(ump) && blks < maxrun &&
637 is_sequential(ump,
638 ((ufs_daddr_t *)bp->b_data)[bn - 1],
639 ((ufs_daddr_t *)bp->b_data)[bn]);
640 ++bn, ++blks);
641 #if REV_ENDIAN_FS
642 }
643 #endif /* REV_ENDIAN_FS */
644 }
645 }
646 if (bp)
647 brelse(bp);
648
649 daddr = blkptrtodb(ump, daddr);
650 *bnp = ((daddr == 0) ? -1 : daddr);
651 if (daddr && runp) {
652 if (blks) {
653 retsize = lblktosize(fs, blks);
654 if(size >= retsize)
655 *runp = retsize;
656 else
657 *runp = size;
658 } else {
659 if (size < fs->fs_bsize) {
660 retsize = fragroundup(fs, size);
661 if(size >= retsize)
662 *runp = retsize;
663 else
664 *runp = size;
665 } else {
666 *runp = fs->fs_bsize;
667 }
668 }
669
670 }
671 if (daddr && ap->a_poff)
672 *(int *)ap->a_poff = 0;
673 #if 1
674 if (VOP_BMAP(vp, orig_blkno, (struct vnode **) 0, &orig_bblkno, 0)) {
675 panic("vop_bmap failed\n");
676 }
677 if(daddr != orig_bblkno) {
678 panic("vop_bmap and vop_cmap differ\n");
679 }
680 #endif /* 1 */
681 return (0);
682 }
683 #endif /* NOTTOBEUSED */