summaryrefslogtreecommitdiffstats
path: root/sys/fs/unionfs
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2002-09-22 08:54:17 +0000
committertruckman <truckman@FreeBSD.org>2002-09-22 08:54:17 +0000
commit1ceb27771f19bd8b9157ed86ec2ad78967be12a7 (patch)
treeedd917ff47d2cc57aba4997fe4c0d0a43ce7a2eb /sys/fs/unionfs
parent6d7819a5d47018cd38813f604f06d909988df586 (diff)
downloadFreeBSD-src-1ceb27771f19bd8b9157ed86ec2ad78967be12a7.zip
FreeBSD-src-1ceb27771f19bd8b9157ed86ec2ad78967be12a7.tar.gz
Fix misspellings, capitalization, and punctuation in comments. Minor
comment phrasing and style changes.
Diffstat (limited to 'sys/fs/unionfs')
-rw-r--r--sys/fs/unionfs/union_subr.c84
-rw-r--r--sys/fs/unionfs/union_vfsops.c22
-rw-r--r--sys/fs/unionfs/union_vnops.c79
3 files changed, 95 insertions, 90 deletions
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c
index 25094aa..b17dac8 100644
--- a/sys/fs/unionfs/union_subr.c
+++ b/sys/fs/unionfs/union_subr.c
@@ -137,9 +137,11 @@ union_list_unlock(ix)
* The uppervp, if not NULL, must be referenced and not locked by us
* The lowervp, if not NULL, must be referenced.
*
- * if uppervp and lowervp match pointers already installed, nothing
- * happens. The passed vp's (when matching) are not adjusted. This
- * routine may only be called by union_newupper() and union_newlower().
+ * If uppervp and lowervp match pointers already installed, then
+ * nothing happens. The passed vp's (when matching) are not adjusted.
+ *
+ * This routine may only be called by union_newupper() and
+ * union_newlower().
*/
static void
@@ -273,7 +275,7 @@ union_newsize(vp, uppersz, lowersz)
UDEBUG(("union: %s size now %ld\n",
(uppersz != VNOVAL ? "upper" : "lower"), (long)sz));
/*
- * There is no need to change size of non-existent object
+ * There is no need to change size of non-existent object.
*/
/* vnode_pager_setsize(vp, sz); */
}
@@ -287,13 +289,13 @@ union_newsize(vp, uppersz, lowersz)
* error occurs.
*
* mp Holds the mount point. mp may or may not be busied.
- * allocvp makes no changes to mp.
+ * allocvp() makes no changes to mp.
*
* dvp Holds the parent union_node to the one we wish to create.
* XXX may only be used to traverse an uncopied lowervp-based
* tree? XXX
*
- * dvp may or may not be locked. allocvp makes no changes
+ * dvp may or may not be locked. allocvp() makes no changes
* to dvp.
*
* upperdvp Holds the parent vnode to uppervp, generally used along
@@ -313,26 +315,26 @@ union_newsize(vp, uppersz, lowersz)
*
* cnp Holds path component information to be coupled with
* lowervp and upperdvp to allow unionfs to create an uppervp
- * later on. Only used if lowervp is valid. The conents
+ * later on. Only used if lowervp is valid. The contents
* of cnp is only valid for the duration of the call.
*
* docache Determine whether this node should be entered in the
* cache or whether it should be destroyed as soon as possible.
*
- * all union_nodes are maintained on a singly-linked
- * list. new nodes are only allocated when they cannot
- * be found on this list. entries on the list are
+ * All union_nodes are maintained on a singly-linked
+ * list. New nodes are only allocated when they cannot
+ * be found on this list. Entries on the list are
* removed when the vfs reclaim entry is called.
*
- * a single lock is kept for the entire list. this is
+ * A single lock is kept for the entire list. This is
* needed because the getnewvnode() function can block
* waiting for a vnode to become free, in which case there
* may be more than one process trying to get the same
- * vnode. this lock is only taken if we are going to
- * call getnewvnode, since the kernel itself is single-threaded.
+ * vnode. This lock is only taken if we are going to
+ * call getnewvnode(), since the kernel itself is single-threaded.
*
- * if an entry is found on the list, then call vget() to
- * take a reference. this is done because there may be
+ * If an entry is found on the list, then call vget() to
+ * take a reference. This is done because there may be
* zero references to it and so it needs to removed from
* the vnode free list.
*/
@@ -500,7 +502,7 @@ loop:
/*
* Save information about the lower layer.
* This needs to keep track of pathname
- * and directory information which union_vn_create
+ * and directory information which union_vn_create()
* might need.
*/
if (lowervp != un->un_lowervp) {
@@ -533,7 +535,7 @@ loop:
if (docache) {
/*
- * otherwise lock the vp list while we call getnewvnode
+ * Otherwise lock the vp list while we call getnewvnode()
* since that can block.
*/
hash = UNION_HASH(uppervp, lowervp);
@@ -543,13 +545,13 @@ loop:
}
/*
- * Create new node rather then replace old node
+ * Create new node rather than replace old node.
*/
error = getnewvnode("union", mp, union_vnodeop_p, vpp);
if (error) {
/*
- * If an error occurs clear out vnodes.
+ * If an error occurs, clear out vnodes.
*/
if (lowervp)
vrele(lowervp);
@@ -650,8 +652,8 @@ union_freevp(vp)
}
/*
- * copyfile. copy the vnode (fvp) to the vnode (tvp)
- * using a sequence of reads and writes. both (fvp)
+ * copyfile. Copy the vnode (fvp) to the vnode (tvp)
+ * using a sequence of reads and writes. Both (fvp)
* and (tvp) are locked on entry and exit.
*
* fvp and tvp are both exclusive locked on call, but their refcount's
@@ -671,10 +673,10 @@ union_copyfile(fvp, tvp, cred, td)
/*
* strategy:
- * allocate a buffer of size MAXBSIZE.
- * loop doing reads and writes, keeping track
+ * Allocate a buffer of size MAXBSIZE.
+ * Loop doing reads and writes, keeping track
* of the current uio offset.
- * give up at the first sign of trouble.
+ * Give up at the first sign of trouble.
*/
bzero(&uio, sizeof(uio));
@@ -695,7 +697,7 @@ union_copyfile(fvp, tvp, cred, td)
int bufoffset;
/*
- * Setup for big read
+ * Setup for big read.
*/
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
@@ -709,7 +711,7 @@ union_copyfile(fvp, tvp, cred, td)
/*
* Get bytes read, handle read eof case and setup for
- * write loop
+ * write loop.
*/
if ((count = MAXBSIZE - uio.uio_resid) == 0)
break;
@@ -778,7 +780,7 @@ union_copyup(un, docopy, cred, td)
if (docopy) {
/*
* XX - should not ignore errors
- * from VOP_CLOSE
+ * from VOP_CLOSE()
*/
vn_lock(lvp, LK_EXCLUSIVE | LK_RETRY, td);
error = VOP_OPEN(lvp, FREAD, cred, td);
@@ -852,9 +854,9 @@ union_relookup(um, dvp, vpp, cnp, cn, path, pathlen)
* A new componentname structure must be faked up because
* there is no way to know where the upper level cnp came
* from or what it is being used for. This must duplicate
- * some of the work done by NDINIT, some of the work done
- * by namei, some of the work done by lookup and some of
- * the work done by VOP_LOOKUP when given a CREATE flag.
+ * some of the work done by NDINIT(), some of the work done
+ * by namei(), some of the work done by lookup() and some of
+ * the work done by VOP_LOOKUP() when given a CREATE flag.
* Conclusion: Horrible.
*/
cn->cn_namelen = pathlen;
@@ -904,8 +906,8 @@ union_relookup(um, dvp, vpp, cnp, cn, path, pathlen)
* (um) points to the union mount structure for access to the
* the mounting process's credentials.
* (dvp) is the directory in which to create the shadow directory,
- * it is locked (but not ref'd) on entry and return.
- * (cnp) is the componentname to be created.
+ * It is locked (but not ref'd) on entry and return.
+ * (cnp) is the component name to be created.
* (vpp) is the returned newly created shadow directory, which
* is returned locked and ref'd
*/
@@ -945,7 +947,7 @@ union_mkshadow(um, dvp, cnp, vpp)
}
/*
- * policy: when creating the shadow directory in the
+ * Policy: when creating the shadow directory in the
* upper layer, create it owned by the user who did
* the mount, group from parent directory, and mode
* 777 modified by umask (ie mostly identical to the
@@ -975,8 +977,8 @@ union_mkshadow(um, dvp, cnp, vpp)
* (um) points to the union mount structure for access to the
* the mounting process's credentials.
* (dvp) is the directory in which to create the whiteout.
- * it is locked on entry and return.
- * (cnp) is the componentname to be created.
+ * It is locked on entry and return.
+ * (cnp) is the component name to be created.
*/
int
union_mkwhiteout(um, dvp, cnp, path)
@@ -1026,11 +1028,11 @@ union_mkwhiteout(um, dvp, cnp, path)
/*
* union_vn_create: creates and opens a new shadow file
- * on the upper union layer. this function is similar
- * in spirit to calling vn_open but it avoids calling namei().
- * the problem with calling namei is that a) it locks too many
+ * on the upper union layer. This function is similar
+ * in spirit to calling vn_open() but it avoids calling namei().
+ * The problem with calling namei() is that a) it locks too many
* things, and b) it doesn't start at the "right" directory,
- * whereas relookup is told where to start.
+ * whereas relookup() is told where to start.
*
* On entry, the vnode associated with un is locked. It remains locked
* on return.
@@ -1060,7 +1062,7 @@ union_vn_create(vpp, un, td)
/*
* Build a new componentname structure (for the same
- * reasons outlines in union_mkshadow).
+ * reasons outlines in union_mkshadow()).
* The difference here is that the file is owned by
* the current user, rather than by the person who
* did the mount, since the current user needs to be
@@ -1189,7 +1191,7 @@ union_removed_upper(un)
#endif
/*
- * determine whether a whiteout is needed
+ * Determine whether a whiteout is needed
* during a remove/rmdir operation.
*/
int
diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c
index c4d362c..249e126 100644
--- a/sys/fs/unionfs/union_vfsops.c
+++ b/sys/fs/unionfs/union_vfsops.c
@@ -67,7 +67,7 @@ static int union_unmount(struct mount *mp, int mntflags,
struct thread *td);
/*
- * Mount union filesystem
+ * Mount union filesystem.
*/
static int
union_mount(mp, ndp, td)
@@ -99,7 +99,7 @@ union_mount(mp, ndp, td)
*/
if (mp->mnt_flag & MNT_UPDATE)
/*
- * Need to provide.
+ * Need to provide:
* 1. a way to convert between rdonly and rdwr mounts.
* 2. support for nfs exports.
*/
@@ -227,7 +227,7 @@ union_mount(mp, ndp, td)
/*
* Unless the mount is readonly, ensure that the top layer
- * supports whiteout operations
+ * supports whiteout operations.
*/
if ((mp->mnt_flag & MNT_RDONLY) == 0) {
error = VOP_WHITEOUT(um->um_uppervp, NULL, LOOKUP);
@@ -313,7 +313,7 @@ bad:
}
/*
- * Free reference to union layer
+ * Free reference to union layer.
*/
static int
union_unmount(mp, mntflags, td)
@@ -359,7 +359,9 @@ union_unmount(mp, mntflags, td)
freeing = n;
}
- /* If the most recent vflush failed, the filesystem is still busy. */
+ /*
+ * If the most recent vflush failed, the filesystem is still busy.
+ */
if (error)
return (error);
@@ -371,7 +373,7 @@ union_unmount(mp, mntflags, td)
vrele(um->um_uppervp);
crfree(um->um_cred);
/*
- * Finally, throw away the union_mount structure
+ * Finally, throw away the union_mount structure.
*/
free(mp->mnt_data, M_UNIONFSMNT); /* XXX */
mp->mnt_data = 0;
@@ -430,7 +432,9 @@ union_statfs(mp, sbp, td)
return (error);
}
- /* now copy across the "interesting" information and fake the rest */
+ /*
+ * Now copy across the "interesting" information and fake the rest.
+ */
#if 0
sbp->f_type = mstat.f_type;
sbp->f_flags = mstat.f_flags;
@@ -453,9 +457,9 @@ union_statfs(mp, sbp, td)
sbp->f_iosize = mstat.f_iosize;
/*
- * if the lower and upper blocksizes differ, then frig the
+ * If the lower and upper blocksizes differ, then frig the
* block counts so that the sizes reported by df make some
- * kind of sense. none of this makes sense though.
+ * kind of sense. None of this makes sense though.
*/
if (mstat.f_bsize != lbsize)
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c
index 9d0d2a1..264e39d 100644
--- a/sys/fs/unionfs/union_vnops.c
+++ b/sys/fs/unionfs/union_vnops.c
@@ -155,7 +155,7 @@ union_unlock_other(struct vnode *vp, struct thread *td)
*
* udvp must be exclusively locked on call and will remain
* exclusively locked on return. This is the mount point
- * for out filesystem.
+ * for our filesystem.
*
* dvp Our base directory, locked and referenced.
* The passed dvp will be dereferenced and unlocked on return
@@ -211,8 +211,8 @@ union_lookup1(udvp, pdvp, vpp, cnp)
*pdvp = dvp;
/*
- * If the VOP_LOOKUP call generates an error, tdvp is invalid and no
- * changes will have been made to dvp, so we are set to return.
+ * If the VOP_LOOKUP() call generates an error, tdvp is invalid and
+ * no changes will have been made to dvp, so we are set to return.
*/
error = VOP_LOOKUP(dvp, &tdvp, cnp);
@@ -301,7 +301,7 @@ union_lookup(ap)
*ap->a_vpp = NULLVP;
/*
- * Disallow write attemps to the filesystem mounted read-only.
+ * Disallow write attempts to the filesystem mounted read-only.
*/
if ((cnp->cn_flags & ISLASTCN) &&
(dvp->v_mount->mnt_flag & MNT_RDONLY) &&
@@ -310,7 +310,7 @@ union_lookup(ap)
}
/*
- * For any lookup's we do, always return with the parent locked
+ * For any lookups we do, always return with the parent locked.
*/
cnp->cn_flags |= LOCKPARENT;
@@ -332,8 +332,8 @@ union_lookup(ap)
upperdvp = union_lock_upper(dun, td);
/*
- * do the lookup in the upper level.
- * if that level comsumes additional pathnames,
+ * Do the lookup in the upper level.
+ * If that level consumes additional pathnames,
* then assume that something special is going
* on and just return that vnode.
*/
@@ -347,12 +347,12 @@ union_lookup(ap)
/*
* Do the lookup. We must supply a locked and referenced
* upperdvp to the function and will get a new locked and
- * referenced upperdvp back with the old having been
+ * referenced upperdvp back, with the old having been
* dereferenced.
*
* If an error is returned, uppervp will be NULLVP. If no
- * error occurs, uppervp will be the locked and referenced
- * return vnode or possibly NULL, depending on what is being
+ * error occurs, uppervp will be the locked and referenced.
+ * Return vnode, or possibly NULL, depending on what is being
* requested. It is possible that the returned uppervp
* will be the same as upperdvp.
*/
@@ -369,7 +369,7 @@ union_lookup(ap)
));
/*
- * Disallow write attemps to the filesystem mounted read-only.
+ * Disallow write attempts to the filesystem mounted read-only.
*/
if (uerror == EJUSTRETURN && (cnp->cn_flags & ISLASTCN) &&
(dvp->v_mount->mnt_flag & MNT_RDONLY) &&
@@ -379,7 +379,7 @@ union_lookup(ap)
}
/*
- * Special case. If cn_consume != 0 skip out. The result
+ * Special case: If cn_consume != 0 then skip out. The result
* of the lookup is transfered to our return variable. If
* an error occured we have to throw away the results.
*/
@@ -393,7 +393,7 @@ union_lookup(ap)
}
/*
- * Calculate whiteout, fall through
+ * Calculate whiteout, fall through.
*/
if (uerror == ENOENT || uerror == EJUSTRETURN) {
@@ -411,8 +411,8 @@ union_lookup(ap)
}
/*
- * in a similar way to the upper layer, do the lookup
- * in the lower layer. this time, if there is some
+ * In a similar way to the upper layer, do the lookup
+ * in the lower layer. This time, if there is some
* component magic going on, then vput whatever we got
* back from the upper layer and return the lower vnode
* instead.
@@ -481,18 +481,18 @@ union_lookup(ap)
*
* 1. If both layers returned an error, select the upper layer.
*
- * 2. If the upper layer faile and the bottom layer succeeded,
+ * 2. If the upper layer failed and the bottom layer succeeded,
* two subcases occur:
*
* a. The bottom vnode is not a directory, in which case
* just return a new union vnode referencing an
* empty top layer and the existing bottom layer.
*
- * b. The button vnode is a directory, in which case
+ * b. The bottom vnode is a directory, in which case
* create a new directory in the top layer and
* and fall through to case 3.
*
- * 3. If the top layer succeeded then return a new union
+ * 3. If the top layer succeeded, then return a new union
* vnode referencing whatever the new top layer and
* whatever the bottom layer returned.
*/
@@ -508,7 +508,7 @@ union_lookup(ap)
if (lowervp->v_type == VDIR) { /* case 2b. */
KASSERT(uppervp == NULL, ("uppervp unexpectedly non-NULL"));
/*
- * oops, uppervp has a problem, we may have to shadow.
+ * Oops, uppervp has a problem, we may have to shadow.
*/
uerror = union_mkshadow(um, upperdvp, cnp, &uppervp);
if (uerror) {
@@ -519,7 +519,7 @@ union_lookup(ap)
}
/*
- * Must call union_allocvp with both the upper and lower vnodes
+ * Must call union_allocvp() with both the upper and lower vnodes
* referenced and the upper vnode locked. ap->a_vpp is returned
* referenced and locked. lowervp, uppervp, and upperdvp are
* absorbed by union_allocvp() whether it succeeds or fails.
@@ -711,7 +711,7 @@ union_mknod(ap)
* union_open:
*
* run open VOP. When opening the underlying vnode we have to mimic
- * vn_open. What we *really* need to do to avoid screwups if the
+ * vn_open(). What we *really* need to do to avoid screwups if the
* open semantics change is to call vn_open(). For example, ufs blows
* up if you open a file but do not vmio it prior to writing.
*/
@@ -762,21 +762,21 @@ union_open(ap)
}
/*
- * We are holding the correct vnode, open it
+ * We are holding the correct vnode, open it.
*/
if (error == 0)
error = VOP_OPEN(tvp, mode, cred, td);
/*
- * Absolutely necessary or UFS will blowup
+ * This is absolutely necessary or UFS will blow up.
*/
if (error == 0 && vn_canvmio(tvp) == TRUE) {
error = vfs_object_create(tvp, td, cred);
}
/*
- * Release any locks held
+ * Release any locks held.
*/
if (tvpisupper) {
if (tvp)
@@ -896,7 +896,7 @@ union_access(ap)
*
* It's not clear whether VOP_GETATTR is to be
* called with the vnode locked or not. stat() calls
- * it with (vp) locked, and fstat calls it with
+ * it with (vp) locked, and fstat() calls it with
* (vp) unlocked.
*
* Because of this we cannot use our normal locking functions
@@ -936,7 +936,7 @@ union_getattr(ap)
error = VOP_GETATTR(vp, vap, ap->a_cred, ap->a_td);
if (error)
return (error);
- /* XXX isn't this dangerouso without a lock? */
+ /* XXX isn't this dangerous without a lock? */
union_newsize(ap->a_vp, vap->va_size, VNOVAL);
}
@@ -989,7 +989,7 @@ union_setattr(ap)
}
/*
- * Handle case of truncating lower object to zero size,
+ * Handle case of truncating lower object to zero size
* by creating a zero length upper object. This is to
* handle the case of open with O_TRUNC and O_CREAT.
*/
@@ -1037,8 +1037,8 @@ union_read(ap)
/*
* XXX
- * perhaps the size of the underlying object has changed under
- * our feet. take advantage of the offset information present
+ * Perhaps the size of the underlying object has changed under
+ * our feet. Take advantage of the offset information present
* in the uio structure.
*/
if (error == 0) {
@@ -1076,7 +1076,7 @@ union_write(ap)
error = VOP_WRITE(uppervp, ap->a_uio, ap->a_ioflag, ap->a_cred);
/*
- * the size of the underlying object may be changed by the
+ * The size of the underlying object may be changed by the
* write.
*/
if (error == 0) {
@@ -1226,7 +1226,6 @@ union_remove(ap)
*
* tdvp and vp will be locked on entry.
* tdvp and vp should remain locked on return.
- * on return.
*/
static int
@@ -1275,7 +1274,7 @@ union_link(ap)
/*
* Make sure upper is locked, then unlock the union directory we were
- * called with to avoid a deadlock while we are calling VOP_LINK on
+ * called with to avoid a deadlock while we are calling VOP_LINK() on
* the upper (with tdvp locked and vp not locked). Our ap->a_tdvp
* is expected to be locked on return.
*/
@@ -1402,7 +1401,7 @@ union_rename(ap)
* Figure out what tdvp (destination directory) to pass to the
* lower level. If we replace it with uppervp, we need to vput the
* old one. The exclusive lock is transfered to what we will pass
- * down in the VOP_RENAME and we replace uppervp with a simple
+ * down in the VOP_RENAME() and we replace uppervp with a simple
* reference.
*/
@@ -1411,7 +1410,7 @@ union_rename(ap)
if (un->un_uppervp == NULLVP) {
/*
- * this should never happen in normal
+ * This should never happen in normal
* operation but might if there was
* a problem creating the top-level shadow
* directory.
@@ -1421,8 +1420,8 @@ union_rename(ap)
}
/*
- * new tdvp is a lock and reference on uppervp, put away
- * the old tdvp.
+ * New tdvp is a lock and reference on uppervp.
+ * Put away the old tdvp.
*/
tdvp = union_lock_upper(un, ap->a_tcnp->cn_thread);
vput(ap->a_tdvp);
@@ -1432,7 +1431,7 @@ union_rename(ap)
* Figure out what tvp (destination file) to pass to the
* lower level.
*
- * If the uppervp file does not exist put away the (wrong)
+ * If the uppervp file does not exist, put away the (wrong)
* file and change tvp to NULL.
*/
@@ -1445,7 +1444,7 @@ union_rename(ap)
}
/*
- * VOP_RENAME releases/vputs prior to returning, so we have no
+ * VOP_RENAME() releases/vputs prior to returning, so we have no
* cleanup to do.
*/
@@ -1566,9 +1565,9 @@ union_symlink(ap)
}
/*
- * union_readdir works in concert with getdirentries and
+ * union_readdir ()works in concert with getdirentries() and
* readdir(3) to provide a list of entries in the unioned
- * directories. getdirentries is responsible for walking
+ * directories. getdirentries() is responsible for walking
* down the union stack. readdir(3) is responsible for
* eliminating duplicate names from the returned data stream.
*/
OpenPOWER on IntegriCloud