All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: qemu-devel@nongnu.org
Cc: Greg Kurz <gkurz@linux.vnet.ibm.com>,
	Wei Liu <wei.liu2@citrix.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	"Michael S. Tsirkin" <mst@redhat.com>
Subject: [Qemu-devel] [PATCH 15/22] 9pfs: PDU processing functions should start pdu_ prefix
Date: Tue, 5 Jan 2016 19:05:54 +0000	[thread overview]
Message-ID: <1452020761-24457-16-git-send-email-wei.liu2@citrix.com> (raw)
In-Reply-To: <1452020761-24457-1-git-send-email-wei.liu2@citrix.com>

This matches naming convention of pdu_marshal and pdu_unmarshal.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
---
This patch can be squashed if necessary.
---
 hw/9pfs/virtio-9p.c | 88 ++++++++++++++++++++++++++---------------------------
 1 file changed, 44 insertions(+), 44 deletions(-)

diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c
index f605895..07e5eff 100644
--- a/hw/9pfs/virtio-9p.c
+++ b/hw/9pfs/virtio-9p.c
@@ -563,7 +563,7 @@ static int fid_to_qid(V9fsPDU *pdu, V9fsFidState *fidp, V9fsQID *qidp)
     return 0;
 }
 
-static V9fsPDU *alloc_pdu(V9fsState *s)
+static V9fsPDU *pdu_alloc(V9fsState *s)
 {
     V9fsPDU *pdu = NULL;
 
@@ -575,7 +575,7 @@ static V9fsPDU *alloc_pdu(V9fsState *s)
     return pdu;
 }
 
-static void free_pdu(V9fsPDU *pdu)
+static void pdu_free(V9fsPDU *pdu)
 {
     if (pdu) {
         V9fsState *s = pdu->s;
@@ -595,7 +595,7 @@ static void free_pdu(V9fsPDU *pdu)
  * because we always expect to have enough space to encode
  * error details
  */
-static void complete_pdu(V9fsPDU *pdu, ssize_t len)
+static void pdu_complete(V9fsPDU *pdu, ssize_t len)
 {
     int8_t id = pdu->id + 1; /* Response */
     V9fsState *s = pdu->s;
@@ -638,7 +638,7 @@ static void complete_pdu(V9fsPDU *pdu, ssize_t len)
     /* Now wakeup anybody waiting in flush for this request */
     qemu_co_queue_next(&pdu->complete);
 
-    free_pdu(pdu);
+    pdu_free(pdu);
 }
 
 static mode_t v9mode_to_mode(uint32_t mode, V9fsString *extension)
@@ -933,7 +933,7 @@ static void v9fs_version(void *opaque)
     offset += err;
     trace_v9fs_version_return(pdu->tag, pdu->id, s->msize, version.data);
 out:
-    complete_pdu(pdu, offset);
+    pdu_complete(pdu, offset);
     v9fs_string_free(&version);
 }
 
@@ -997,7 +997,7 @@ static void v9fs_attach(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     v9fs_string_free(&uname);
     v9fs_string_free(&aname);
 }
@@ -1043,7 +1043,7 @@ static void v9fs_stat(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
 }
 
 static void v9fs_getattr(void *opaque)
@@ -1106,7 +1106,7 @@ static void v9fs_getattr(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, retval);
+    pdu_complete(pdu, retval);
 }
 
 /* Attribute flags */
@@ -1203,7 +1203,7 @@ static void v9fs_setattr(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
 }
 
 static int v9fs_walk_marshal(V9fsPDU *pdu, uint16_t nwnames, V9fsQID *qids)
@@ -1245,7 +1245,7 @@ static void v9fs_walk(void *opaque)
 
     err = pdu_unmarshal(pdu, offset, "ddw", &fid, &newfid, &nwnames);
     if (err < 0) {
-        complete_pdu(pdu, err);
+        pdu_complete(pdu, err);
         return ;
     }
     offset += err;
@@ -1313,7 +1313,7 @@ out:
     v9fs_path_free(&dpath);
     v9fs_path_free(&path);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     if (nwnames && nwnames <= P9_MAXWELEM) {
         for (name_idx = 0; name_idx < nwnames; name_idx++) {
             v9fs_string_free(&wnames[name_idx]);
@@ -1430,7 +1430,7 @@ static void v9fs_open(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
 }
 
 static void v9fs_lcreate(void *opaque)
@@ -1487,7 +1487,7 @@ static void v9fs_lcreate(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     v9fs_string_free(&name);
 }
 
@@ -1517,7 +1517,7 @@ static void v9fs_fsync(void *opaque)
     }
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
 }
 
 static void v9fs_clunk(void *opaque)
