Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ufs ufs: Nix trailing whitespace and tidy up some ot...



details:   https://anonhg.NetBSD.org/src/rev/6df4a34d1d33
branches:  trunk
changeset: 373643:6df4a34d1d33
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Feb 22 21:49:45 2023 +0000

description:
ufs: Nix trailing whitespace and tidy up some other minor KNF.

diffstat:

 sys/ufs/ufs/quota1_subr.c |    9 +-
 sys/ufs/ufs/quota2.h      |    4 +-
 sys/ufs/ufs/quota2_subr.c |   13 ++--
 sys/ufs/ufs/ufs_acl.c     |    8 +-
 sys/ufs/ufs/ufs_extattr.c |   87 +++++++++++++++---------------
 sys/ufs/ufs/ufs_lookup.c  |    8 +-
 sys/ufs/ufs/ufs_quota.c   |  130 +++++++++++++++++++++++-----------------------
 sys/ufs/ufs/ufs_quota1.c  |   39 +++++++------
 sys/ufs/ufs/ufs_quota2.c  |   65 ++++++++++++----------
 sys/ufs/ufs/ufs_vfsops.c  |    8 +-
 10 files changed, 188 insertions(+), 183 deletions(-)

diffs (truncated from 1218 to 300 lines):

diff -r 0f98bf94a05e -r 6df4a34d1d33 sys/ufs/ufs/quota1_subr.c
--- a/sys/ufs/ufs/quota1_subr.c Wed Feb 22 21:44:45 2023 +0000
+++ b/sys/ufs/ufs/quota1_subr.c Wed Feb 22 21:49:45 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: quota1_subr.c,v 1.7 2012/01/29 06:23:20 dholland Exp $ */
+/* $NetBSD: quota1_subr.c,v 1.8 2023/02/22 21:49:45 riastradh Exp $ */
 /*-
   * Copyright (c) 2010 Manuel Bouyer
   * All rights reserved.
@@ -26,7 +26,7 @@
   */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: quota1_subr.c,v 1.7 2012/01/29 06:23:20 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: quota1_subr.c,v 1.8 2023/02/22 21:49:45 riastradh Exp $");
 
 #include <sys/types.h>
 #include <machine/limits.h>
@@ -54,7 +54,7 @@
 
 void
 dqblk_to_quotavals(const struct dqblk *dqblk,
-                  struct quotaval *blocks, struct quotaval *files)
+    struct quotaval *blocks, struct quotaval *files)
 {
        /* XXX is qv_grace getting handled correctly? */
 
@@ -71,7 +71,7 @@
 
 void
 quotavals_to_dqblk(const struct quotaval *blocks, const struct quotaval *files,
-                  struct dqblk *dqblk)
+    struct dqblk *dqblk)
 {
        /* XXX is qv_grace getting handled correctly? */
 
@@ -85,4 +85,3 @@
        dqblk->dqb_curinodes  = files->qv_usage;
        dqblk->dqb_itime      = files->qv_expiretime;
 }
-
diff -r 0f98bf94a05e -r 6df4a34d1d33 sys/ufs/ufs/quota2.h
--- a/sys/ufs/ufs/quota2.h      Wed Feb 22 21:44:45 2023 +0000
+++ b/sys/ufs/ufs/quota2.h      Wed Feb 22 21:49:45 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: quota2.h,v 1.10 2017/10/25 18:06:01 jdolecek Exp $ */
+/* $NetBSD: quota2.h,v 1.11 2023/02/22 21:49:45 riastradh Exp $ */
 /*-
   * Copyright (c) 2010 Manuel Bouyer
   * All rights reserved.
@@ -115,7 +115,7 @@
 #define QL_S_ALLOW_SOFT        0x01 /* over soft limit */
 #define QL_S_DENY_GRACE        0x02 /* over soft limit, grace time expired */
 #define QL_S_DENY_HARD 0x03 /* over hard limit */
- 
+
 #define QL_F_CROSS     0x80 /* crossing soft limit */
 
 #define QL_STATUS(x)   ((x) & 0x0f)
diff -r 0f98bf94a05e -r 6df4a34d1d33 sys/ufs/ufs/quota2_subr.c
--- a/sys/ufs/ufs/quota2_subr.c Wed Feb 22 21:44:45 2023 +0000
+++ b/sys/ufs/ufs/quota2_subr.c Wed Feb 22 21:49:45 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: quota2_subr.c,v 1.5 2012/02/05 14:19:04 dholland Exp $ */
+/* $NetBSD: quota2_subr.c,v 1.6 2023/02/22 21:49:45 riastradh Exp $ */
 /*-
   * Copyright (c) 2010, 2011 Manuel Bouyer
   * All rights reserved.
@@ -26,7 +26,7 @@
   */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: quota2_subr.c,v 1.5 2012/02/05 14:19:04 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: quota2_subr.c,v 1.6 2023/02/22 21:49:45 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/time.h>
@@ -87,7 +87,8 @@
 }
 
 void
-quota2_ufs_rwq2v(const struct quota2_val *s, struct quota2_val *d, int needswap)
+quota2_ufs_rwq2v(const struct quota2_val *s, struct quota2_val *d,
+    int needswap)
 {
        d->q2v_hardlimit = ufs_rw64(s->q2v_hardlimit, needswap);
        d->q2v_softlimit = ufs_rw64(s->q2v_softlimit, needswap);
@@ -98,7 +99,7 @@
 
 void
 quota2_ufs_rwq2e(const struct quota2_entry *s, struct quota2_entry *d,
-int needswap)
+    int needswap)
 {
        quota2_ufs_rwq2v(&s->q2e_val[QL_BLOCK], &d->q2e_val[QL_BLOCK],
            needswap);
@@ -110,7 +111,7 @@
 int
 quota_check_limit(uint64_t cur, uint64_t change, uint64_t soft, uint64_t hard,
     time_t expire, time_t now)
-{ 
+{
        if (cur + change > hard) {
                if (cur <= soft)
                        return (QL_F_CROSS | QL_S_DENY_HARD);
@@ -124,4 +125,4 @@
                return QL_S_ALLOW_SOFT;
        }
        return QL_S_ALLOW_OK;
-} 
+}
diff -r 0f98bf94a05e -r 6df4a34d1d33 sys/ufs/ufs/ufs_acl.c
--- a/sys/ufs/ufs/ufs_acl.c     Wed Feb 22 21:44:45 2023 +0000
+++ b/sys/ufs/ufs/ufs_acl.c     Wed Feb 22 21:49:45 2023 +0000
@@ -36,9 +36,9 @@
 #if 0
 __FBSDID("$FreeBSD: head/sys/ufs/ufs/ufs_acl.c 356669 2020-01-13 02:31:51Z mjg $");
 #endif
-__KERNEL_RCSID(0, "$NetBSD: ufs_acl.c,v 1.4 2021/11/26 17:35:12 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_acl.c,v 1.5 2023/02/22 21:49:45 riastradh Exp $");
 
-#if defined(_KERNEL_OPT) 
+#if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
 #include "opt_quota.h"
 #include "opt_wapbl.h"
@@ -94,7 +94,7 @@
                            ACL_USER_OBJ, ip->i_mode);
                        acl->acl_entry[i].ae_id = ACL_UNDEFINED_ID;
                        break;
-       
+
                case ACL_GROUP_OBJ:
                        acl_group_obj = &acl->acl_entry[i];
                        acl->acl_entry[i].ae_id = ACL_UNDEFINED_ID;
@@ -114,7 +114,7 @@
                case ACL_USER:
                case ACL_GROUP:
                        break;
-       
+
                default:
                        panic("ufs_sync_acl_from_inode(): bad ae_tag");
                }
