o Commit reems of style(9) changes, whitespace improvements, and comment

cleanups.

Obtained from:	TrustedBSD Project
This commit is contained in:
rwatson 2001-01-07 23:45:56 +00:00
parent 7771dfaccb
commit 8e64b8803d

View File

@ -65,7 +65,7 @@ static int ufs_extattr_rm(struct vnode *vp, const char *name,
struct ucred *cred, struct proc *p);
/*
* Per-FS attribute lock protecting attribute operations
* Per-FS attribute lock protecting attribute operations.
* XXX Right now there is a lot of lock contention due to having a single
* lock per-FS; really, this should be far more fine-grained.
*/
@ -73,7 +73,7 @@ static void
ufs_extattr_uepm_lock(struct ufsmount *ump, struct proc *p)
{
/* ideally, LK_CANRECURSE would not be used, here */
/* Ideally, LK_CANRECURSE would not be used, here. */
lockmgr(&ump->um_extattr.uepm_lock, LK_EXCLUSIVE | LK_RETRY |
LK_CANRECURSE, 0, p);
}
@ -91,8 +91,8 @@ ufs_extattr_uepm_unlock(struct ufsmount *ump, struct proc *p)
*
* Invalid currently consists of:
* NULL pointer for attrname
* zero-length attrname (used to retrieve application attr list)
* attrname consisting of "$" (used to treive system attr list)
* zero-length attrname (used to retrieve application attribute list)
* attrname consisting of "$" (used to treive system attribute list)
*/
static int
ufs_extattr_valid_attrname(const char *attrname)
@ -168,7 +168,7 @@ ufs_extattr_uepm_destroy(struct ufs_extattr_per_mount *uepm)
}
/*
* Start extended attribute support on an FS
* Start extended attribute support on an FS.
*/
int
ufs_extattr_start(struct mount *mp, struct proc *p)
@ -201,7 +201,7 @@ unlock:
}
/*
* Stop extended attribute support on an FS
* Stop extended attribute support on an FS.
*/
int
ufs_extattr_stop(struct mount *mp, struct proc *p)
@ -322,7 +322,7 @@ free_exit:
}
/*
* Disable extended attribute support on an FS
* Disable extended attribute support on an FS.
*/
static int
ufs_extattr_disable(struct ufsmount *ump, const char *attrname, struct proc *p)
@ -348,8 +348,8 @@ ufs_extattr_disable(struct ufsmount *ump, const char *attrname, struct proc *p)
}
/*
* VFS call to manage extended attributes in UFS
* attrname, arg are userspace pointers from the syscall
* VFS call to manage extended attributes in UFS.
* attrname, arg are userspace pointers from the syscall.
*/
int
ufs_extattrctl(struct mount *mp, int cmd, const char *attrname,
@ -358,7 +358,7 @@ ufs_extattrctl(struct mount *mp, int cmd, const char *attrname,
struct nameidata nd;
struct ufsmount *ump = VFSTOUFS(mp);
struct vnode *vp;
char local_attrname[UFS_EXTATTR_MAXEXTATTRNAME]; /* inc null */
char local_attrname[UFS_EXTATTR_MAXEXTATTRNAME]; /* Incl. null. */
char *filename;
int error, flags;
size_t len;
@ -430,7 +430,7 @@ ufs_extattr_credcheck(struct vnode *vp, struct ufs_extattr_list_entry *uele,
uele->uele_attrname[0] == '$');
/*
* Kernel-invoked always succeeds
* Kernel-invoked always succeeds.
*/
if (cred == NULL)
return (0);
@ -449,7 +449,7 @@ ufs_extattr_credcheck(struct vnode *vp, struct ufs_extattr_list_entry *uele,
}
/*
* Vnode operating to retrieve a named extended attribute
* Vnode operating to retrieve a named extended attribute.
*/
int
ufs_vop_getextattr(struct vop_getextattr_args *ap)
@ -500,7 +500,7 @@ ufs_extattr_get(struct vnode *vp, const char *name, struct uio *uio,
return (EOPNOTSUPP);
if (strlen(name) == 0 || (strlen(name) == 1 && name[0] == '$')) {
/* XXX retrieve attribute lists */
/* XXX retrieve attribute lists. */
return (EINVAL);
}
@ -514,15 +514,14 @@ ufs_extattr_get(struct vnode *vp, const char *name, struct uio *uio,
/*
* Allow only offsets of zero to encourage the read/replace
* extended attribute semantic. Otherwise we can't guarantee
* atomicity, as we don't provide locks for extended
* attributes.
* atomicity, as we don't provide locks for extended attributes.
*/
if (uio->uio_offset != 0)
return (ENXIO);
/*
* Find base offset of header in file based on file header size, and
* data header size + maximum data size, indexed by inode number
* data header size + maximum data size, indexed by inode number.
*/
base_offset = sizeof(struct ufs_extattr_fileheader) +
ip->i_number * (sizeof(struct ufs_extattr_header) +
@ -560,13 +559,13 @@ ufs_extattr_get(struct vnode *vp, const char *name, struct uio *uio,
if (error)
goto vopunlock_exit;
/* defined? */
/* Defined? */
if ((ueh.ueh_flags & UFS_EXTATTR_ATTR_FLAG_INUSE) == 0) {
error = ENOENT;
goto vopunlock_exit;
}
/* valid for the current inode generation? */
/* Valid for the current inode generation? */
if (ueh.ueh_i_gen != ip->i_gen) {
/*
* The inode itself has a different generation number
@ -574,19 +573,19 @@ ufs_extattr_get(struct vnode *vp, const char *name, struct uio *uio,
* is to coerce this to undefined, and let it get cleaned
* up by the next write or extattrctl clean.
*/
printf("ufs_extattr_get: inode %lu inconsistency (%d, %d)\n",
(u_long)ip->i_number, ueh.ueh_i_gen, ip->i_gen);
printf("ufs_extattr_get: inode number inconsistency (%d, %d)\n",
ueh.ueh_i_gen, ip->i_gen);
error = ENOENT;
goto vopunlock_exit;
}
/* local size consistency check */
/* Local size consistency check. */
if (ueh.ueh_len > attribute->uele_fileheader.uef_size) {
error = ENXIO;
goto vopunlock_exit;
}
/* allow for offset into the attr data */
/* Allow for offset into the attribute data. */
uio->uio_offset = base_offset + sizeof(struct ufs_extattr_header);
/*
@ -615,7 +614,7 @@ vopunlock_exit:
}
/*
* Vnode operation to set a named attribute
* Vnode operation to set a named attribute.
*/
int
ufs_vop_setextattr(struct vop_setextattr_args *ap)
@ -681,7 +680,7 @@ ufs_extattr_set(struct vnode *vp, const char *name, struct uio *uio,
return (error);
/*
* Early rejection of invalid offsets/lengths
* Early rejection of invalid offsets/length.
* Reject: any offset but 0 (replace)
* Any size greater than attribute size limit
*/
@ -691,14 +690,14 @@ ufs_extattr_set(struct vnode *vp, const char *name, struct uio *uio,
/*
* Find base offset of header in file based on file header size, and
* data header size + maximum data size, indexed by inode number
* data header size + maximum data size, indexed by inode number.
*/
base_offset = sizeof(struct ufs_extattr_fileheader) +
ip->i_number * (sizeof(struct ufs_extattr_header) +
attribute->uele_fileheader.uef_size);
/*
* Write out a data header for the data
* Write out a data header for the data.
*/
ueh.ueh_len = uio->uio_resid;
ueh.ueh_flags = UFS_EXTATTR_ATTR_FLAG_INUSE;
@ -737,7 +736,7 @@ ufs_extattr_set(struct vnode *vp, const char *name, struct uio *uio,
}
/*
* Write out user data
* Write out user data.
*/
uio->uio_offset = base_offset + sizeof(struct ufs_extattr_header);
@ -787,7 +786,7 @@ ufs_extattr_rm(struct vnode *vp, const char *name, struct ucred *cred,
/*
* Find base offset of header in file based on file header size, and
* data header size + maximum data size, indexed by inode number
* data header size + maximum data size, indexed by inode number.
*/
base_offset = sizeof(struct ufs_extattr_fileheader) +
ip->i_number * (sizeof(struct ufs_extattr_header) +
@ -823,7 +822,7 @@ ufs_extattr_rm(struct vnode *vp, const char *name, struct ucred *cred,
if (error)
goto vopunlock_exit;
/* defined? */
/* Defined? */
if ((ueh.ueh_flags & UFS_EXTATTR_ATTR_FLAG_INUSE) == 0) {
error = ENOENT;
goto vopunlock_exit;
@ -837,13 +836,13 @@ ufs_extattr_rm(struct vnode *vp, const char *name, struct ucred *cred,
* coerce this to undefined, and let it get cleaned up by
* the next write or extattrctl clean.
*/
printf("ufs_extattr_rm: inode %lu inconsistency (%d, %d)\n",
(u_long)ip->i_number, ueh.ueh_i_gen, ip->i_gen);
printf("ufs_extattr_rm: inode number inconsistency (%d, %d)\n",
ueh.ueh_i_gen, ip->i_gen);
error = ENOENT;
goto vopunlock_exit;
}
/* flag it as not in use */
/* Flag it as not in use. */
ueh.ueh_flags = 0;
ueh.ueh_len = 0;