@@ -1550,7 +1550,7 @@ static void v9fs_clunk(void *opaque)
         err = offset;
     }
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
 }
 
 static int v9fs_xattr_read(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
@@ -1765,7 +1765,7 @@ static void v9fs_read(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
 }
 
 static size_t v9fs_readdir_data_size(V9fsString *name)
@@ -1888,7 +1888,7 @@ static void v9fs_readdir(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, retval);
+    pdu_complete(pdu, retval);
 }
 
 static int v9fs_xattr_write(V9fsState *s, V9fsPDU *pdu, V9fsFidState *fidp,
@@ -1955,7 +1955,7 @@ static void v9fs_write(void *opaque)
 
     err = pdu_unmarshal(pdu, offset, "dqd", &fid, &off, &count);
     if (err < 0) {
-        complete_pdu(pdu, err);
+        pdu_complete(pdu, err);
         return;
     }
     offset += err;
@@ -2018,7 +2018,7 @@ out:
     put_fid(pdu, fidp);
 out_nofid:
     qemu_iovec_destroy(&qiov_full);
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
 }
 
 static void v9fs_create(void *opaque)
@@ -2185,7 +2185,7 @@ static void v9fs_create(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-   complete_pdu(pdu, err);
+   pdu_complete(pdu, err);
    v9fs_string_free(&name);
    v9fs_string_free(&extension);
    v9fs_path_free(&path);
@@ -2232,7 +2232,7 @@ static void v9fs_symlink(void *opaque)
 out:
     put_fid(pdu, dfidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     v9fs_string_free(&name);
     v9fs_string_free(&symname);
 }
@@ -2248,7 +2248,7 @@ static void v9fs_flush(void *opaque)
 
     err = pdu_unmarshal(pdu, offset, "w", &tag);
     if (err < 0) {
-        complete_pdu(pdu, err);
+        pdu_complete(pdu, err);
         return;
     }
     trace_v9fs_flush(pdu->tag, pdu->id, tag);
@@ -2265,9 +2265,9 @@ static void v9fs_flush(void *opaque)
          */
         qemu_co_queue_wait(&cancel_pdu->complete);
         cancel_pdu->cancelled = 0;
-        free_pdu(cancel_pdu);
+        pdu_free(cancel_pdu);
     }
-    complete_pdu(pdu, 7);
+    pdu_complete(pdu, 7);
 }
 
 static void v9fs_link(void *opaque)
@@ -2305,7 +2305,7 @@ out:
     put_fid(pdu, dfidp);
 out_nofid:
     v9fs_string_free(&name);
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
 }
 
 /* Only works with path name based fid */
@@ -2350,7 +2350,7 @@ out_err:
     clunk_fid(pdu->s, fidp->fid);
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
 }
 
 static void v9fs_unlinkat(void *opaque)
@@ -2394,7 +2394,7 @@ out_err:
     put_fid(pdu, dfidp);
     v9fs_path_free(&path);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     v9fs_string_free(&name);
 }
 
@@ -2494,7 +2494,7 @@ static void v9fs_rename(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     v9fs_string_free(&name);
 }
 
@@ -2595,7 +2595,7 @@ static void v9fs_renameat(void *opaque)
     }
 
 out_err:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     v9fs_string_free(&old_name);
     v9fs_string_free(&new_name);
 }
@@ -2691,7 +2691,7 @@ out:
     put_fid(pdu, fidp);
 out_nofid:
     v9fs_stat_free(&v9stat);
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
 }
 
 static int v9fs_fill_statfs(V9fsState *s, V9fsPDU *pdu, struct statfs *stbuf)
@@ -2770,7 +2770,7 @@ static void v9fs_statfs(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, retval);
+    pdu_complete(pdu, retval);
 }
 
 static void v9fs_mknod(void *opaque)
@@ -2817,7 +2817,7 @@ static void v9fs_mknod(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     v9fs_string_free(&name);
 }
 
@@ -2874,7 +2874,7 @@ out_nofid:
         err += offset;
     }
     trace_v9fs_lock_return(pdu->tag, pdu->id, status);
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     v9fs_string_free(&flock.client_id);
 }
 
@@ -2923,7 +2923,7 @@ static void v9fs_getlock(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     v9fs_string_free(&glock.client_id);
 }
 
@@ -2967,7 +2967,7 @@ static void v9fs_mkdir(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     v9fs_string_free(&name);
 }
 
@@ -3073,7 +3073,7 @@ out:
         put_fid(pdu, xattr_fidp);
     }
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     v9fs_string_free(&name);
 }
 
@@ -3113,7 +3113,7 @@ static void v9fs_xattrcreate(void *opaque)
     err = offset;
     put_fid(pdu, file_fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
     v9fs_string_free(&name);
 }
 
@@ -3153,7 +3153,7 @@ static void v9fs_readlink(void *opaque)
 out:
     put_fid(pdu, fidp);
 out_nofid:
-    complete_pdu(pdu, err);
+    pdu_complete(pdu, err);
 }
 
 static CoroutineEntry *pdu_co_handlers[] = {
@@ -3196,13 +3196,13 @@ static CoroutineEntry *pdu_co_handlers[] = {
 static void v9fs_op_not_supp(void *opaque)
 {
     V9fsPDU *pdu = opaque;
-    complete_pdu(pdu, -EOPNOTSUPP);
+    pdu_complete(pdu, -EOPNOTSUPP);
 }
 
 static void v9fs_fs_ro(void *opaque)
 {
     V9fsPDU *pdu = opaque;
-    complete_pdu(pdu, -EROFS);
+    pdu_complete(pdu, -EROFS);
 }
 
 static inline bool is_read_only_op(V9fsPDU *pdu)
@@ -3232,7 +3232,7 @@ static inline bool is_read_only_op(V9fsPDU *pdu)
     }
 }
 
