tree: https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git for-next head: 1ff8c0df0039ab638db1a1a589b2b3f6c2722731 commit: f9f9fa23d5299b57b8e6d6e07a4a2f5c9e5c7dda [1/17] 9p/trans_virtio: don't bother with p9_tag_lookup() config: x86_64-acpi-redef (attached as .config) reproduce: git checkout f9f9fa23d5299b57b8e6d6e07a4a2f5c9e5c7dda # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): In file included from net/9p/trans_virtio.c:44:0: net/9p/trans_virtio.c: In function 'req_done': >> net/9p/trans_virtio.c:163:41: error: 'rc' undeclared (first use in this function) p9_debug(P9_DEBUG_TRANS, ": rc %p\n", rc); ^ include/net/9p/9p.h:70:36: note: in definition of macro 'p9_debug' _p9_debug(level, __func__, fmt, ##__VA_ARGS__) ^ net/9p/trans_virtio.c:163:41: note: each undeclared identifier is reported only once for each function it appears in p9_debug(P9_DEBUG_TRANS, ": rc %p\n", rc); ^ include/net/9p/9p.h:70:36: note: in definition of macro 'p9_debug' _p9_debug(level, __func__, fmt, ##__VA_ARGS__) ^ vim +/rc +163 net/9p/trans_virtio.c b530cc7940 Eric Van Hensbergen 2007-10-23 38 #include <linux/uaccess.h> b530cc7940 Eric Van Hensbergen 2007-10-23 39 #include <linux/inet.h> b530cc7940 Eric Van Hensbergen 2007-10-23 40 #include <linux/idr.h> b530cc7940 Eric Van Hensbergen 2007-10-23 41 #include <linux/file.h> b9cdc88df8 Will Deacon 2012-10-19 42 #include <linux/highmem.h> 5a0e3ad6af Tejun Heo 2010-03-24 43 #include <linux/slab.h> b530cc7940 Eric Van Hensbergen 2007-10-23 @44 #include <net/9p/9p.h> b530cc7940 Eric Van Hensbergen 2007-10-23 45 #include <linux/parser.h> 8b81ef589a Eric Van Hensbergen 2008-10-13 46 #include <net/9p/client.h> b530cc7940 Eric Van Hensbergen 2007-10-23 47 #include <net/9p/transport.h> b530cc7940 Eric Van Hensbergen 2007-10-23 48 #include <linux/scatterlist.h> 68da9ba4ee Venkateswararao Jujjuri (JV 2011-03-18 49) #include <linux/swap.h> b530cc7940 Eric Van Hensbergen 2007-10-23 50 #include <linux/virtio.h> b530cc7940 Eric Van Hensbergen 2007-10-23 51 #include <linux/virtio_9p.h> 4038866dab Venkateswararao Jujjuri (JV 2011-01-28 52) #include "trans_common.h" b530cc7940 Eric Van Hensbergen 2007-10-23 53 e2735b7720 Eric Van Hensbergen 2008-02-06 54 #define VIRTQUEUE_NUM 128 e2735b7720 Eric Van Hensbergen 2008-02-06 55 b530cc7940 Eric Van Hensbergen 2007-10-23 56 /* a single mutex to manage channel initialization and attachment */ c1549497e9 Josef 'Jeff' Sipek 2008-03-07 57 static DEFINE_MUTEX(virtio_9p_lock); 68da9ba4ee Venkateswararao Jujjuri (JV 2011-03-18 58) static DECLARE_WAIT_QUEUE_HEAD(vp_wq); 68da9ba4ee Venkateswararao Jujjuri (JV 2011-03-18 59) static atomic_t vp_pinned = ATOMIC_INIT(0); b530cc7940 Eric Van Hensbergen 2007-10-23 60 ee443996a3 Eric Van Hensbergen 2008-03-05 61 /** ee443996a3 Eric Van Hensbergen 2008-03-05 62 * struct virtio_chan - per-instance transport information ee443996a3 Eric Van Hensbergen 2008-03-05 63 * @initialized: whether the channel is initialized ee443996a3 Eric Van Hensbergen 2008-03-05 64 * @inuse: whether the channel is in use ee443996a3 Eric Van Hensbergen 2008-03-05 65 * @lock: protects multiple elements within this structure 0e15597ebf Abhishek Kulkarni 2009-07-19 66 * @client: client instance ee443996a3 Eric Van Hensbergen 2008-03-05 67 * @vdev: virtio dev associated with this channel ee443996a3 Eric Van Hensbergen 2008-03-05 68 * @vq: virtio queue associated with this channel ee443996a3 Eric Van Hensbergen 2008-03-05 69 * @sg: scatter gather list which is used to pack a request (protected?) ee443996a3 Eric Van Hensbergen 2008-03-05 70 * ee443996a3 Eric Van Hensbergen 2008-03-05 71 * We keep all per-channel information in a structure. b530cc7940 Eric Van Hensbergen 2007-10-23 72 * This structure is allocated within the devices dev->mem space. b530cc7940 Eric Van Hensbergen 2007-10-23 73 * A pointer to the structure will get put in the transport private. ee443996a3 Eric Van Hensbergen 2008-03-05 74 * b530cc7940 Eric Van Hensbergen 2007-10-23 75 */ ee443996a3 Eric Van Hensbergen 2008-03-05 76 37c1209d41 Aneesh Kumar K.V 2010-02-15 77 struct virtio_chan { ee443996a3 Eric Van Hensbergen 2008-03-05 78 bool inuse; b530cc7940 Eric Van Hensbergen 2007-10-23 79 e2735b7720 Eric Van Hensbergen 2008-02-06 80 spinlock_t lock; e2735b7720 Eric Van Hensbergen 2008-02-06 81 fea511a644 Eric Van Hensbergen 2008-10-13 82 struct p9_client *client; b530cc7940 Eric Van Hensbergen 2007-10-23 83 struct virtio_device *vdev; e2735b7720 Eric Van Hensbergen 2008-02-06 84 struct virtqueue *vq; 52f44e0d08 Venkateswararao Jujjuri (JV 2010-09-29 85) int ring_bufs_avail; 52f44e0d08 Venkateswararao Jujjuri (JV 2010-09-29 86) wait_queue_head_t *vc_wq; 68da9ba4ee Venkateswararao Jujjuri (JV 2011-03-18 87) /* This is global limit. Since we don't have a global structure, 68da9ba4ee Venkateswararao Jujjuri (JV 2011-03-18 88) * will be placing it in each channel. 68da9ba4ee Venkateswararao Jujjuri (JV 2011-03-18 89) */ 7293bfba03 Zhang Yanfei 2013-02-22 90 unsigned long p9_max_pages; e2735b7720 Eric Van Hensbergen 2008-02-06 91 /* Scatterlist: can be too big for stack. */ e2735b7720 Eric Van Hensbergen 2008-02-06 92 struct scatterlist sg[VIRTQUEUE_NUM]; 37c1209d41 Aneesh Kumar K.V 2010-02-15 93 97ee9b0257 Aneesh Kumar K.V 2010-03-06 94 int tag_len; 97ee9b0257 Aneesh Kumar K.V 2010-03-06 95 /* 97ee9b0257 Aneesh Kumar K.V 2010-03-06 96 * tag name to identify a mount Non-null terminated 97ee9b0257 Aneesh Kumar K.V 2010-03-06 97 */ 97ee9b0257 Aneesh Kumar K.V 2010-03-06 98 char *tag; 97ee9b0257 Aneesh Kumar K.V 2010-03-06 99 37c1209d41 Aneesh Kumar K.V 2010-02-15 100 struct list_head chan_list; 37c1209d41 Aneesh Kumar K.V 2010-02-15 101 }; 37c1209d41 Aneesh Kumar K.V 2010-02-15 102 37c1209d41 Aneesh Kumar K.V 2010-02-15 103 static struct list_head virtio_chan_list; b530cc7940 Eric Van Hensbergen 2007-10-23 104 b530cc7940 Eric Van Hensbergen 2007-10-23 105 /* How many bytes left in this page. */ b530cc7940 Eric Van Hensbergen 2007-10-23 106 static unsigned int rest_of_page(void *data) b530cc7940 Eric Van Hensbergen 2007-10-23 107 { b530cc7940 Eric Van Hensbergen 2007-10-23 108 return PAGE_SIZE - ((unsigned long)data % PAGE_SIZE); b530cc7940 Eric Van Hensbergen 2007-10-23 109 } b530cc7940 Eric Van Hensbergen 2007-10-23 110 ee443996a3 Eric Van Hensbergen 2008-03-05 111 /** ee443996a3 Eric Van Hensbergen 2008-03-05 112 * p9_virtio_close - reclaim resources of a channel 0e15597ebf Abhishek Kulkarni 2009-07-19 113 * @client: client instance ee443996a3 Eric Van Hensbergen 2008-03-05 114 * ee443996a3 Eric Van Hensbergen 2008-03-05 115 * This reclaims a channel by freeing its resources and ee443996a3 Eric Van Hensbergen 2008-03-05 116 * reseting its inuse flag. ee443996a3 Eric Van Hensbergen 2008-03-05 117 * ee443996a3 Eric Van Hensbergen 2008-03-05 118 */ ee443996a3 Eric Van Hensbergen 2008-03-05 119 8b81ef589a Eric Van Hensbergen 2008-10-13 120 static void p9_virtio_close(struct p9_client *client) e2735b7720 Eric Van Hensbergen 2008-02-06 121 { 8b81ef589a Eric Van Hensbergen 2008-10-13 122 struct virtio_chan *chan = client->trans; b530cc7940 Eric Van Hensbergen 2007-10-23 123 c1549497e9 Josef 'Jeff' Sipek 2008-03-07 124 mutex_lock(&virtio_9p_lock); fb786100f7 Aneesh Kumar K.V 2010-02-08 125 if (chan) e2735b7720 Eric Van Hensbergen 2008-02-06 126 chan->inuse = false; c1549497e9 Josef 'Jeff' Sipek 2008-03-07 127 mutex_unlock(&virtio_9p_lock); b530cc7940 Eric Van Hensbergen 2007-10-23 128 } b530cc7940 Eric Van Hensbergen 2007-10-23 129 ee443996a3 Eric Van Hensbergen 2008-03-05 130 /** ee443996a3 Eric Van Hensbergen 2008-03-05 131 * req_done - callback which signals activity from the server ee443996a3 Eric Van Hensbergen 2008-03-05 132 * @vq: virtio queue activity was received on ee443996a3 Eric Van Hensbergen 2008-03-05 133 * ee443996a3 Eric Van Hensbergen 2008-03-05 134 * This notifies us that the server has triggered some activity ee443996a3 Eric Van Hensbergen 2008-03-05 135 * on the virtio channel - most likely a response to request we ee443996a3 Eric Van Hensbergen 2008-03-05 136 * sent. Figure out which requests now have responses and wake up ee443996a3 Eric Van Hensbergen 2008-03-05 137 * those threads. ee443996a3 Eric Van Hensbergen 2008-03-05 138 * ee443996a3 Eric Van Hensbergen 2008-03-05 139 * Bugs: could do with some additional sanity checking, but appears to work. ee443996a3 Eric Van Hensbergen 2008-03-05 140 * ee443996a3 Eric Van Hensbergen 2008-03-05 141 */ ee443996a3 Eric Van Hensbergen 2008-03-05 142 e2735b7720 Eric Van Hensbergen 2008-02-06 143 static void req_done(struct virtqueue *vq) b530cc7940 Eric Van Hensbergen 2007-10-23 144 { e2735b7720 Eric Van Hensbergen 2008-02-06 145 struct virtio_chan *chan = vq->vdev->priv; e2735b7720 Eric Van Hensbergen 2008-02-06 146 unsigned int len; e2735b7720 Eric Van Hensbergen 2008-02-06 147 struct p9_req_t *req; 419b39561e Venkateswararao Jujjuri (JV 2010-09-29 148) unsigned long flags; e2735b7720 Eric Van Hensbergen 2008-02-06 149 5d3851530d Joe Perches 2011-11-28 150 p9_debug(P9_DEBUG_TRANS, ": request done\n"); 91b8534fa8 Eric Van Hensbergen 2008-10-13 151 a01a984035 Venkateswararao Jujjuri (JV 2011-03-14 152) while (1) { 419b39561e Venkateswararao Jujjuri (JV 2010-09-29 153) spin_lock_irqsave(&chan->lock, flags); f9f9fa23d5 Al Viro 2015-07-12 154 req = virtqueue_get_buf(chan->vq, &len); f9f9fa23d5 Al Viro 2015-07-12 155 if (req == NULL) { a01a984035 Venkateswararao Jujjuri (JV 2011-03-14 156) spin_unlock_irqrestore(&chan->lock, flags); a01a984035 Venkateswararao Jujjuri (JV 2011-03-14 157) break; a01a984035 Venkateswararao Jujjuri (JV 2011-03-14 158) } 52f44e0d08 Venkateswararao Jujjuri (JV 2010-09-29 159) chan->ring_bufs_avail = 1; 52f44e0d08 Venkateswararao Jujjuri (JV 2010-09-29 160) spin_unlock_irqrestore(&chan->lock, flags); 53bda3e5b4 Venkateswararao Jujjuri (JV 2011-03-08 161) /* Wakeup if anyone waiting for VirtIO ring space. */ 53bda3e5b4 Venkateswararao Jujjuri (JV 2011-03-08 162) wake_up(chan->vc_wq); 5d3851530d Joe Perches 2011-11-28 @163 p9_debug(P9_DEBUG_TRANS, ": rc %p\n", rc); 5d3851530d Joe Perches 2011-11-28 164 p9_debug(P9_DEBUG_TRANS, ": lookup tag %d\n", rc->tag); 2b6e72ed74 Dominique Martinet 2014-01-17 165 p9_client_cb(chan->client, req, REQ_STATUS_RCVD); e2735b7720 Eric Van Hensbergen 2008-02-06 166 } :::::: The code at line 163 was first introduced by commit :::::: 5d3851530d6d68564e4e0ce04d0547d4d106fc72 9p: Reduce object size with CONFIG_NET_9P_DEBUG :::::: TO: Joe Perches <joe@xxxxxxxxxxx> :::::: CC: Eric Van Hensbergen <ericvh@xxxxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: Binary data