[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] blktap: cleanup



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1215787000 -3600
# Node ID 86e3027df9d9caff44d9ed3c0ed22415a0ee0714
# Parent  3e563929f17a03fb51b9f66568ab0adc0453d6c6
blktap: cleanup

Make functions w/o a prototype static and remove redundant
declaration of xs_fire_next_watch().

Signed-off-by: Christoph Egger <Christoph.Egger@xxxxxxx>
---
 tools/blktap/drivers/blktapctrl.c  |    8 +++++---
 tools/blktap/drivers/block-aio.c   |   16 ++++++++--------
 tools/blktap/drivers/block-qcow.c  |   22 +++++++++++-----------
 tools/blktap/drivers/block-ram.c   |   16 ++++++++--------
 tools/blktap/drivers/block-sync.c  |   16 ++++++++--------
 tools/blktap/drivers/img2qcow.c    |    6 +++---
 tools/blktap/drivers/qcow-create.c |    2 +-
 tools/blktap/drivers/qcow2raw.c    |    6 +++---
 tools/blktap/drivers/tapdisk.c     |   10 +++++-----
 tools/blktap/lib/blktaplib.h       |    1 -
 tools/blktap/lib/xenbus.c          |    6 +++---
 11 files changed, 55 insertions(+), 54 deletions(-)

diff -r 3e563929f17a -r 86e3027df9d9 tools/blktap/drivers/blktapctrl.c
--- a/tools/blktap/drivers/blktapctrl.c Fri Jul 11 15:35:50 2008 +0100
+++ b/tools/blktap/drivers/blktapctrl.c Fri Jul 11 15:36:40 2008 +0100
@@ -55,6 +55,8 @@
 #include "blktaplib.h"
 #include "blktapctrl.h"
 #include "tapdisk.h"
+#include "list.h"
+#include "xs_api.h" /* for xs_fire_next_watch() */
 
 #define PIDFILE "/var/run/blktapctrl.pid"
 
@@ -638,7 +640,7 @@ fail:
        return ret;
 }
 
-int blktapctrl_new_blkif(blkif_t *blkif)
+static int blktapctrl_new_blkif(blkif_t *blkif)
 {
        blkif_info_t *blk;
        int major, minor, fd_read, fd_write, type, new;
@@ -710,7 +712,7 @@ fail:
        return -EINVAL;
 }
 
