File:  [DragonFly] / src / sys / vfs / gnu / ext2fs / ext2_alloc.c
Revision 1.6: download - view: text, annotated - select for diffs
Thu Apr 8 20:57:52 2004 UTC (10 years, 6 months ago) by cpressey
Branches: MAIN
CVS tags: HEAD, DragonFly_Stable, DragonFly_Snap29Sep2004, DragonFly_Snap13Sep2004, DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2, DragonFly_1_0_REL, DragonFly_1_0_RC1, DragonFly_1_0A_REL
Style(9) cleanup to src/sys/vfs, stage 5/21: ext2fs.

- Convert K&R-style function definitions to ANSI style.

Submitted-by: Andre Nathan <andre@digirati.com.br>
Additional-reformatting-by: cpressey

    1: /*
    2:  *  modified for Lites 1.1
    3:  *
    4:  *  Aug 1995, Godmar Back (gback@cs.utah.edu)
    5:  *  University of Utah, Department of Computer Science
    6:  */
    7: /*
    8:  * Copyright (c) 1982, 1986, 1989, 1993
    9:  *	The Regents of the University of California.  All rights reserved.
   10:  *
   11:  * Redistribution and use in source and binary forms, with or without
   12:  * modification, are permitted provided that the following conditions
   13:  * are met:
   14:  * 1. Redistributions of source code must retain the above copyright
   15:  *    notice, this list of conditions and the following disclaimer.
   16:  * 2. Redistributions in binary form must reproduce the above copyright
   17:  *    notice, this list of conditions and the following disclaimer in the
   18:  *    documentation and/or other materials provided with the distribution.
   19:  * 3. All advertising materials mentioning features or use of this software
   20:  *    must display the following acknowledgement:
   21:  *	This product includes software developed by the University of
   22:  *	California, Berkeley and its contributors.
   23:  * 4. Neither the name of the University nor the names of its contributors
   24:  *    may be used to endorse or promote products derived from this software
   25:  *    without specific prior written permission.
   26:  *
   27:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   28:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   29:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   30:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   31:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   32:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   33:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   34:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   35:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   36:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   37:  * SUCH DAMAGE.
   38:  *
   39:  *	@(#)ext2_alloc.c	8.8 (Berkeley) 2/21/94
   40:  * $FreeBSD: src/sys/gnu/ext2fs/ext2_alloc.c,v 1.28.2.2 2002/07/01 00:18:51 iedowse Exp $
   41:  * $DragonFly: src/sys/vfs/gnu/ext2fs/ext2_alloc.c,v 1.6 2004/04/08 20:57:52 cpressey Exp $
   42:  */
   43: 
   44: #include "opt_quota.h"
   45: 
   46: #include <sys/param.h>
   47: #include <sys/systm.h>
   48: #include <sys/conf.h>
   49: #include <sys/vnode.h>
   50: #include <sys/stat.h>
   51: #include <sys/mount.h>
   52: #include <sys/syslog.h>
   53: 
   54: #include <vfs/ufs/quota.h>
   55: #include <vfs/ufs/inode.h>
   56: #include <vfs/ufs/ufsmount.h>
   57: 
   58: #include "ext2_fs.h"
   59: #include "ext2_fs_sb.h"
   60: #include "fs.h"
   61: #include "ext2_extern.h"
   62: 
   63: static void	ext2_fserr (struct ext2_sb_info *, u_int, char *);
   64: 
   65: /*
   66:  * Linux calls this functions at the following locations:
   67:  * (1) the inode is freed
   68:  * (2) a preallocation miss occurs
   69:  * (3) truncate is called
   70:  * (4) release_file is called and f_mode & 2
   71:  *
   72:  * I call it in ext2_inactive, ext2_truncate, ext2_vfree and in (2)
   73:  * the call in vfree might be redundant
   74:  */
   75: void
   76: ext2_discard_prealloc(struct inode *ip)
   77: {
   78: #ifdef EXT2_PREALLOCATE
   79:         if (ip->i_prealloc_count) {
   80:                 int i = ip->i_prealloc_count;
   81:                 ip->i_prealloc_count = 0;
   82:                 ext2_free_blocks (ITOV(ip)->v_mount,
   83:                                   ip->i_prealloc_block,
   84:                                   i);
   85:         }
   86: #endif
   87: }
   88: 
   89: /*
   90:  * Allocate a block in the file system.
   91:  * 
   92:  * this takes the framework from ffs_alloc. To implement the
   93:  * actual allocation, it calls ext2_new_block, the ported version
   94:  * of the same Linux routine.
   95:  *
   96:  * we note that this is always called in connection with ext2_blkpref
   97:  *
   98:  * preallocation is done as Linux does it
   99:  */
  100: int
  101: ext2_alloc(struct inode *ip, daddr_t lbn, daddr_t bpref, int size,
  102: 	   struct ucred *cred, daddr_t *bnp)
  103: {
  104: 	struct ext2_sb_info *fs;
  105: 	daddr_t bno;
  106: #if QUOTA
  107: 	int error;
  108: #endif
  109: 	
  110: 	*bnp = 0;
  111: 	fs = ip->i_e2fs;
  112: #if DIAGNOSTIC
  113: 	if ((u_int)size > fs->s_blocksize || blkoff(fs, size) != 0) {
  114: 		printf("dev = %s, bsize = %lu, size = %d, fs = %s\n",
  115: 		    devtoname(ip->i_dev), fs->s_blocksize, size, fs->fs_fsmnt);
  116: 		panic("ext2_alloc: bad size");
  117: 	}
  118: 	if (cred == NOCRED)
  119: 		panic("ext2_alloc: missing credential");
  120: #endif /* DIAGNOSTIC */
  121: 	if (size == fs->s_blocksize && fs->s_es->s_free_blocks_count == 0)
  122: 		goto nospace;
  123: 	if (cred->cr_uid != 0 && 
  124: 		fs->s_es->s_free_blocks_count < fs->s_es->s_r_blocks_count)
  125: 		goto nospace;
  126: #if QUOTA
  127: 	if ((error = chkdq(ip, (long)btodb(size), cred, 0)) != 0)
  128: 		return (error);
  129: #endif
  130: 	if (bpref >= fs->s_es->s_blocks_count)
  131: 		bpref = 0;
  132: 	/* call the Linux code */
  133: #ifdef EXT2_PREALLOCATE
  134: 	/* To have a preallocation hit, we must
  135: 	 * - have at least one block preallocated
  136: 	 * - and our preferred block must have that block number or one below
  137: 	 */
  138:         if (ip->i_prealloc_count &&
  139:             (bpref == ip->i_prealloc_block ||
  140:              bpref + 1 == ip->i_prealloc_block))
  141:         {
  142:                 bno = ip->i_prealloc_block++;
  143:                 ip->i_prealloc_count--;
  144:                 /* ext2_debug ("preallocation hit (%lu/%lu).\n",
  145:                             ++alloc_hits, ++alloc_attempts); */
  146: 
  147: 		/* Linux gets, clears, and releases the buffer at this
  148: 		   point - we don't have to that; we leave it to the caller
  149: 		 */
  150:         } else {
  151:                 ext2_discard_prealloc (ip);
  152:                 /* ext2_debug ("preallocation miss (%lu/%lu).\n",
  153:                             alloc_hits, ++alloc_attempts); */
  154:                 if (S_ISREG(ip->i_mode))
  155:                         bno = ext2_new_block
  156:                                 (ITOV(ip)->v_mount, bpref,
  157:                                  &ip->i_prealloc_count,
  158:                                  &ip->i_prealloc_block);
  159:                 else
  160: 			bno = (daddr_t)ext2_new_block(ITOV(ip)->v_mount, 
  161: 					bpref, 0, 0);
  162:         }
  163: #else
  164: 	bno = (daddr_t)ext2_new_block(ITOV(ip)->v_mount, bpref, 0, 0);
  165: #endif
  166: 
  167: 	if (bno > 0) {
  168: 		/* set next_alloc fields as done in block_getblk */
  169: 		ip->i_next_alloc_block = lbn;
  170: 		ip->i_next_alloc_goal = bno;
  171: 
  172: 		ip->i_blocks += btodb(size);
  173: 		ip->i_flag |= IN_CHANGE | IN_UPDATE;
  174: 		*bnp = bno;
  175: 		return (0);
  176: 	}
  177: #if QUOTA
  178: 	/*
  179: 	 * Restore user's disk quota because allocation failed.
  180: 	 */
  181: 	(void) chkdq(ip, (long)-btodb(size), cred, FORCE);
  182: #endif
  183: nospace:
  184: 	ext2_fserr(fs, cred->cr_uid, "file system full");
  185: 	uprintf("\n%s: write failed, file system is full\n", fs->fs_fsmnt);
  186: 	return (ENOSPC);
  187: }
  188: 
  189: /*
  190:  * Reallocate a sequence of blocks into a contiguous sequence of blocks.
  191:  *
  192:  * The vnode and an array of buffer pointers for a range of sequential
  193:  * logical blocks to be made contiguous is given. The allocator attempts
  194:  * to find a range of sequential blocks starting as close as possible to
  195:  * an fs_rotdelay offset from the end of the allocation for the logical
  196:  * block immediately preceeding the current range. If successful, the
  197:  * physical block numbers in the buffer pointers and in the inode are
  198:  * changed to reflect the new allocation. If unsuccessful, the allocation
  199:  * is left unchanged. The success in doing the reallocation is returned.
  200:  * Note that the error return is not reflected back to the user. Rather
  201:  * the previous block allocation will be used.
  202:  */
  203: 
  204: #ifdef FANCY_REALLOC
  205: #include <sys/sysctl.h>
  206: static int doasyncfree = 1;
  207: #ifdef	OPT_DEBUG
  208: SYSCTL_INT(_debug, 14, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, "");
  209: #endif	/* OPT_DEBUG */
  210: #endif
  211: 
  212: /*
  213:  * ext2_reallocblks(struct vnode *a_vp, struct cluster_save *a_buflist)
  214:  */
  215: int
  216: ext2_reallocblks(struct vop_reallocblks_args *ap)
  217: {
  218: #ifndef FANCY_REALLOC
  219: /* printf("ext2_reallocblks not implemented\n"); */
  220: return ENOSPC;
  221: #else
  222: 
  223: 	struct ext2_sb_info *fs;
  224: 	struct inode *ip;
  225: 	struct vnode *vp;
  226: 	struct buf *sbp, *ebp;
  227: 	daddr_t *bap, *sbap, *ebap;
  228: 	struct cluster_save *buflist;
  229: 	daddr_t start_lbn, end_lbn, soff, eoff, newblk, blkno;
  230: 	struct indir start_ap[NIADDR + 1], end_ap[NIADDR + 1], *idp;
  231: 	int i, len, start_lvl, end_lvl, pref, ssize;
  232: 
  233: 	vp = ap->a_vp;
  234: 	ip = VTOI(vp);
  235: 	fs = ip->i_e2fs;
  236: #ifdef UNKLAR
  237: 	if (fs->fs_contigsumsize <= 0)
  238: 		return (ENOSPC);
  239: #endif
  240: 	buflist = ap->a_buflist;
  241: 	len = buflist->bs_nchildren;
  242: 	start_lbn = buflist->bs_children[0]->b_lblkno;
  243: 	end_lbn = start_lbn + len - 1;
  244: #if DIAGNOSTIC
  245: 	for (i = 1; i < len; i++)
  246: 		if (buflist->bs_children[i]->b_lblkno != start_lbn + i)
  247: 			panic("ext2_reallocblks: non-cluster");
  248: #endif
  249: 	/*
  250: 	 * If the latest allocation is in a new cylinder group, assume that
  251: 	 * the filesystem has decided to move and do not force it back to
  252: 	 * the previous cylinder group.
  253: 	 */
  254: 	if (dtog(fs, dbtofsb(fs, buflist->bs_children[0]->b_blkno)) !=
  255: 	    dtog(fs, dbtofsb(fs, buflist->bs_children[len - 1]->b_blkno)))
  256: 		return (ENOSPC);
  257: 	if (ufs_getlbns(vp, start_lbn, start_ap, &start_lvl) ||
  258: 	    ufs_getlbns(vp, end_lbn, end_ap, &end_lvl))
  259: 		return (ENOSPC);
  260: 	/*
  261: 	 * Get the starting offset and block map for the first block.
  262: 	 */
  263: 	if (start_lvl == 0) {
  264: 		sbap = &ip->i_db[0];
  265: 		soff = start_lbn;
  266: 	} else {
  267: 		idp = &start_ap[start_lvl - 1];
  268: 		if (bread(vp, idp->in_lbn, (int)fs->s_blocksize, NOCRED, &sbp)) {
  269: 			brelse(sbp);
  270: 			return (ENOSPC);
  271: 		}
  272: 		sbap = (daddr_t *)sbp->b_data;
  273: 		soff = idp->in_off;
  274: 	}
  275: 	/*
  276: 	 * Find the preferred location for the cluster.
  277: 	 */
  278: 	pref = ext2_blkpref(ip, start_lbn, soff, sbap);
  279: 	/*
  280: 	 * If the block range spans two block maps, get the second map.
  281: 	 */
  282: 	if (end_lvl == 0 || (idp = &end_ap[end_lvl - 1])->in_off + 1 >= len) {
  283: 		ssize = len;
  284: 	} else {
  285: #if DIAGNOSTIC
  286: 		if (start_ap[start_lvl-1].in_lbn == idp->in_lbn)
  287: 			panic("ext2_reallocblk: start == end");
  288: #endif
  289: 		ssize = len - (idp->in_off + 1);
  290: 		if (bread(vp, idp->in_lbn, (int)fs->s_blocksize, NOCRED, &ebp))
  291: 			goto fail;
  292: 		ebap = (daddr_t *)ebp->b_data;
  293: 	}
  294: 	/*
  295: 	 * Search the block map looking for an allocation of the desired size.
  296: 	 */
  297: 	if ((newblk = (daddr_t)ext2_hashalloc(ip, dtog(fs, pref), (long)pref,
  298: 	    len, (u_long (*)())ext2_clusteralloc)) == 0)
  299: 		goto fail;
  300: 	/*
  301: 	 * We have found a new contiguous block.
  302: 	 *
  303: 	 * First we have to replace the old block pointers with the new
  304: 	 * block pointers in the inode and indirect blocks associated
  305: 	 * with the file.
  306: 	 */
  307: 	blkno = newblk;
  308: 	for (bap = &sbap[soff], i = 0; i < len; i++, blkno += fs->s_frags_per_block) {
  309: 		if (i == ssize)
  310: 			bap = ebap;
  311: #if DIAGNOSTIC
  312: 		if (buflist->bs_children[i]->b_blkno != fsbtodb(fs, *bap))
  313: 			panic("ext2_reallocblks: alloc mismatch");
  314: #endif
  315: 		*bap++ = blkno;
  316: 	}
  317: 	/*
  318: 	 * Next we must write out the modified inode and indirect blocks.
  319: 	 * For strict correctness, the writes should be synchronous since
  320: 	 * the old block values may have been written to disk. In practise
  321: 	 * they are almost never written, but if we are concerned about 
  322: 	 * strict correctness, the `doasyncfree' flag should be set to zero.
  323: 	 *
  324: 	 * The test on `doasyncfree' should be changed to test a flag
  325: 	 * that shows whether the associated buffers and inodes have
  326: 	 * been written. The flag should be set when the cluster is
  327: 	 * started and cleared whenever the buffer or inode is flushed.
  328: 	 * We can then check below to see if it is set, and do the
  329: 	 * synchronous write only when it has been cleared.
  330: 	 */
  331: 	if (sbap != &ip->i_db[0]) {
  332: 		if (doasyncfree)
  333: 			bdwrite(sbp);
  334: 		else
  335: 			bwrite(sbp);
  336: 	} else {
  337: 		ip->i_flag |= IN_CHANGE | IN_UPDATE;
  338: 		if (!doasyncfree)
  339: 			UFS_UPDATE(vp, 1);
  340: 	}
  341: 	if (ssize < len)
  342: 		if (doasyncfree)
  343: 			bdwrite(ebp);
  344: 		else
  345: 			bwrite(ebp);
  346: 	/*
  347: 	 * Last, free the old blocks and assign the new blocks to the buffers.
  348: 	 */
  349: 	for (blkno = newblk, i = 0; i < len; i++, blkno += fs->s_frags_per_block) {
  350: 		ext2_blkfree(ip, dbtofsb(fs, buflist->bs_children[i]->b_blkno),
  351: 		    fs->s_blocksize);
  352: 		buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno);
  353: 	}
  354: 	return (0);
  355: 
  356: fail:
  357: 	if (ssize < len)
  358: 		brelse(ebp);
  359: 	if (sbap != &ip->i_db[0])
  360: 		brelse(sbp);
  361: 	return (ENOSPC);
  362: 
  363: #endif /* FANCY_REALLOC */
  364: }
  365: 
  366: /*
  367:  * Allocate an inode in the file system.
  368:  * 
  369:  * we leave the actual allocation strategy to the (modified)
  370:  * ext2_new_inode(), to make sure we get the policies right
  371:  */
  372: int
  373: ext2_valloc(struct vnode *pvp, int mode, struct ucred *cred, struct vnode **vpp)
  374: {
  375: 	struct inode *pip;
  376: 	struct ext2_sb_info *fs;
  377: 	struct inode *ip;
  378: 	ino_t ino;
  379: 	int i, error;
  380: 	
  381: 	*vpp = NULL;
  382: 	pip = VTOI(pvp);
  383: 	fs = pip->i_e2fs;
  384: 	if (fs->s_es->s_free_inodes_count == 0)
  385: 		goto noinodes;
  386: 
  387: 	/* call the Linux routine - it returns the inode number only */
  388: 	ino = ext2_new_inode(pip, mode);
  389: 
  390: 	if (ino == 0)
  391: 		goto noinodes;
  392: 	error = VFS_VGET(pvp->v_mount, ino, vpp);
  393: 	if (error) {
  394: 		UFS_VFREE(pvp, ino, mode);
  395: 		return (error);
  396: 	}
  397: 	ip = VTOI(*vpp);
  398: 
  399: 	/* 
  400: 	  the question is whether using VGET was such good idea at all -
  401: 	  Linux doesn't read the old inode in when it's allocating a
  402: 	  new one. I will set at least i_size & i_blocks the zero. 
  403: 	*/ 
  404: 	ip->i_mode = 0;
  405: 	ip->i_size = 0;
  406: 	ip->i_blocks = 0;
  407: 	ip->i_flags = 0;
  408:         /* now we want to make sure that the block pointers are zeroed out */
  409:         for (i = 0; i < NDADDR; i++)
  410:                 ip->i_db[i] = 0;
  411:         for (i = 0; i < NIADDR; i++)
  412:                 ip->i_ib[i] = 0;
  413: 
  414: 	/*
  415: 	 * Set up a new generation number for this inode.
  416: 	 * XXX check if this makes sense in ext2
  417: 	 */
  418: 	if (ip->i_gen == 0 || ++ip->i_gen == 0)
  419: 		ip->i_gen = random() / 2 + 1;
  420: /*
  421: printf("ext2_valloc: allocated inode %d\n", ino);
  422: */
  423: 	return (0);
  424: noinodes:
  425: 	ext2_fserr(fs, cred->cr_uid, "out of inodes");
  426: 	uprintf("\n%s: create/symlink failed, no inodes free\n", fs->fs_fsmnt);
  427: 	return (ENOSPC);
  428: }
  429: 
  430: /*
  431:  * Select the desired position for the next block in a file.  
  432:  *
  433:  * we try to mimic what Remy does in inode_getblk/block_getblk
  434:  *
  435:  * we note: blocknr == 0 means that we're about to allocate either
  436:  * a direct block or a pointer block at the first level of indirection
  437:  * (In other words, stuff that will go in i_db[] or i_ib[])
  438:  *
  439:  * blocknr != 0 means that we're allocating a block that is none
  440:  * of the above. Then, blocknr tells us the number of the block
  441:  * that will hold the pointer
  442:  */
  443: daddr_t
  444: ext2_blkpref(struct inode *ip, daddr_t lbn, int indx, daddr_t *bap,
  445: 	     daddr_t blocknr)
  446: {
  447: 	int	tmp;
  448: 
  449: 	/* if the next block is actually what we thought it is,
  450: 	   then set the goal to what we thought it should be
  451: 	*/
  452: 	if(ip->i_next_alloc_block == lbn)
  453: 		return ip->i_next_alloc_goal;
  454: 
  455: 	/* now check whether we were provided with an array that basically
  456: 	   tells us previous blocks to which we want to stay closeby
  457: 	*/
  458: 	if(bap) 
  459:                 for (tmp = indx - 1; tmp >= 0; tmp--) 
  460: 			if (bap[tmp]) 
  461: 				return bap[tmp];
  462: 
  463: 	/* else let's fall back to the blocknr, or, if there is none,
  464: 	   follow the rule that a block should be allocated near its inode
  465: 	*/
  466: 	return blocknr ? blocknr :
  467: 			(daddr_t)(ip->i_block_group * 
  468: 			EXT2_BLOCKS_PER_GROUP(ip->i_e2fs)) + 
  469: 			ip->i_e2fs->s_es->s_first_data_block;
  470: }
  471: 
  472: /*
  473:  * Free a block or fragment.
  474:  *
  475:  * pass on to the Linux code
  476:  */
  477: void
  478: ext2_blkfree(struct inode *ip, daddr_t bno, long size)
  479: {
  480: 	struct ext2_sb_info *fs;
  481: 
  482: 	fs = ip->i_e2fs;
  483: 	/*
  484: 	 *	call Linux code with mount *, block number, count
  485: 	 */
  486: 	ext2_free_blocks(ITOV(ip)->v_mount, bno, size / fs->s_frag_size);
  487: }
  488: 
  489: /*
  490:  * Free an inode.
  491:  *
  492:  * the maintenance of the actual bitmaps is again up to the linux code
  493:  */
  494: int
  495: ext2_vfree(struct vnode *pvp, ino_t ino, int mode)
  496: {
  497: 	struct ext2_sb_info *fs;
  498: 	struct inode *pip;
  499: 	mode_t save_i_mode;
  500: 
  501: 	pip = VTOI(pvp);
  502: 	fs = pip->i_e2fs;
  503: 	if ((u_int)ino > fs->s_inodes_per_group * fs->s_groups_count)
  504: 		panic("ext2_vfree: range: dev = (%d, %d), ino = %d, fs = %s",
  505: 		    major(pip->i_dev), minor(pip->i_dev), ino, fs->fs_fsmnt);
  506: 
  507: /* ext2_debug("ext2_vfree (%d, %d) called\n", pip->i_number, mode);
  508:  */
  509: 	ext2_discard_prealloc(pip);
  510: 
  511: 	/* we need to make sure that ext2_free_inode can adjust the
  512: 	   used_dir_counts in the group summary information - I'd
  513: 	   really like to know what the rationale behind this
  514: 	   'set i_mode to zero to denote an unused inode' is
  515: 	 */
  516: 	save_i_mode = pip->i_mode;
  517: 	pip->i_mode = mode;
  518: 	ext2_free_inode(pip);	
  519: 	pip->i_mode = save_i_mode;
  520: 	return (0);
  521: }
  522: 
  523: /*
  524:  * Fserr prints the name of a file system with an error diagnostic.
  525:  * 
  526:  * The form of the error message is:
  527:  *	fs: error message
  528:  */
  529: static void
  530: ext2_fserr(struct ext2_sb_info *fs, u_int uid, char *cp)
  531: {
  532: 	log(LOG_ERR, "uid %d on %s: %s\n", uid, fs->fs_fsmnt, cp);
  533: }