diff options
author | Amar Tumballi <amarts@redhat.com> | 2018-10-03 17:00:24 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2018-11-02 02:39:35 +0000 |
commit | 55a6ba56bea9ec0d3316c005300c514ea3ab0e54 (patch) | |
tree | 0d36d876e25b158858805b682d01bb5207a4f08e /tests/basic/tier/file_lock.c | |
parent | 6e8f7bb6ab457cfee42e405243cf4db82a9a56b8 (diff) |
tiering: remove the translator from build and glusterd
Based on the proposal to remove few features as they are not
actively maintained [1], removing tier translator from the
build. Also make sure there are no regression tests involving
tiering feature are present.
[1] https://lists.gluster.org/pipermail/gluster-users/2018-July/034400.html
Change-Id: I2c177f711f9b54b7b24e1a13525ff3132bd9a9c5
updates: bz#1642807
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'tests/basic/tier/file_lock.c')
-rw-r--r-- | tests/basic/tier/file_lock.c | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/tests/basic/tier/file_lock.c b/tests/basic/tier/file_lock.c deleted file mode 100644 index 20fdbc0f668..00000000000 --- a/tests/basic/tier/file_lock.c +++ /dev/null @@ -1,72 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> - -void -usage(void) -{ - printf("Usage: testlock <filepath> [R|W]\n"); - return; -} - -int -main(int argc, char *argv[]) -{ - char *file_path = NULL; - int fd = -1; - struct flock lock = {0}; - int ret = -1; - int c = 0; - - if (argc != 3) { - usage(); - exit(1); - } - - file_path = argv[1]; - fd = open(file_path, O_RDWR); - - if (-1 == fd) { - printf("Failed to open file %s. %m\n", file_path); - exit(1); - } - - /* TODO: Check for invalid input*/ - - if (!strcmp(argv[2], "W")) { - lock.l_type = F_WRLCK; - printf("Taking write lock\n"); - - } else { - lock.l_type = F_RDLCK; - printf("Taking read lock\n"); - } - - lock.l_whence = SEEK_SET; - lock.l_start = 0; - lock.l_len = 0; - lock.l_pid = getpid(); - - printf("Acquiring lock on %s\n", file_path); - ret = fcntl(fd, F_SETLK, &lock); - if (ret) { - printf("Failed to acquire lock on %s (%m)\n", file_path); - close(fd); - exit(1); - } - - sleep(10); - - /*Unlock*/ - - printf("Releasing lock on %s\n", file_path); - lock.l_type = F_UNLCK; - ret = fcntl(fd, F_SETLK, &lock); - if (ret) { - printf("Failed to release lock on %s (%m)\n", file_path); - } - - close(fd); - return ret; -} |