-int map_new_blktapctrl(blkif_t *blkif)
+static int map_new_blktapctrl(blkif_t *blkif)
 {
        DPRINTF("Received a poll for a new devmap\n");
        if (write_msg(blkif->fds[WRITE], CTLMSG_NEWDEV, blkif, NULL) <= 0) {
@@ -727,7 +729,7 @@ int map_new_blktapctrl(blkif_t *blkif)
        return blkif->minor - 1;
 }
 
-int unmap_blktapctrl(blkif_t *blkif)
+static int unmap_blktapctrl(blkif_t *blkif)
 {
        DPRINTF("Unmapping vbd\n");
 
diff -r 3e563929f17a -r 86e3027df9d9 tools/blktap/drivers/block-aio.c
--- a/tools/blktap/drivers/block-aio.c  Fri Jul 11 15:35:50 2008 +0100
+++ b/tools/blktap/drivers/block-aio.c  Fri Jul 11 15:36:40 2008 +0100
@@ -118,7 +118,7 @@ static inline void init_fds(struct disk_
 }
 
 /* Open the disk file and initialize aio state. */
-int tdaio_open (struct disk_driver *dd, const char *name, td_flag_t flags)
+static int tdaio_open (struct disk_driver *dd, const char *name, td_flag_t 
flags)
 {
        int i, fd, ret = 0, o_flags;
        struct td_state    *s   = dd->td_state;
@@ -161,7 +161,7 @@ done:
        return ret;     
 }
 
-int tdaio_queue_read(struct disk_driver *dd, uint64_t sector,
+static int tdaio_queue_read(struct disk_driver *dd, uint64_t sector,
                     int nb_sectors, char *buf, td_callback_t cb,
                     int id, void *private)
 {
@@ -174,7 +174,7 @@ int tdaio_queue_read(struct disk_driver 
                cb, id, sector, private);
 }
                        
-int tdaio_queue_write(struct disk_driver *dd, uint64_t sector,
+static int tdaio_queue_write(struct disk_driver *dd, uint64_t sector,
                      int nb_sectors, char *buf, td_callback_t cb,
                      int id, void *private)
 {
@@ -187,14 +187,14 @@ int tdaio_queue_write(struct disk_driver
                cb, id, sector, private);
 }
 
-int tdaio_submit(struct disk_driver *dd)
+static int tdaio_submit(struct disk_driver *dd)
 {
        struct tdaio_state *prv = (struct tdaio_state *)dd->private;
 
        return tap_aio_submit(&prv->aio);
 }
                        
-int tdaio_close(struct disk_driver *dd)
+static int tdaio_close(struct disk_driver *dd)
 {
        struct tdaio_state *prv = (struct tdaio_state *)dd->private;
        
@@ -204,7 +204,7 @@ int tdaio_close(struct disk_driver *dd)
        return 0;
 }
 
-int tdaio_do_callbacks(struct disk_driver *dd, int sid)
+static int tdaio_do_callbacks(struct disk_driver *dd, int sid)
 {
        int i, nr_events, rsp = 0;
        struct io_event *ep;
@@ -234,12 +234,12 @@ repeat:
        return rsp;
 }
 
-int tdaio_get_parent_id(struct disk_driver *dd, struct disk_id *id)
+static int tdaio_get_parent_id(struct disk_driver *dd, struct disk_id *id)
 {
        return TD_NO_PARENT;
 }
 
-int tdaio_validate_parent(struct disk_driver *dd, 
+static int tdaio_validate_parent(struct disk_driver *dd, 
                          struct disk_driver *parent, td_flag_t flags)
 {
        return -EINVAL;
diff -r 3e563929f17a -r 86e3027df9d9 tools/blktap/drivers/block-qcow.c
--- a/tools/blktap/drivers/block-qcow.c Fri Jul 11 15:35:50 2008 +0100
+++ b/tools/blktap/drivers/block-qcow.c Fri Jul 11 15:36:40 2008 +0100
@@ -720,7 +720,7 @@ static inline void init_fds(struct disk_
 }
 
 /* Open the disk file and initialize qcow state. */
-int tdqcow_open (struct disk_driver *dd, const char *name, td_flag_t flags)
+static int tdqcow_open (struct disk_driver *dd, const char *name, td_flag_t 
flags)
 {
        int fd, len, i, shift, ret, size, l1_table_size, o_flags;
        int max_aio_reqs;
@@ -937,7 +937,7 @@ fail:
        return -1;
 }
 
-int tdqcow_queue_read(struct disk_driver *dd, uint64_t sector,
+static int tdqcow_queue_read(struct disk_driver *dd, uint64_t sector,
                      int nb_sectors, char *buf, td_callback_t cb,
                      int id, void *private)
 {
@@ -999,7 +999,7 @@ done:
        return rsp;
 }
 
-int tdqcow_queue_write(struct disk_driver *dd, uint64_t sector,
+static int tdqcow_queue_write(struct disk_driver *dd, uint64_t sector,
                       int nb_sectors, char *buf, td_callback_t cb,
                       int id, void *private)
 {
@@ -1057,14 +1057,14 @@ int tdqcow_queue_write(struct disk_drive
        return 0;
 }
                
-int tdqcow_submit(struct disk_driver *dd)
+static int tdqcow_submit(struct disk_driver *dd)
 {
         struct tdqcow_state *prv = (struct tdqcow_state *)dd->private;
 
        return tap_aio_submit(&prv->aio);
 }
 
-int tdqcow_close(struct disk_driver *dd)
+static int tdqcow_close(struct disk_driver *dd)
 {
        struct tdqcow_state *s = (struct tdqcow_state *)dd->private;
        uint32_t cksum, out;
@@ -1092,7 +1092,7 @@ int tdqcow_close(struct disk_driver *dd)
        return 0;
 }
 
-int tdqcow_do_callbacks(struct disk_driver *dd, int sid)
+static int tdqcow_do_callbacks(struct disk_driver *dd, int sid)
 {
         int ret, i, nr_events, rsp = 0,*ptr;
         struct io_event *ep;
@@ -1276,7 +1276,7 @@ int qcow_create(const char *filename, ui
        return 0;
 }
 
-int qcow_make_empty(struct tdqcow_state *s)
+static int qcow_make_empty(struct tdqcow_state *s)
 {
        uint32_t l1_length = s->l1_size * sizeof(uint64_t);
 
@@ -1296,14 +1296,14 @@ int qcow_make_empty(struct tdqcow_state 
        return 0;
 }
 
-int qcow_get_cluster_size(struct tdqcow_state *s)
+static int qcow_get_cluster_size(struct tdqcow_state *s)
 {
        return s->cluster_size;
 }
 
 /* XXX: put compressed sectors first, then all the cluster aligned
    tables to avoid losing bytes in alignment */
-int qcow_compress_cluster(struct tdqcow_state *s, int64_t sector_num, 
+static int qcow_compress_cluster(struct tdqcow_state *s, int64_t sector_num, 
                           const uint8_t *buf)
 {
        z_stream strm;
@@ -1358,7 +1358,7 @@ int qcow_compress_cluster(struct tdqcow_
        return 0;
 }
 
-int tdqcow_get_parent_id(struct disk_driver *dd, struct disk_id *id)
+static int tdqcow_get_parent_id(struct disk_driver *dd, struct disk_id *id)
 {
        off_t off;
        char *buf, *filename;
@@ -1392,7 +1392,7 @@ int tdqcow_get_parent_id(struct disk_dri
        return err;
 }
 
-int tdqcow_validate_parent(struct disk_driver *child,
+static int tdqcow_validate_parent(struct disk_driver *child,
                           struct disk_driver *parent, td_flag_t flags)
 {
        struct stat stats;
diff -r 3e563929f17a -r 86e3027df9d9 tools/blktap/drivers/block-ram.c
--- a/tools/blktap/drivers/block-ram.c  Fri Jul 11 15:35:50 2008 +0100
+++ b/tools/blktap/drivers/block-ram.c  Fri Jul 11 15:36:40 2008 +0100
@@ -127,7 +127,7 @@ static inline void init_fds(struct disk_
 }
 
 /* Open the disk file and initialize ram state. */
-int tdram_open (struct disk_driver *dd, const char *name, td_flag_t flags)
+static int tdram_open (struct disk_driver *dd, const char *name, td_flag_t 
flags)
 {
        char *p;
        uint64_t size;
@@ -220,7 +220,7 @@ done:
        return ret;
 }
 
- int tdram_queue_read(struct disk_driver *dd, uint64_t sector,
+static int tdram_queue_read(struct disk_driver *dd, uint64_t sector,
                      int nb_sectors, char *buf, td_callback_t cb,
                      int id, void *private)
 {
@@ -234,7 +234,7 @@ done:
        return cb(dd, 0, sector, nb_sectors, id, private);
 }
 
-int tdram_queue_write(struct disk_driver *dd, uint64_t sector,
+static int tdram_queue_write(struct disk_driver *dd, uint64_t sector,
                      int nb_sectors, char *buf, td_callback_t cb,
                      int id, void *private)
 {
@@ -250,12 +250,12 @@ int tdram_queue_write(struct disk_driver
        return cb(dd, 0, sector, nb_sectors, id, private);
 }
                
-int tdram_submit(struct disk_driver *dd)
+static int tdram_submit(struct disk_driver *dd)
 {
        return 0;       
 }
 
-int tdram_close(struct disk_driver *dd)
+static int tdram_close(struct disk_driver *dd)
 {
        struct tdram_state *prv = (struct tdram_state *)dd->private;
        
@@ -264,18 +264,18 @@ int tdram_close(struct disk_driver *dd)
        return 0;
 }
 
-int tdram_do_callbacks(struct disk_driver *dd, int sid)
+static int tdram_do_callbacks(struct disk_driver *dd, int sid)
 {
        /* always ask for a kick */
        return 1;
 }
 
-int tdram_get_parent_id(struct disk_driver *dd, struct disk_id *id)
+static int tdram_get_parent_id(struct disk_driver *dd, struct disk_id *id)
 {
        return TD_NO_PARENT;
 }
 
-int tdram_validate_parent(struct disk_driver *dd, 
+static int tdram_validate_parent(struct disk_driver *dd, 
                          struct disk_driver *parent, td_flag_t flags)
 {
        return -EINVAL;
diff -r 3e563929f17a -r 86e3027df9d9 tools/blktap/drivers/block-sync.c
--- a/tools/blktap/drivers/block-sync.c Fri Jul 11 15:35:50 2008 +0100
+++ b/tools/blktap/drivers/block-sync.c Fri Jul 11 15:36:40 2008 +0100
@@ -109,7 +109,7 @@ static inline void init_fds(struct disk_
 }
 
 /* Open the disk file and initialize aio state. */
-int tdsync_open (struct disk_driver *dd, const char *name, td_flag_t flags)
+static int tdsync_open (struct disk_driver *dd, const char *name, td_flag_t 
flags)
 {
        int i, fd, ret = 0, o_flags;
        struct td_state     *s   = dd->td_state;
@@ -149,7 +149,7 @@ done:
        return ret;     
 }
 
- int tdsync_queue_read(struct disk_driver *dd, uint64_t sector,
+static int tdsync_queue_read(struct disk_driver *dd, uint64_t sector,
                               int nb_sectors, char *buf, td_callback_t cb,
                               int id, void *private)
 {
@@ -172,7 +172,7 @@ done:
        return cb(dd, (ret < 0) ? ret: 0, sector, nb_sectors, id, private);
 }
 
- int tdsync_queue_write(struct disk_driver *dd, uint64_t sector,
+static int tdsync_queue_write(struct disk_driver *dd, uint64_t sector,
                               int nb_sectors, char *buf, td_callback_t cb,
                               int id, void *private)
 {
@@ -195,12 +195,12 @@ done:
        return cb(dd, (ret < 0) ? ret : 0, sector, nb_sectors, id, private);
 }
                
-int tdsync_submit(struct disk_driver *dd)
+static int tdsync_submit(struct disk_driver *dd)
 {
        return 0;       
 }
 
-int tdsync_close(struct disk_driver *dd)
+static int tdsync_close(struct disk_driver *dd)
 {
        struct tdsync_state *prv = (struct tdsync_state *)dd->private;
        
@@ -211,18 +211,18 @@ int tdsync_close(struct disk_driver *dd)
        return 0;
 }
 
-int tdsync_do_callbacks(struct disk_driver *dd, int sid)
+static int tdsync_do_callbacks(struct disk_driver *dd, int sid)
 {
        /* always ask for a kick */
        return 1;
 }
 
-int tdsync_get_parent_id(struct disk_driver *dd, struct disk_id *id)
+static int tdsync_get_parent_id(struct disk_driver *dd, struct disk_id *id)
 {
        return TD_NO_PARENT;
 }
 
-int tdsync_validate_parent(struct disk_driver *dd, 
+static int tdsync_validate_parent(struct disk_driver *dd, 
                           struct disk_driver *parent, td_flag_t flags)
 {
        return -EINVAL;
diff -r 3e563929f17a -r 86e3027df9d9 tools/blktap/drivers/img2qcow.c
--- a/tools/blktap/drivers/img2qcow.c   Fri Jul 11 15:35:50 2008 +0100
+++ b/tools/blktap/drivers/img2qcow.c   Fri Jul 11 15:36:40 2008 +0100
@@ -61,8 +61,8 @@ static uint64_t prev = 0;
 static uint64_t prev = 0;
 static char output[25];
 
-void print_bytes(void *ptr, int length) {
-
+static void print_bytes(void *ptr, int length)
+{
   int i,k;
   unsigned char *p = ptr;
 
@@ -77,7 +77,7 @@ void print_bytes(void *ptr, int length) 
     return;
 }
 
-void debug_output(uint64_t progress, uint64_t size)
+static void debug_output(uint64_t progress, uint64_t size)
 {
        uint64_t blocks = size/20;
 
diff -r 3e563929f17a -r 86e3027df9d9 tools/blktap/drivers/qcow-create.c
--- a/tools/blktap/drivers/qcow-create.c        Fri Jul 11 15:35:50 2008 +0100
+++ b/tools/blktap/drivers/qcow-create.c        Fri Jul 11 15:36:40 2008 +0100
@@ -48,7 +48,7 @@
 
 #define MAX_NAME_LEN 1000
 
-void help(void)
+static void help(void)
 {
        fprintf(stderr, "Qcow-utils: v1.0.0\n");
        fprintf(stderr, 
diff -r 3e563929f17a -r 86e3027df9d9 tools/blktap/drivers/qcow2raw.c
--- a/tools/blktap/drivers/qcow2raw.c   Fri Jul 11 15:35:50 2008 +0100
+++ b/tools/blktap/drivers/qcow2raw.c   Fri Jul 11 15:36:40 2008 +0100
@@ -65,8 +65,8 @@ static uint64_t prev = 0, written = 0;
 static uint64_t prev = 0, written = 0;
 static char output[25];
 
-void print_bytes(void *ptr, int length) {
-
+static void print_bytes(void *ptr, int length)
+{
   int i,k;
   unsigned char *p = ptr;
 
@@ -81,7 +81,7 @@ void print_bytes(void *ptr, int length) 
     return;
 }
 
-void debug_output(uint64_t progress, uint64_t size)
+static void debug_output(uint64_t progress, uint64_t size)
 {
        /*Output progress every 5% */   
        uint64_t blocks = size/20;
diff -r 3e563929f17a -r 86e3027df9d9 tools/blktap/drivers/tapdisk.c
--- a/tools/blktap/drivers/tapdisk.c    Fri Jul 11 15:35:50 2008 +0100
+++ b/tools/blktap/drivers/tapdisk.c    Fri Jul 11 15:36:40 2008 +0100
@@ -53,14 +53,14 @@ int do_cow_read(struct disk_driver *dd, 
 #define td_for_each_disk(tds, drv) \
         for (drv = tds->disks; drv != NULL; drv = drv->next)
 
-void usage(void) 
+static void usage(void) 
 {
        fprintf(stderr, "blktap-utils: v1.0.0\n");
        fprintf(stderr, "usage: tapdisk <READ fifo> <WRITE fifo>\n");
         exit(-1);
 }
 
-void daemonize(void)
+static void daemonize(void)
 {
        int i;
 
@@ -121,7 +121,7 @@ static void unmap_disk(struct td_state *
        return;
 }
 
-void sig_handler(int sig)
+static void sig_handler(int sig)
 {
        /*Received signal to close. If no disks are active, we close app.*/
 
@@ -512,7 +512,7 @@ static inline void kick_responses(struct
        }
 }
 
-void io_done(struct disk_driver *dd, int sid)
+static void io_done(struct disk_driver *dd, int sid)
 {
        struct tap_disk *drv = dd->drv;
 
@@ -537,7 +537,7 @@ segment_start(blkif_request_t *req, int 
 }
 
 uint64_t sends, responds;
-int send_responses(struct disk_driver *dd, int res, 
+static int send_responses(struct disk_driver *dd, int res, 
                   uint64_t sector, int nr_secs, int idx, void *private)
 {
        pending_req_t   *preq;
diff -r 3e563929f17a -r 86e3027df9d9 tools/blktap/lib/blktaplib.h
--- a/tools/blktap/lib/blktaplib.h      Fri Jul 11 15:35:50 2008 +0100
+++ b/tools/blktap/lib/blktaplib.h      Fri Jul 11 15:36:40 2008 +0100
@@ -213,7 +213,6 @@ typedef struct msg_pid {
 /* xenstore/xenbus: */
 #define DOMNAME "Domain-0"
 int setup_probe_watch(struct xs_handle *h);
-int xs_fire_next_watch(struct xs_handle *h);
 
 
 /* Abitrary values, must match the underlying driver... */
diff -r 3e563929f17a -r 86e3027df9d9 tools/blktap/lib/xenbus.c
--- a/tools/blktap/lib/xenbus.c Fri Jul 11 15:35:50 2008 +0100
+++ b/tools/blktap/lib/xenbus.c Fri Jul 11 15:36:40 2008 +0100
@@ -354,7 +354,7 @@ static void ueblktap_probe(struct xs_han
  *are created, we initalise the state and attach a disk.
  */
 
-int add_blockdevice_probe_watch(struct xs_handle *h, const char *domid)
+static int add_blockdevice_probe_watch(struct xs_handle *h, const char *domid)
 {
        char *path;
        struct xenbus_watch *vbd_watch;
@@ -377,7 +377,7 @@ int add_blockdevice_probe_watch(struct x
 }
 
 /* Asynch callback to check for /local/domain/<DOMID>/name */
-void check_dom(struct xs_handle *h, struct xenbus_watch *w, 
+static void check_dom(struct xs_handle *h, struct xenbus_watch *w, 
               const char *bepath_im)
 {
        char *domid;
@@ -392,7 +392,7 @@ void check_dom(struct xs_handle *h, stru
 }
 
 /* We must wait for xend to register /local/domain/<DOMID> */
-int watch_for_domid(struct xs_handle *h)
+static int watch_for_domid(struct xs_handle *h)
 {
        struct xenbus_watch *domid_watch;
        char *path = NULL;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.