Merge branch 'xseg-refactor' into debian
authorFilippos Giannakos <philipgian@grnet.gr>
Wed, 14 Nov 2012 15:27:54 +0000 (17:27 +0200)
committerFilippos Giannakos <philipgian@grnet.gr>
Wed, 14 Nov 2012 15:27:54 +0000 (17:27 +0200)
xseg/archipelago
xseg/peers/user/mt-mapperd.c
xseg/peers/user/mt-sosd.c
xseg/tools/vlmc

index f39ccf4..2fa7e50 100755 (executable)
@@ -6,7 +6,7 @@ import os, sys, subprocess, argparse, time, psutil, signal, socket
 from subprocess import call, check_call
 
 BIN_PATH="/usr/bin"
-PIDFILE_PATH="/var/run/archipelagos"
+PIDFILE_PATH="/var/run/archipelago"
 
 DEVICE_PREFIX="/dev/xsegbd"
 XSEGBD_SYSFS="/sys/bus/xsegbd/"
@@ -53,7 +53,7 @@ RADOS_POOL_BLOCKS=""
 STORAGE="File"
 
 try:
-    execfile(os.path.expanduser("/etc/default/archipelagos"), globals())
+    execfile(os.path.expanduser("/etc/default/archipelago"), globals())
 except:
     print "Cannot open defaults"
     sys.exit(1)
@@ -512,16 +512,16 @@ if __name__ == "__main__":
     parser.add_argument('-c', '--config', type=str, nargs='?', help='config file')
     subparsers = parser.add_subparsers()
 
-    start_parser = subparsers.add_parser('start', help='Start archipelagos')
+    start_parser = subparsers.add_parser('start', help='Start archipelago')
     start_parser.set_defaults(func=start)
     
-    stop_parser = subparsers.add_parser('stop', help='Stop archipelagos')
+    stop_parser = subparsers.add_parser('stop', help='Stop archipelago')
     stop_parser.set_defaults(func=stop)
     
-    status_parser = subparsers.add_parser('status', help='Archipelagos status')
+    status_parser = subparsers.add_parser('status', help='Archipelago status')
     status_parser.set_defaults(func=status)
     
-    restart_parser = subparsers.add_parser('restart', help='Restart archipelagos')
+    restart_parser = subparsers.add_parser('restart', help='Restart archipelago')
     restart_parser.set_defaults(func=restart)
 
     args = parser.parse_args()
index ec32fca..b0af886 100644 (file)
@@ -742,7 +742,8 @@ static int load_map(struct peer_req *pr, struct map *map)
        return r;
 }
 
-static struct xseg_request * __open_map(struct peer_req *pr, struct map *m)
+static struct xseg_request * __open_map(struct peer_req *pr, struct map *m,
+                                               uint32_t flags)
 {
        int r;
        xport p;
@@ -774,6 +775,8 @@ static struct xseg_request * __open_map(struct peer_req *pr, struct map *m)
        req->op = X_OPEN;
        req->size = block_size;
        req->offset = 0;
+       if (!(flags & MF_FORCE))
+               req->flags = XF_NOSYNC;
        r = xseg_set_req_data(peer->xseg, req, pr);
        if (r < 0){
                XSEGLOG2(&lc, E, "Cannot set request data for map %s",
@@ -799,14 +802,14 @@ out_fail:
        return NULL;
 }
 
-static int open_map(struct peer_req *pr, struct map *map)
+static int open_map(struct peer_req *pr, struct map *map, uint32_t flags)
 {
        int err;
        struct xseg_request *req;
        struct peerd *peer = pr->peer;
 
        map->flags |= MF_MAP_OPENING;
-       req = __open_map(pr, map);
+       req = __open_map(pr, map, flags);
        if (!req)
                return -1;
        wait_on_pr(pr, (!((req->state & XS_FAILED)||(req->state & XS_SERVED))));
@@ -1652,13 +1655,11 @@ out_err:
 static int open_load_map(struct peer_req *pr, struct map *map, uint32_t flags)
 {
        int r, opened = 0;
-retry_open:
        if (flags & MF_EXCLUSIVE){
-               r = open_map(pr, map);
+               r = open_map(pr, map, flags);
                if (r < 0) {
                        if (flags & MF_FORCE){
-
-                               goto retry_open;
+                               return -1;
                        }
                } else {
                        opened = 1;
index d6019af..28a25a3 100644 (file)
@@ -476,7 +476,7 @@ void * lock_op(void *arg)
        }
 
        while(rados_lock(rados->ioctx, rio->obj_name) < 0){
-               if (!(pr->req->flags & XF_NOSYNC)){
+               if (pr->req->flags & XF_NOSYNC){
                        XSEGLOG2(&lc, E, "Rados lock failed for %s",
                                        rio->obj_name);
                        fail(pr->peer, pr);
index f049170..e15ca47 100755 (executable)
@@ -165,7 +165,7 @@ def loadrc(rc):
     #FIXME
     try:
         if rc == None:
-            execfile(os.path.expanduser("/etc/defaut/archipelago"), globals())
+            execfile(os.path.expanduser("/etc/default/archipelago"), globals())
         else:
             execfile(rc, globals())
     except: