Diffs for NetBSD-current 3.99.14
Ty Sarna
tsarna at sarna.org
Sun Jan 22 05:08:32 CET 2006
next, 3.99.14, which changes many uses of proc to lwp...
No additional patches are needed for 3.99.15, the current NetBSD-current
version.
--- arla-0.41/nnpfs/bsd/nnpfs/nnpfs_locl.h.orig 2005-11-30 02:25:13.000000000 -0500
+++ arla-0.41/nnpfs/bsd/nnpfs/nnpfs_locl.h 2006-01-02 12:56:31.000000000 -0500
@@ -215,14 +215,21 @@
typedef d_thread_t syscall_d_thread_t;
#define syscall_thread_to_thread(x) (x)
#else /* !__FreeBSD_version || __DragonFly__ */
-#if defined(__NetBSD__) && __NetBSD_Version__ >= 106130000
+
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 399001400
+typedef struct lwp syscall_d_thread_t;
+typedef struct lwp d_thread_t;
+#define syscall_thread_to_thread(x) (x)
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 106130000
typedef struct lwp syscall_d_thread_t;
+typedef struct proc d_thread_t;
#define syscall_thread_to_thread(x) ((x)->l_proc)
#else
typedef struct proc syscall_d_thread_t;
+typedef struct proc d_thread_t;
#define syscall_thread_to_thread(x) (x)
#endif
-typedef struct proc d_thread_t;
+
#endif /* !__FreeBSD_version || __DragonFly__ */
#ifdef VV_ROOT
@@ -254,6 +261,11 @@
#define nnpfs_cnp_to_proc(cnp) ((cnp)->cn_proc)
#define nnpfs_proc_to_cred(p) proc_ucred(p)
#define nnpfs_proc_to_euid(p) XXX
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 399001400
+#define nnpfs_uio_to_proc(uiop) ((uiop)->uio_lwp)
+#define nnpfs_cnp_to_proc(cnp) ((cnp)->cn_lwp)
+#define nnpfs_proc_to_cred(p) ((p)->l_proc->p_ucred)
+#define nnpfs_proc_to_euid(p) ((p)->l_proc->p_ucred->cr_uid)
#else
#define nnpfs_uio_to_proc(uiop) ((uiop)->uio_procp)
#define nnpfs_cnp_to_proc(cnp) ((cnp)->cn_proc)
@@ -299,6 +311,8 @@
#else
#if defined(HAVE_FREEBSD_THREAD)
#define nnpfs_curproc() (curthread)
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 399001400
+#define nnpfs_curproc() (curlwp)
#else
#define nnpfs_curproc() (curproc)
#endif
--- arla-0.41/nnpfs/bsd/nnpfs_dev-common.c.orig 2005-11-22 07:01:11.000000000 -0500
+++ arla-0.41/nnpfs/bsd/nnpfs_dev-common.c 2005-12-30 17:46:16.000000000 -0500
@@ -572,6 +572,9 @@
/* NetBSD 1.5, Darwin 1.3, FreeBSD 4.3, 5.0, OpenBSD 2.8 */
oldsigmask = proc->p_sigmask;
nnpfs_block_sigset (&proc->p_sigmask);
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 399001400
+ oldsigmask = proc->l_proc->p_sigctx.ps_sigmask;
+ nnpfs_block_sigset (&proc->l_proc->p_sigctx.ps_sigmask);
#elif defined(HAVE_STRUCT_PROC_P_SIGCTX)
/* NetBSD 1.6 */
oldsigmask = proc->p_sigctx.ps_sigmask;
@@ -591,6 +594,8 @@
if (0)
#elif defined(HAVE_FREEBSD_THREAD)
if (proc->td_proc && !(proc->td_proc->p_flag & NNPFS_P_EXIT))
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 399001400
+ if (!(proc->l_proc->p_flag & NNPFS_P_EXIT))
#else
if (!(proc->p_flag & NNPFS_P_EXIT))
#endif
@@ -620,6 +625,8 @@
proc->td_sigmask = oldsigmask;
#elif HAVE_STRUCT_PROC_P_SIGMASK
proc->p_sigmask = oldsigmask;
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 399001400
+ proc->l_proc->p_sigctx.ps_sigmask = oldsigmask;
#elif defined(HAVE_STRUCT_PROC_P_SIGCTX)
proc->p_sigctx.ps_sigmask = oldsigmask;
#endif
--- arla-0.41/nnpfs/bsd/nnpfs_node-bsd.c.orig 2005-12-01 07:08:09.000000000 -0500
+++ arla-0.41/nnpfs/bsd/nnpfs_node-bsd.c 2005-12-30 17:50:37.000000000 -0500
@@ -778,6 +778,8 @@
cn->cn_td = proc;
#elif defined(HAVE_FREEBSD_THREAD)
cn->cn_thread = proc;
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 399001400
+ cn->cn_lwp = proc;
#else
cn->cn_proc = proc;
#endif
--- arla-0.41/nnpfs/bsd/nnpfs_vfsops-bsd.c.orig 2006-01-21 17:57:39.000000000 -0500
+++ arla-0.41/nnpfs/bsd/nnpfs_vfsops-bsd.c 2006-01-02 11:48:15.000000000 -0500
@@ -486,11 +489,7 @@
{
int error;
struct vnode *vp;
-#ifdef HAVE_FREEBSD_THREAD
- struct ucred *cred = proc->td_proc->p_ucred;
-#else
- struct ucred *cred = proc->p_ucred;
-#endif
+ struct ucred *cred = nnpfs_proc_to_cred(proc);
int flags = FFLAGS(user_flags);
int index;
struct file *fp;
@@ -558,6 +557,8 @@
#if defined(__DragonFly__)
error = falloc(proc->td_proc, &fp, &index);
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 399001400
+ error = falloc(proc->l_proc, &fp, &index);
#else
error = falloc(proc, &fp, &index);
#endif
--- arla-0.41/nnpfs/bsd/nnpfs_vfsops-netbsd.c.orig 2006-01-21 17:57:39.000000000 -0500
+++ arla-0.41/nnpfs/bsd/nnpfs_vfsops-netbsd.c 2006-01-02 12:04:01.000000000 -0500
@@ -151,7 +151,7 @@
const char *user_path,
void *user_data,
struct nameidata *ndp,
- struct proc *p)
+ d_thread_t *p)
{
int error;
--- arla-0.41/nnpfs/bsd/nnpfs_vnodeops-bsd.c.orig 2005-11-07 11:01:30.000000000 -0500
+++ arla-0.41/nnpfs/bsd/nnpfs_vnodeops-bsd.c 2006-01-02 13:01:06.000000000 -0500
@@ -52,6 +52,8 @@
#ifdef HAVE_FREEBSD_THREAD
#define NNPFS_AP_PROC(ap) ((ap)->a_td)
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 399001400
+#define NNPFS_AP_PROC(ap) ((ap)->a_l)
#else
#define NNPFS_AP_PROC(ap) ((ap)->a_p)
#endif
@@ -94,7 +96,8 @@
}; */
{
#ifdef HAVE_STRUCT_VOP_FSYNC_ARGS_A_FLAGS
- return nnpfs_fsync_common(ap->a_vp, ap->a_cred, NULL, ap->a_flags, ap->a_p);
+ return nnpfs_fsync_common(ap->a_vp, ap->a_cred, NULL, ap->a_flags,
+ NNPFS_AP_PROC(ap));
#else
#ifdef __DragonFly__
return nnpfs_fsync_common(ap->a_vp, ap->a_td->td_proc->p_ucred, NULL,
@@ -601,13 +604,7 @@
struct componentname *cnp = ap->a_cnp;
struct vnode *vp = ap->a_vp;
struct vnode *dvp;
-#ifdef __DragonFly__
- d_thread_t *p = cnp->cn_td;
-#elif defined(HAVE_FREEBSD_THREAD)
- d_thread_t *p = cnp->cn_thread;
-#else
- d_thread_t *p = cnp->cn_proc;
-#endif
+ d_thread_t *p = nnpfs_cnp_to_proc(cnp);
int error;
#if defined (__OpenBSD__) || defined(__NetBSD__)
--- arla-0.41/nnpfs/bsd/nnpfs_vnodeops-netbsd.c.orig 2006-01-21 17:57:44.000000000 -0500
+++ arla-0.41/nnpfs/bsd/nnpfs_vnodeops-netbsd.c 2006-01-02 18:56:10.000000000 -0500
@@ -127,7 +127,11 @@
struct nnpfs_node *xn = VNODE_TO_XNODE(vp);
struct iovec iov;
struct uio uio;
+#if __NetBSD_Version__ >= 399001400
+ struct lwp *p = nnpfs_curproc();
+#else
struct proc *p = nnpfs_curproc();
+#endif
struct ucred *cred = nnpfs_proc_to_cred(p);
int error, s, rw, nnpfsflags;
nnpfs_cred *ncred;
@@ -167,7 +171,11 @@
uio.uio_segflg = UIO_SYSSPACE;
uio.uio_rw = rw ? UIO_WRITE : UIO_READ;
uio.uio_resid = bp->b_resid;
- uio.uio_procp = p;
+#if __NetBSD_Version__ >= 399001400
+ uio.uio_lwp = p;
+#else
+ uio.uio_procp = p;
+#endif
error = VOP_OPEN(DATA_FROM_VNODE(vp), rw ? FWRITE : FREAD, cred, p);
More information about the Arla-drinkers
mailing list