Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Try not to use f_data, use f_{vnode, socket, pipe, mqueue, k...



details:   https://anonhg.NetBSD.org/src/rev/558b96d59071
branches:  trunk
changeset: 802201:558b96d59071
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Sep 05 09:27:24 2014 +0000

description:
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.

diffstat:

 sys/ddb/db_xxx.c           |  22 ++++++++++------------
 sys/dev/iscsi/iscsi_rcv.c  |   4 ++--
 sys/dev/iscsi/iscsi_send.c |  10 +++++-----
 3 files changed, 17 insertions(+), 19 deletions(-)

diffs (102 lines):

diff -r 5d2dcf58a453 -r 558b96d59071 sys/ddb/db_xxx.c
--- a/sys/ddb/db_xxx.c  Fri Sep 05 09:26:44 2014 +0000
+++ b/sys/ddb/db_xxx.c  Fri Sep 05 09:27:24 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_xxx.c,v 1.69 2013/01/06 03:34:52 christos Exp $     */
+/*     $NetBSD: db_xxx.c,v 1.70 2014/09/05 09:27:24 matt Exp $ */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_xxx.c,v 1.69 2013/01/06 03:34:52 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_xxx.c,v 1.70 2014/09/05 09:27:24 matt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_kgdb.h"
@@ -157,7 +157,7 @@
        filedesc_t *fdp;
        fdfile_t *ff;
        file_t *fp;
-       struct vnode *vn;
+       struct vnode *vp;
        bool full = false;
        fdtab_t *dt;
 
@@ -175,18 +175,16 @@
                fp = ff->ff_file;
 
                /* Only look at vnodes... */
-               if ((fp != NULL) && (fp->f_type == DTYPE_VNODE)) {
-                       if (fp->f_data != NULL) {
-                               vn = (struct vnode *) fp->f_data;
-                               vfs_vnode_print(vn, full, db_printf);
+               if (fp != NULL && fp->f_type == DTYPE_VNODE
+                   && fp->f_vnode != NULL) {
+                       vp = fp->f_vnode;
+                       vfs_vnode_print(vp, full, db_printf);
 
 #ifdef LOCKDEBUG
-                               db_printf("\nv_uobj.vmobjlock lock details:\n");
-                               lockdebug_lock_print(vn->v_uobj.vmobjlock,
-                                            db_printf);
-                               db_printf("\n");
+                       db_printf("\nv_uobj.vmobjlock lock details:\n");
+                       lockdebug_lock_print(vp->v_uobj.vmobjlock, db_printf);
+                       db_printf("\n");
 #endif
-                       }
                }
        }
 #endif
diff -r 5d2dcf58a453 -r 558b96d59071 sys/dev/iscsi/iscsi_rcv.c
--- a/sys/dev/iscsi/iscsi_rcv.c Fri Sep 05 09:26:44 2014 +0000
+++ b/sys/dev/iscsi/iscsi_rcv.c Fri Sep 05 09:27:24 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsi_rcv.c,v 1.5 2013/10/20 21:11:15 christos Exp $   */
+/*     $NetBSD: iscsi_rcv.c,v 1.6 2014/09/05 09:27:34 matt Exp $       */
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -51,7 +51,7 @@
 STATIC int
 my_soo_read(connection_t *conn, struct uio *u, int flags)
 {
-       struct socket *so = (struct socket *) conn->sock->f_data;
+       struct socket *so = conn->sock->f_socket;
        int ret;
 #ifdef ISCSI_DEBUG
        size_t resid = u->uio_resid;
diff -r 5d2dcf58a453 -r 558b96d59071 sys/dev/iscsi/iscsi_send.c
--- a/sys/dev/iscsi/iscsi_send.c        Fri Sep 05 09:26:44 2014 +0000
+++ b/sys/dev/iscsi/iscsi_send.c        Fri Sep 05 09:27:24 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iscsi_send.c,v 1.8 2012/12/29 11:05:30 mlelstv Exp $   */
+/*     $NetBSD: iscsi_send.c,v 1.9 2014/09/05 09:27:34 matt Exp $      */
 
 /*-
  * Copyright (c) 2004,2005,2006,2011 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
 STATIC int
 my_soo_write(connection_t *conn, struct uio *u)
 {
-       struct socket *so = (struct socket *) conn->sock->f_data;
+       struct socket *so = conn->sock->f_socket;
        size_t resid = u->uio_resid;
        int ret;
 
@@ -369,9 +369,9 @@
                 * thread to wake up
                 */
                DEBC(conn, 1, ("Closing Socket %p\n", conn->sock));
-               solock((struct socket *) fp->f_data);
-               soshutdown((struct socket *) fp->f_data, SHUT_RDWR);
-               sounlock((struct socket *) fp->f_data);
+               solock(fp->f_socket);
+               soshutdown(fp->f_socket, SHUT_RDWR);
+               sounlock(fp->f_socket);
 
                /* wake up any non-reassignable waiting CCBs */
                TAILQ_FOREACH_SAFE(ccb, &conn->ccbs_waiting, chain, nccb) {



Home | Main Index | Thread Index | Old Index