diff options
author | Csaba Henk <csaba@redhat.com> | 2018-08-09 11:46:33 +0200 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-11-06 04:21:57 +0000 |
commit | bceb9f25671e65cb2f0987a84370055e7c36900f (patch) | |
tree | 3ed0a55bae57f2d4aae643a70d8a44c41bf77d6c /libglusterfs/src/timespec.c | |
parent | 258db7178663305c26aa0068d4f72159ff0bc3ba (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/src/timespec.c')
-rw-r--r-- | libglusterfs/src/timespec.c | 16 |
1 files changed, 16 insertions, 0 deletions
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; +} |