From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52:43 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2745356FF20; Thu, 25 Feb 2021 20:52:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DmlNS6XTBz3PKD; Thu, 25 Feb 2021 20:52:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0213E1E691; Thu, 25 Feb 2021 20:52:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 11PKqcWr079612; Thu, 25 Feb 2021 20:52:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqcBb079611; Thu, 25 Feb 2021 20:52:38 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:38 GMT Message-Id: <202102252052.11PKqcBb079611@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 16961e5e3fa4 - releng/13.0 - ffs_vnops.c: style MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 16961e5e3fa47563743b7e4dd8892d017000477a Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Feb 2021 20:52:43 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=16961e5e3fa47563743b7e4dd8892d017000477a commit 16961e5e3fa47563743b7e4dd8892d017000477a Author: Konstantin Belousov AuthorDate: 2021-02-20 17:01:40 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:50:47 +0000 ffs_vnops.c: style Approved by: re (delphij, gjb) (cherry picked from commit c6d68ca842a3f5b6814cdd5c87e406bad579b792) --- sys/ufs/ffs/ffs_vnops.c | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index c00469c4c7e3..f9a6a36d178a 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -1423,8 +1423,8 @@ ffs_close_ea(struct vnode *vp, int commit, struct ucred *cred, struct thread *td struct inode *ip; struct uio luio; struct iovec liovec; - int error; struct ufs2_dinode *dp; + int error; ip = VTOI(vp); @@ -1527,14 +1527,15 @@ struct vop_closeextattr_args { }; */ { + struct vnode *vp; - if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + vp = ap->a_vp; + if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); - - if (ap->a_commit && (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY)) + if (ap->a_commit && (vp->v_mount->mnt_flag & MNT_RDONLY) != 0) return (EROFS); - return (ffs_close_ea(ap->a_vp, ap->a_commit, ap->a_cred, ap->a_td)); + return (ffs_close_ea(vp, ap->a_commit, ap->a_cred, ap->a_td)); } /* @@ -1552,6 +1553,7 @@ vop_deleteextattr { }; */ { + struct vnode *vp; struct inode *ip; struct extattr *eap; uint32_t ul; @@ -1559,18 +1561,17 @@ vop_deleteextattr { u_char *eae; void *tmp; - ip = VTOI(ap->a_vp); + vp = ap->a_vp; + ip = VTOI(vp); - if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); - if (strlen(ap->a_name) == 0) return (EINVAL); - - if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) + if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); - error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + error = extattr_check_cred(vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VWRITE); if (error) { /* @@ -1582,7 +1583,7 @@ vop_deleteextattr { return (error); } - error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); @@ -1596,7 +1597,7 @@ vop_deleteextattr { if (olen == -1) { /* delete but nonexistent */ free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(vp, 0, ap->a_cred, ap->a_td); return (ENOATTR); } ul = eap->ea_length; @@ -1608,7 +1609,7 @@ vop_deleteextattr { ip->i_ea_area = eae; ip->i_ea_len = easize; free(tmp, M_TEMP); - error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td); + error = ffs_close_ea(vp, 1, ap->a_cred, ap->a_td); return (error); } @@ -1741,6 +1742,7 @@ vop_setextattr { }; */ { + struct vnode *vp; struct inode *ip; struct fs *fs; struct extattr *eap; @@ -1750,12 +1752,12 @@ vop_setextattr { u_char *eae; void *tmp; - ip = VTOI(ap->a_vp); + vp = ap->a_vp; + ip = VTOI(vp); fs = ITOFS(ip); - if (ap->a_vp->v_type == VCHR || ap->a_vp->v_type == VBLK) + if (vp->v_type == VCHR || vp->v_type == VBLK) return (EOPNOTSUPP); - if (strlen(ap->a_name) == 0) return (EINVAL); @@ -1763,14 +1765,14 @@ vop_setextattr { if (ap->a_uio == NULL) return (EOPNOTSUPP); - if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) + if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); ealen = ap->a_uio->uio_resid; if (ealen < 0 || ealen > lblktosize(fs, UFS_NXADDR)) return (EINVAL); - error = extattr_check_cred(ap->a_vp, ap->a_attrnamespace, + error = extattr_check_cred(vp, ap->a_attrnamespace, ap->a_cred, ap->a_td, VWRITE); if (error) { /* @@ -1782,7 +1784,7 @@ vop_setextattr { return (error); } - error = ffs_open_ea(ap->a_vp, ap->a_cred, ap->a_td); + error = ffs_open_ea(vp, ap->a_cred, ap->a_td); if (error) return (error); @@ -1819,7 +1821,7 @@ vop_setextattr { } if (easize > lblktosize(fs, UFS_NXADDR)) { free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(vp, 0, ap->a_cred, ap->a_td); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = ENOSPC; return (ENOSPC); @@ -1833,7 +1835,7 @@ vop_setextattr { error = uiomove(EXTATTR_CONTENT(eap), ealen, ap->a_uio); if (error) { free(eae, M_TEMP); - ffs_close_ea(ap->a_vp, 0, ap->a_cred, ap->a_td); + ffs_close_ea(vp, 0, ap->a_cred, ap->a_td); if (ip->i_ea_area != NULL && ip->i_ea_error == 0) ip->i_ea_error = error; return (error); @@ -1844,7 +1846,7 @@ vop_setextattr { ip->i_ea_area = eae; ip->i_ea_len = easize; free(tmp, M_TEMP); - error = ffs_close_ea(ap->a_vp, 1, ap->a_cred, ap->a_td); + error = ffs_close_ea(vp, 1, ap->a_cred, ap->a_td); return (error); }