Deleted Added
full compact
linprocfs.c (159995) linprocfs.c (161094)
1/*-
2 * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav
3 * Copyright (c) 1999 Pierre Beyssac
4 * Copyright (c) 1993 Jan-Simon Pendry
5 * Copyright (c) 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by

--- 26 unchanged lines hidden (view full) ---

35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94
40 */
41
42#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav
3 * Copyright (c) 1999 Pierre Beyssac
4 * Copyright (c) 1993 Jan-Simon Pendry
5 * Copyright (c) 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by

--- 26 unchanged lines hidden (view full) ---

35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 * SUCH DAMAGE.
38 *
39 * @(#)procfs_status.c 8.4 (Berkeley) 6/15/94
40 */
41
42#include <sys/cdefs.h>
43__FBSDID("$FreeBSD: head/sys/compat/linprocfs/linprocfs.c 159995 2006-06-27 20:11:58Z netchild $");
43__FBSDID("$FreeBSD: head/sys/compat/linprocfs/linprocfs.c 161094 2006-08-08 12:29:26Z kib $");
44
45#include <sys/param.h>
46#include <sys/queue.h>
47#include <sys/blist.h>
48#include <sys/conf.h>
49#include <sys/exec.h>
50#include <sys/filedesc.h>
51#include <sys/jail.h>

--- 746 unchanged lines hidden (view full) ---

798 vm_ooffset_t off = 0;
799 char *name = "", *freename = NULL;
800 size_t len;
801 ino_t ino;
802 int ref_count, shadow_count, flags;
803 int error;
804 struct vnode *vp;
805 struct vattr vat;
44
45#include <sys/param.h>
46#include <sys/queue.h>
47#include <sys/blist.h>
48#include <sys/conf.h>
49#include <sys/exec.h>
50#include <sys/filedesc.h>
51#include <sys/jail.h>

--- 746 unchanged lines hidden (view full) ---

798 vm_ooffset_t off = 0;
799 char *name = "", *freename = NULL;
800 size_t len;
801 ino_t ino;
802 int ref_count, shadow_count, flags;
803 int error;
804 struct vnode *vp;
805 struct vattr vat;
806 int locked;
806
807 PROC_LOCK(p);
808 error = p_candebug(td, p);
809 PROC_UNLOCK(p);
810 if (error)
811 return (error);
812
813 if (uio->uio_rw != UIO_READ)

--- 12 unchanged lines hidden (view full) ---

826 freename = NULL;
827 if (entry->eflags & MAP_ENTRY_IS_SUB_MAP)
828 continue;
829 obj = entry->object.vm_object;
830 for (lobj = tobj = obj; tobj; tobj = tobj->backing_object)
831 lobj = tobj;
832 ino = 0;
833 if (lobj) {
807
808 PROC_LOCK(p);
809 error = p_candebug(td, p);
810 PROC_UNLOCK(p);
811 if (error)
812 return (error);
813
814 if (uio->uio_rw != UIO_READ)

--- 12 unchanged lines hidden (view full) ---

827 freename = NULL;
828 if (entry->eflags & MAP_ENTRY_IS_SUB_MAP)
829 continue;
830 obj = entry->object.vm_object;
831 for (lobj = tobj = obj; tobj; tobj = tobj->backing_object)
832 lobj = tobj;
833 ino = 0;
834 if (lobj) {
834 vp = lobj->handle;
835 VM_OBJECT_LOCK(lobj);
836 off = IDX_TO_OFF(lobj->size);
835 VM_OBJECT_LOCK(lobj);
836 off = IDX_TO_OFF(lobj->size);
837 if (lobj->type == OBJT_VNODE && lobj->handle) {
838 vn_fullpath(td, vp, &name, &freename);
839 VOP_GETATTR(vp, &vat, td->td_ucred, td);
840 ino = vat.va_fileid;
837 if (lobj->type == OBJT_VNODE) {
838 vp = lobj->handle;
839 if (vp)
840 vref(vp);
841 }
841 }
842 else
843 vp = NULL;
842 flags = obj->flags;
843 ref_count = obj->ref_count;
844 shadow_count = obj->shadow_count;
845 VM_OBJECT_UNLOCK(lobj);
844 flags = obj->flags;
845 ref_count = obj->ref_count;
846 shadow_count = obj->shadow_count;
847 VM_OBJECT_UNLOCK(lobj);
848 if (vp) {
849 vn_fullpath(td, vp, &name, &freename);
850 locked = VFS_LOCK_GIANT(vp->v_mount);
851 vn_lock(vp, LK_SHARED | LK_RETRY, td);
852 VOP_GETATTR(vp, &vat, td->td_ucred, td);
853 ino = vat.va_fileid;
854 vput(vp);
855 VFS_UNLOCK_GIANT(locked);
856 }
846 } else {
847 flags = 0;
848 ref_count = 0;
849 shadow_count = 0;
850 }
851
852 /*
853 * format:

--- 218 unchanged lines hidden ---
857 } else {
858 flags = 0;
859 ref_count = 0;
860 shadow_count = 0;
861 }
862
863 /*
864 * format:

--- 218 unchanged lines hidden ---