From owner-svn-src-all@freebsd.org Mon Dec 10 01:38:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB597130D1FB; Mon, 10 Dec 2018 01:38:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90A1C88205; Mon, 10 Dec 2018 01:38:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71901194D7; Mon, 10 Dec 2018 01:38:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBA1cnV7053302; Mon, 10 Dec 2018 01:38:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBA1cnNg053301; Mon, 10 Dec 2018 01:38:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812100138.wBA1cnNg053301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 10 Dec 2018 01:38:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r341778 - in stable/11/sys: compat/linuxkpi/common/src sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys: compat/linuxkpi/common/src sys X-SVN-Commit-Revision: 341778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 90A1C88205 X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-0.99)[-0.990,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Dec 2018 01:38:50 -0000 Author: kib Date: Mon Dec 10 01:38:48 2018 New Revision: 341778 URL: https://svnweb.freebsd.org/changeset/base/341778 Log: MFC r341447: Improve procstat reporting for the linux cdev file descriptors. Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c stable/11/sys/sys/user.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Mon Dec 10 01:03:16 2018 (r341777) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Mon Dec 10 01:38:48 2018 (r341778) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1546,8 +1547,24 @@ static int linux_file_fill_kinfo(struct file *fp, struct kinfo_file *kif, struct filedesc *fdp) { + struct linux_file *filp; + struct vnode *vp; + int error; - return (0); + filp = fp->f_data; + vp = filp->f_vnode; + if (vp == NULL) { + error = 0; + kif->kf_type = KF_TYPE_DEV; + } else { + vref(vp); + FILEDESC_SUNLOCK(fdp); + error = vn_fill_kinfo_vnode(vp, kif); + vrele(vp); + kif->kf_type = KF_TYPE_VNODE; + FILEDESC_SLOCK(fdp); + } + return (error); } unsigned int Modified: stable/11/sys/sys/user.h ============================================================================== --- stable/11/sys/sys/user.h Mon Dec 10 01:03:16 2018 (r341777) +++ stable/11/sys/sys/user.h Mon Dec 10 01:38:48 2018 (r341778) @@ -259,6 +259,7 @@ struct user { #define KF_TYPE_SEM 9 #define KF_TYPE_PTS 10 #define KF_TYPE_PROCDESC 11 +#define KF_TYPE_DEV 12 #define KF_TYPE_UNKNOWN 255 #define KF_VTYPE_VNON 0