summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorCsaba Henk <csaba@redhat.com>2018-08-09 11:46:33 +0200
committerAmar Tumballi <amarts@redhat.com>2018-11-06 04:21:57 +0000
commitbceb9f25671e65cb2f0987a84370055e7c36900f (patch)
tree3ed0a55bae57f2d4aae643a70d8a44c41bf77d6c /libglusterfs
parent258db7178663305c26aa0068d4f72159ff0bc3ba (diff)
fuse: interrupt handling framework
- add sub-framework to send timed responses to kernel - add interrupt handler queue - implement INTERRUPT fuse_interrupt looks up handlers for interrupted messages in the queue. If found, it invokes the handler function. Else responds with EAGAIN with a delay. See spec at https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/filesystems/fuse.txt?h=v4.17#n148 and explanation in comments. Change-Id: I1a79d3679b31f36e14b4ac8f60b7f2c1ea2badfb updates: #465 Signed-off-by: Csaba Henk <csaba@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/libglusterfs.sym2
-rw-r--r--libglusterfs/src/timespec.c16
-rw-r--r--libglusterfs/src/timespec.h2
3 files changed, 20 insertions, 0 deletions
diff --git a/libglusterfs/src/libglusterfs.sym b/libglusterfs/src/libglusterfs.sym
index 27eb1175b56..c8c42311c80 100644
--- a/libglusterfs/src/libglusterfs.sym
+++ b/libglusterfs/src/libglusterfs.sym
@@ -1057,6 +1057,8 @@ tbf_init
tbf_throttle
timespec_now
timespec_sub
+timespec_adjust_delta
+timespec_cmp
token_iter_init
trap
trie_add
diff --git a/libglusterfs/src/timespec.c b/libglusterfs/src/timespec.c
index d17506662ac..c0d4ab9315b 100644
--- a/libglusterfs/src/timespec.c
+++ b/libglusterfs/src/timespec.c
@@ -90,3 +90,19 @@ timespec_sub(const struct timespec *begin, const struct timespec *end,
res->tv_nsec = end->tv_nsec - begin->tv_nsec;
}
}
+
+int
+timespec_cmp(const struct timespec *lhs_ts, const struct timespec *rhs_ts)
+{
+ if (lhs_ts->tv_sec < rhs_ts->tv_sec) {
+ return -1;
+ } else if (lhs_ts->tv_sec > rhs_ts->tv_sec) {
+ return 1;
+ } else if (lhs_ts->tv_nsec < rhs_ts->tv_nsec) {
+ return -1;
+ } else if (lhs_ts->tv_nsec > rhs_ts->tv_nsec) {
+ return 1;
+ }
+
+ return 0;
+}
diff --git a/libglusterfs/src/timespec.h b/libglusterfs/src/timespec.h
index 73db2d16abe..871871d538c 100644
--- a/libglusterfs/src/timespec.h
+++ b/libglusterfs/src/timespec.h
@@ -25,5 +25,7 @@ timespec_adjust_delta(struct timespec *ts, struct timespec delta);
void
timespec_sub(const struct timespec *begin, const struct timespec *end,
struct timespec *res);
+int
+timespec_cmp(const struct timespec *lhs_ts, const struct timespec *rhs_ts);
#endif /* __INCLUDE_TIMESPEC_H__ */