diff options
author | Rajesh Joseph <rjoseph@redhat.com> | 2013-12-03 02:01:04 -0800 |
---|---|---|
committer | Gerrit Code Review <review@dev.gluster.org> | 2013-12-03 02:01:04 -0800 |
commit | 64a5178026e452b4ca5552db7de34573267411ed (patch) | |
tree | 218ca9ddc382344453ce2495a6cecbdb2bec18d2 | |
parent | f834bbc2714a52db7955474ee362321c4f6617ce (diff) | |
parent | 7fb03c40022af4ab5111ddccdd5d2ce926fe2ca9 (diff) |
Merge "mgmt/glusterd: use runner apis to mount the snap device" into development
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-snapshot.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c index 6a1fc4cea..fd9ba9936 100644 --- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c +++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c @@ -2878,6 +2878,8 @@ glusterd_snap_brick_create (char *device, glusterd_volinfo_t *snap_volinfo, char *snap_brick_dir = NULL; char snap_brick_path[PATH_MAX] = {0, }; struct stat statbuf = {0, }; + runner_t runner = {0, }; + char msg[1024] = {0, }; this = THIS; @@ -2948,9 +2950,22 @@ glusterd_snap_brick_create (char *device, glusterd_volinfo_t *snap_volinfo, } /* mount the snap logical device on the directory inside /run/gluster/snaps/<snapname>/@snap_brick_mount_path + Way to mount the snap brick via mount api is this. + ret = mount (device, snap_brick_mount_path, entry->mnt_type, MS_MGC_VAL, + "nouuid"); + But for now, mounting using runner apis. */ - ret = mount (device, snap_brick_mount_path, entry->mnt_type, MS_MGC_VAL, - "nouuid"); + runinit (&runner); + snprintf (msg, sizeof (msg), "mounting snapshot of the brick %s:%s", + original_brickinfo->hostname, original_brickinfo->path); + runner_add_args (&runner, "mount", "-t", entry->mnt_type, + "-o", "nouuid", device, snap_brick_mount_path, NULL); + runner_log (&runner, "", GF_LOG_DEBUG, msg); + + //let glusterd get blocked till snapshot is over + synclock_unlock (&priv->big_lock); + ret = runner_run (&runner); + synclock_lock (&priv->big_lock); if (ret) { gf_log (this->name, GF_LOG_ERROR, "mounting the snapshot " "logical device %s failed (error: %s)", device, |