Deleted Added
full compact
procfs.c (159283) procfs.c (166548)
1/*-
2 * Copyright (c) 2001 Dag-Erling Sm�rgrav
3 * Copyright (c) 1993 Jan-Simon Pendry
4 * Copyright (c) 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Jan-Simon Pendry.

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

32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95
39 *
1/*-
2 * Copyright (c) 2001 Dag-Erling Sm�rgrav
3 * Copyright (c) 1993 Jan-Simon Pendry
4 * Copyright (c) 1993
5 * The Regents of the University of California. All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * Jan-Simon Pendry.

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

32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)procfs_vfsops.c 8.7 (Berkeley) 5/10/95
39 *
40 * $FreeBSD: head/sys/fs/procfs/procfs.c 159283 2006-06-05 16:41:27Z ghelmer $
40 * $FreeBSD: head/sys/fs/procfs/procfs.c 166548 2007-02-07 10:30:49Z kib $
41 */
42
43#include <sys/param.h>
44#include <sys/queue.h>
45#include <sys/exec.h>
46#include <sys/lock.h>
47#include <sys/kernel.h>
48#include <sys/malloc.h>

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

64/*
65 * Filler function for proc/pid/self
66 */
67int
68procfs_doprocfile(PFS_FILL_ARGS)
69{
70 char *fullpath = "unknown";
71 char *freepath = NULL;
41 */
42
43#include <sys/param.h>
44#include <sys/queue.h>
45#include <sys/exec.h>
46#include <sys/lock.h>
47#include <sys/kernel.h>
48#include <sys/malloc.h>

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

64/*
65 * Filler function for proc/pid/self
66 */
67int
68procfs_doprocfile(PFS_FILL_ARGS)
69{
70 char *fullpath = "unknown";
71 char *freepath = NULL;
72 struct vnode *textvp;
73 int err;
72
74
73 vn_lock(p->p_textvp, LK_EXCLUSIVE | LK_RETRY, td);
74 vn_fullpath(td, p->p_textvp, &fullpath, &freepath);
75 VOP_UNLOCK(p->p_textvp, 0, td);
75 textvp = p->p_textvp;
76 VI_LOCK(textvp);
77 vholdl(textvp);
78 err = vn_lock(textvp, LK_EXCLUSIVE | LK_INTERLOCK, td);
79 vdrop(textvp);
80 if (err)
81 return (err);
82 vn_fullpath(td, textvp, &fullpath, &freepath);
83 VOP_UNLOCK(textvp, 0, td);
76 sbuf_printf(sb, "%s", fullpath);
77 if (freepath)
78 free(freepath, M_TEMP);
79 return (0);
80}
81
82/*
83 * Filler function for proc/curproc

--- 119 unchanged lines hidden ---
84 sbuf_printf(sb, "%s", fullpath);
85 if (freepath)
86 free(freepath, M_TEMP);
87 return (0);
88}
89
90/*
91 * Filler function for proc/curproc

--- 119 unchanged lines hidden ---