[net/9p] Add preferences to transport layer.
authorVenkateswararao Jujjuri (JV) <jvrao@linux.vnet.ibm.com>
Sun, 6 Feb 2011 20:08:01 +0000 (12:08 -0800)
committerEric Van Hensbergen <ericvh@gmail.com>
Tue, 15 Mar 2011 14:57:35 +0000 (09:57 -0500)
This patch adds preferences field to the p9_trans_module.
Through this, now transport layer can express its preference about the
payload. i.e if payload neds to be part of the PDU or it prefers it
to be sent sepearetly so that the transport layer can handle it in
a better way.

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
include/net/9p/transport.h
net/9p/trans_virtio.c

index 6d5886efb102ecb0b0e74e4b66f3da713b98751c..82868f18c57360bd7ab5710773df3f927914db3e 100644 (file)
 #ifndef NET_9P_TRANSPORT_H
 #define NET_9P_TRANSPORT_H
 
+#define P9_TRANS_PREF_PAYLOAD_MASK 0x1
+
+/* Default. Add Payload to PDU before sending it down to transport layer */
+#define P9_TRANS_PREF_PAYLOAD_DEF  0x0
+/* Send pay load seperately to transport layer along with PDU.*/
+#define P9_TRANS_PREF_PAYLOAD_SEP  0x1
+
 /**
  * struct p9_trans_module - transport module interface
  * @list: used to maintain a list of currently available transports
  * @name: the human-readable name of the transport
  * @maxsize: transport provided maximum packet size
+ * @pref: Preferences of this transport
  * @def: set if this transport should be considered the default
  * @create: member function to create a new connection on this transport
  * @request: member function to issue a request to the transport
@@ -47,6 +55,7 @@ struct p9_trans_module {
        struct list_head list;
        char *name;             /* name of transport */
        int maxsize;            /* max message size of transport */
+       int pref;               /* Preferences of this transport */
        int def;                /* this transport should be default */
        struct module *owner;
        int (*create)(struct p9_client *, const char *, char *);
index 4b236de132da1172640f61b3e041d330324d103a..9b550ed9c7110bb8b339d91c7e2f1eb4cd5878e8 100644 (file)
@@ -566,6 +566,7 @@ static struct p9_trans_module p9_virtio_trans = {
        .request = p9_virtio_request,
        .cancel = p9_virtio_cancel,
        .maxsize = PAGE_SIZE*16,
+       .pref = P9_TRANS_PREF_PAYLOAD_SEP,
        .def = 0,
        .owner = THIS_MODULE,
 };
This page took 0.02556 seconds and 5 git commands to generate.