Skip to content

Commit

Permalink
9pfs: PDU processing functions should start pdu_ prefix
Browse files Browse the repository at this point in the history
This matches naming convention of pdu_marshal and pdu_unmarshal.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
  • Loading branch information
Wei Liu authored and kvaneesh committed Jan 8, 2016
1 parent ad38ce9 commit dc295f8
Showing 1 changed file with 44 additions and 44 deletions.
88 changes: 44 additions & 44 deletions hw/9pfs/virtio-9p.c
Expand Up @@ -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;

Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1313,7 +1313,7 @@ static void v9fs_walk(void *opaque)
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]);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1760,7 +1760,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)
Expand Down Expand Up @@ -1883,7 +1883,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,
Expand Down Expand Up @@ -1950,7 +1950,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;
Expand Down Expand Up @@ -2013,7 +2013,7 @@ static void v9fs_write(void *opaque)
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)
Expand Down Expand Up @@ -2180,7 +2180,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);
Expand Down Expand Up @@ -2227,7 +2227,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);
}
Expand All @@ -2243,7 +2243,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);
Expand All @@ -2260,9 +2260,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)
Expand Down Expand Up @@ -2300,7 +2300,7 @@ static void v9fs_link(void *opaque)
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 */
Expand Down Expand Up @@ -2345,7 +2345,7 @@ static void v9fs_remove(void *opaque)
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)
Expand Down Expand Up @@ -2389,7 +2389,7 @@ static void v9fs_unlinkat(void *opaque)
put_fid(pdu, dfidp);
v9fs_path_free(&path);
out_nofid:
complete_pdu(pdu, err);
pdu_complete(pdu, err);
v9fs_string_free(&name);
}

Expand Down Expand Up @@ -2489,7 +2489,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);
}

Expand Down Expand Up @@ -2590,7 +2590,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);
}
Expand Down Expand Up @@ -2686,7 +2686,7 @@ static void v9fs_wstat(void *opaque)
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)
Expand Down Expand Up @@ -2765,7 +2765,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)
Expand Down Expand Up @@ -2812,7 +2812,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);
}

Expand Down Expand Up @@ -2869,7 +2869,7 @@ static void v9fs_lock(void *opaque)
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);
}

Expand Down Expand Up @@ -2918,7 +2918,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);
}

Expand Down Expand Up @@ -2962,7 +2962,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);
}

Expand Down Expand Up @@ -3068,7 +3068,7 @@ static void v9fs_xattrwalk(void *opaque)
put_fid(pdu, xattr_fidp);
}
out_nofid:
complete_pdu(pdu, err);
pdu_complete(pdu, err);
v9fs_string_free(&name);
}

Expand Down Expand Up @@ -3108,7 +3108,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);
}

Expand Down Expand Up @@ -3148,7 +3148,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[] = {
Expand Down Expand Up @@ -3191,13 +3191,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)
Expand Down Expand Up @@ -3227,7 +3227,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;
Expand All @@ -3253,7 +3253,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;
Expand All @@ -3275,9 +3275,9 @@ 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);
}

static void __attribute__((__constructor__)) virtio_9p_set_fd_limit(void)
Expand Down

0 comments on commit dc295f8

Please sign in to comment.