add portno to port struct
authorFilippos Giannakos <philipgian@grnet.gr>
Thu, 30 Aug 2012 09:25:44 +0000 (12:25 +0300)
committerFilippos Giannakos <philipgian@grnet.gr>
Thu, 30 Aug 2012 09:25:44 +0000 (12:25 +0300)
xseg/xseg/xseg.c
xseg/xseg/xseg.h

index 501f490..d557090 100644 (file)
@@ -1172,6 +1172,7 @@ struct xseg_port *xseg_bind_port(struct xseg *xseg, uint32_t req)
                        break;
                port->peer_type = (uint64_t)driver;
                port->owner = id;
+               port->portno = portno;
                xseg->ports[portno] = XPTR_MAKE(port, xseg->segment);
                goto out;
        }
index e9ad38a..a179e9a 100644 (file)
@@ -113,6 +113,7 @@ struct xseg_port {
        uint64_t owner;
        volatile uint64_t waitcue;
        uint64_t peer_type;
+       uint32_t portno;
 };
 
 struct xseg_request;
@@ -328,7 +329,7 @@ struct xseg_request *  xseg_accept          ( struct xseg         * xseg,
 
 static inline uint32_t xseg_portno(struct xseg *xseg, struct xseg_port *port)
 {
-       return port - xseg->ports;
+       return port->portno;
 }
 
 #endif