diff -r 0f98bf94a05e -r 6df4a34d1d33 sys/ufs/ufs/ufs_extattr.c
--- a/sys/ufs/ufs/ufs_extattr.c Wed Feb 22 21:44:45 2023 +0000
+++ b/sys/ufs/ufs/ufs_extattr.c Wed Feb 22 21:49:45 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_extattr.c,v 1.53 2021/06/29 22:40:54 dholland Exp $        */
+/*     $NetBSD: ufs_extattr.c,v 1.54 2023/02/22 21:49:45 riastradh Exp $       */
 
 /*-
  * Copyright (c) 1999-2002 Robert N. M. Watson
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_extattr.c,v 1.53 2021/06/29 22:40:54 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ufs_extattr.c,v 1.54 2023/02/22 21:49:45 riastradh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ffs.h"
@@ -103,8 +103,8 @@
                    const char *name, kauth_cred_t cred, struct lwp *l);
 static struct ufs_extattr_list_entry *ufs_extattr_find_attr(struct ufsmount *,
                    int, const char *);
-static int     ufs_extattr_get_header(struct vnode *, 
-                   struct ufs_extattr_list_entry *, 
+static int     ufs_extattr_get_header(struct vnode *,
+                   struct ufs_extattr_list_entry *,
                    struct ufs_extattr_header *, off_t *);
 
 
@@ -180,17 +180,17 @@
 
        path = PNBUF_GET();
 
-       /* 
+       /*
         * We only support system and user namespace autocreation
-        */ 
+        */
        switch (attrnamespace) {
        case EXTATTR_NAMESPACE_SYSTEM:
-               (void)snprintf(path, PATH_MAX, "%s/%s/%s/%s", 
+               (void)snprintf(path, PATH_MAX, "%s/%s/%s/%s",
                    mp->mnt_stat.f_mntonname, UFS_EXTATTR_FSROOTSUBDIR,
                    UFS_EXTATTR_SUBDIR_SYSTEM, attrname);
                break;
        case EXTATTR_NAMESPACE_USER:
-               (void)snprintf(path, PATH_MAX, "%s/%s/%s/%s", 
+               (void)snprintf(path, PATH_MAX, "%s/%s/%s/%s",
                    mp->mnt_stat.f_mntonname, UFS_EXTATTR_FSROOTSUBDIR,
                    UFS_EXTATTR_SUBDIR_USER, attrname);
                break;
@@ -203,8 +203,8 @@
 
        /*
         * Release extended attribute mount lock, otherwise
-        * we can deadlock with another thread that would lock 
-        * vp after we unlock it below, and call 
+        * we can deadlock with another thread that would lock
+        * vp after we unlock it below, and call
         * ufs_extattr_uepm_lock(ump), for instance
         * in ufs_getextattr().
         */
@@ -212,20 +212,20 @@
 
        /*
         * XXX unlock/lock should only be done when setting extattr
-        * on backing store or one of its parent directory 
+        * on backing store or one of its parent directory
         * including root, but we always do it for now.
-        */ 
+        */
        KASSERT(VOP_ISLOCKED(vp) == LK_EXCLUSIVE);
        VOP_UNLOCK(vp);
 
        pb = pathbuf_create(path);
-       
+
        /*
         * Since we do not hold ufs_extattr_uepm_lock anymore,
         * another thread may race with us for backend creation,
         * but only one can succeed here thanks to O_EXCL.
         *
-        * backing_vp is the backing store. 
+        * backing_vp is the backing store.
         */
        error = vn_open(NULL, pb, 0, O_CREAT|O_EXCL|O_RDWR, 0600,
            &backing_vp, NULL, NULL);
@@ -256,13 +256,13 @@
        uef.uef_size = ufs_extattr_autocreate;
 
        error = vn_rdwr(UIO_WRITE, backing_vp, &uef, sizeof(uef), 0,
-                       UIO_SYSSPACE, IO_NODELOCKED|IO_APPEND, 
+                       UIO_SYSSPACE, IO_NODELOCKED|IO_APPEND,
                        l->l_cred, NULL, l);
 
        VOP_UNLOCK(backing_vp);
 
        if (error != 0) {
-               printf("%s: write uef header failed for `%s' (%d)\n", 
+               printf("%s: write uef header failed for `%s' (%d)\n",
                    __func__, attrname, error);
                vn_close(backing_vp, FREAD|FWRITE, l->l_cred);
                *uelep = NULL;
@@ -270,13 +270,13 @@
        }
 
        /*
-        * Now enable attribute. 
+        * Now enable attribute.
         */
        error = ufs_extattr_enable(ump,attrnamespace, attrname, backing_vp, l);
        KASSERT(VOP_ISLOCKED(backing_vp) == 0);
 
        if (error != 0) {
-               printf("%s: enable `%s' failed (%d)\n", 
+               printf("%s: enable `%s' failed (%d)\n",
                    __func__, attrname, error);
                vn_close(backing_vp, FREAD|FWRITE, l->l_cred);
                *uelep = NULL;
@@ -286,7 +286,7 @@
        uele = ufs_extattr_find_attr(ump, attrnamespace, attrname);
        if (uele == NULL) {
                printf("%s: atttribute `%s' created but not found!\n",
-                      __func__, attrname);
+                   __func__, attrname);
                vn_close(backing_vp, FREAD|FWRITE, l->l_cred);
                *uelep = NULL;
                return ESRCH; /* really internal error */
@@ -313,7 +313,7 @@
            search_attribute != NULL;
            search_attribute = LIST_NEXT(search_attribute, uele_entries)) {
                if (!(strncmp(attrname, search_attribute->uele_attrname,
-                   UFS_EXTATTR_MAXEXTATTRNAME)) &&
+                           UFS_EXTATTR_MAXEXTATTRNAME)) &&
                    (attrnamespace == search_attribute->uele_attrnamespace)) {
                        return search_attribute;
                }
@@ -406,7 +406,8 @@
  * one lock, requiring the caller to possibly special-case.
  */
 static int
-ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, const char *dirname,
+ufs_extattr_lookup(struct vnode *start_dvp, int lockparent,
+    const char *dirname,
     struct vnode **vp, struct lwp *l)
 {
        struct vop_lookup_v2_args vargs;
@@ -594,7 +595,7 @@
                }
        }
        kmem_free(dirbuf, UFS_DIRBLKSIZ);
-       
+
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index