-static void submit_pdu(V9fsPDU *pdu)
+static void pdu_submit(V9fsPDU *pdu)
 {
     Coroutine *co;
     CoroutineEntry *handler;
@@ -3258,7 +3258,7 @@ void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq)
     V9fsPDU *pdu;
     ssize_t len;
 
-    while ((pdu = alloc_pdu(s)) &&
+    while ((pdu = pdu_alloc(s)) &&
             (len = virtqueue_pop(vq, &pdu->elem)) != 0) {
         struct {
             uint32_t size_le;
@@ -3280,7 +3280,7 @@ void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq)
         pdu->tag = le16_to_cpu(out.tag_le);
 
         qemu_co_queue_init(&pdu->complete);
-        submit_pdu(pdu);
+        pdu_submit(pdu);
     }
-    free_pdu(pdu);
+    pdu_free(pdu);
 }
-- 
2.1.4

  parent reply	other threads:[~2016-01-05 19:32 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05 19:05 [Qemu-devel] [PATCH 00/22] 9pfs: disentangling virtio and generic code Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 01/22] 9pfs: rename virtio-9p-coth.{c, h} to coth.{c, h} Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 02/22] 9pfs: rename virtio-9p-handle.c to 9p-handle.c Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 03/22] " Wei Liu
2016-01-06 11:22   ` Stefano Stabellini
2016-01-06 11:37     ` Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 04/22] 9pfs: rename virtio-9p-posix-acl.c to 9p-posix-acl.c Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 05/22] 9pfs: rename virtio-9p-proxy.{c, h} to 9p-proxy.{c, h} Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 06/22] 9pfs: rename virtio-9p-synth.{c, h} to 9p-synth.{c, h} Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 07/22] 9pfs: rename virtio-9p-xattr{, -user}.{c, h} to 9p-xattr{, -user}.{c, h} Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 08/22] 9pfs: merge hw/virtio/virtio-9p.h into hw/9pfs/virtio-9p.h Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 09/22] 9pfs: remove dead code Wei Liu
2016-01-07 16:41   ` Aneesh Kumar K.V
2016-01-07 16:57     ` Paolo Bonzini
2016-01-07 17:00     ` Greg Kurz
2016-01-05 19:05 ` [Qemu-devel] [PATCH 10/22] fsdev: break out 9p-marshal.{c, h} from virtio-9p-marshal.{c, h} Wei Liu
2016-01-07 16:42   ` Aneesh Kumar K.V
2016-01-07 17:07     ` Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 11/22] fsdev: 9p-marshal: introduce V9fsBlob Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 12/22] 9pfs: use V9fsBlob to transmit xattr Wei Liu
2016-01-07 16:49   ` Aneesh Kumar K.V
2016-01-07 17:03     ` Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 13/22] fsdev: rename virtio-9p-marshal.{c, h} to 9p-iov-marshal.{c, h} Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 14/22] 9pfs: PDU processing functions don't need to take V9fsState as argument Wei Liu
2016-01-05 19:05 ` Wei Liu [this message]
2016-01-05 19:05 ` [Qemu-devel] [PATCH 16/22] 9pfs: make pdu_{, un}marshal proper functions Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 17/22] 9pfs: factor out virtio_pdu_{, un}marshal Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 18/22] 9pfs: factor out pdu_push_and_notify Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 19/22] 9pfs: break out virtio_init_iov_from_pdu Wei Liu
2016-01-05 19:05 ` [Qemu-devel] [PATCH 20/22] 9pfs: break out generic code from virtio-9p.{c, h} Wei Liu
2016-01-07 16:57   ` Aneesh Kumar K.V
2016-01-07 17:16     ` Wei Liu
2016-01-07 17:28       ` Aneesh Kumar K.V
2016-01-07 17:38         ` Greg Kurz
2016-01-07 17:47         ` Wei Liu
2016-01-07 19:07           ` Wei Liu
2016-01-05 19:06 ` [Qemu-devel] [PATCH 21/22] 9pfs: factor out v9fs_device_{, un}realize_common Wei Liu
2016-01-05 19:06 ` [Qemu-devel] [PATCH 22/22] 9pfs: disentangle V9fsState Wei Liu
2016-01-07 11:59 ` [Qemu-devel] [PATCH 00/22] 9pfs: disentangling virtio and generic code Stefano Stabellini
2016-01-07 12:32   ` Greg Kurz
2016-01-07 13:35     ` Greg Kurz
2016-01-07 15:17       ` Stefano Stabellini
2016-01-07 17:06     ` Aneesh Kumar K.V
2016-01-07 17:15       ` Greg Kurz
2016-01-07 17:04 ` Aneesh Kumar K.V
2016-01-07 17:54   ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452020761-24457-16-git-send-email-wei.liu2@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=gkurz@linux.vnet.ibm.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.