Skip to content

Commit

Permalink
fixed whitespace in libdattobd.c
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Caputi committed Mar 29, 2016
1 parent a613b67 commit 2e681e8
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions lib/libdattobd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
This file is part of dattobd.
This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 as published
by the Free Software Foundation.
*/
Expand All @@ -21,130 +21,130 @@ extern "C" {
int setup_snapshot(unsigned int minor, char *bdev, char *cow, unsigned long fallocated_space, unsigned long cache_size){
int fd, ret;
struct setup_params sp;

fd = open("/dev/datto-ctl", O_RDONLY);
if(fd < 0) return -1;

sp.minor = minor;
sp.bdev = bdev;
sp.cow = cow;
sp.fallocated_space = fallocated_space;
sp.cache_size = cache_size;

ret = ioctl(fd, IOCTL_SETUP_SNAP, &sp);

close(fd);
return ret;
}

int reload_snapshot(unsigned int minor, char *bdev, char *cow, unsigned long cache_size){
int fd, ret;
struct reload_params rp;

fd = open("/dev/datto-ctl", O_RDONLY);
if(fd < 0) return -1;

rp.minor = minor;
rp.bdev = bdev;
rp.cow = cow;
rp.cache_size = cache_size;

ret = ioctl(fd, IOCTL_RELOAD_SNAP, &rp);

close(fd);
return ret;
}

int reload_incremental(unsigned int minor, char *bdev, char *cow, unsigned long cache_size){
int fd, ret;
struct reload_params rp;

fd = open("/dev/datto-ctl", O_RDONLY);
if(fd < 0) return -1;

rp.minor = minor;
rp.bdev = bdev;
rp.cow = cow;
rp.cache_size = cache_size;

ret = ioctl(fd, IOCTL_RELOAD_INC, &rp);

close(fd);
return ret;
}

int destroy(unsigned int minor){
int fd, ret;

fd = open("/dev/datto-ctl", O_RDONLY);
if(fd < 0) return -1;

ret = ioctl(fd, IOCTL_DESTROY, &minor);

close(fd);
return ret;
}

int transition_incremental(unsigned int minor){
int fd, ret;

fd = open("/dev/datto-ctl", O_RDONLY);
if(fd < 0) return -1;

ret = ioctl(fd, IOCTL_TRANSITION_INC, &minor);

close(fd);
return ret;
}

int transition_snapshot(unsigned int minor, char *cow, unsigned long fallocated_space){
int fd, ret;
struct transition_snap_params tp;

tp.minor = minor;
tp.cow = cow;
tp.fallocated_space = fallocated_space;

fd = open("/dev/datto-ctl", O_RDONLY);
if(fd < 0) return -1;

ret = ioctl(fd, IOCTL_TRANSITION_SNAP, &tp);

close(fd);
return ret;
}

int reconfigure(unsigned int minor, unsigned long cache_size){
int fd, ret;
struct reconfigure_params rp;

fd = open("/dev/datto-ctl", O_RDONLY);
if(fd < 0) return -1;

rp.minor = minor;
rp.cache_size = cache_size;

ret = ioctl(fd, IOCTL_RECONFIGURE, &rp);

close(fd);
return ret;
}

int dattobd_info(unsigned int minor, struct dattobd_info *info){
int fd, ret;

if(!info){
errno = EINVAL;
return -1;
}

fd = open("/dev/datto-ctl", O_RDONLY);
if(fd < 0) return -1;

info->minor = minor;

ret = ioctl(fd, IOCTL_DATTOBD_INFO, info);

close(fd);
return ret;
}
Expand Down

0 comments on commit 2e681e8

Please sign in to comment.