Project

General

Profile

Actions

Submit #2905

closed

Add EVFILT_FS

Added by tkusumi about 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
04/29/2016
Due date:
% Done:

0%

Estimated time:

Description

Matt (or Sephe),

I'd like to add EVFILT_FS type to kqueue events.
autoumountd which is a userspace daemon of autofs needs this.

EVFILT_FS has existed in FreeBSD since 2004.
EVFILT_FS is triggered only when mounting or unmounting a filesystem.
(FreeBSD later added some NFS events in addition to mount/unmount, but this commit doesn't apply those)

The patch needs to be reviewed as I've only read kern/kern_event.c today to briefly understand the mechanism.

https://leaf.dragonflybsd.org/~tkusumi/diff/0001-sys-kern-Add-EVFILT_FS.patch

sample userspace code
https://leaf.dragonflybsd.org/~tkusumi/diff/kqueue1.c

--
[root@]~# gcc -Wall -g ./kqueue1.c -o ./kqueue1
[root@]~# ./kqueue1
timeout
timeout
timeout
timeout
timeout
timeout
filesystem event filter=-10 mount
timeout
timeout
filesystem event filter=-10 unmount
timeout
timeout
filesystem event filter=-10 mount
filesystem event filter=-10 unmount
timeout
timeout
timeout
^C

Actions #1

Updated by sepherosa almost 8 years ago

Looks good to me.

On Fri, Apr 29, 2016 at 10:20 PM,
<> wrote:

Issue #2905 has been reported by tkusumi.

----------------------------------------
Submit #2905: Add EVFILT_FS
http://bugs.dragonflybsd.org/issues/2905

  • Author: tkusumi
  • Status: New
  • Priority: Normal
  • Assignee:
  • Category:
  • Target version:
    ----------------------------------------
    Matt (or Sephe),

I'd like to add EVFILT_FS type to kqueue events.
autoumountd which is a userspace daemon of autofs needs this.

EVFILT_FS has existed in FreeBSD since 2004.
EVFILT_FS is triggered only when mounting or unmounting a filesystem.
(FreeBSD later added some NFS events in addition to mount/unmount, but this commit doesn't apply those)

The patch needs to be reviewed as I've only read kern/kern_event.c today to briefly understand the mechanism.

https://leaf.dragonflybsd.org/~tkusumi/diff/0001-sys-kern-Add-EVFILT_FS.patch

sample userspace code
https://leaf.dragonflybsd.org/~tkusumi/diff/kqueue1.c

--
[root@]~# gcc -Wall -g ./kqueue1.c -o ./kqueue1
[root@]~# ./kqueue1
timeout
timeout
timeout
timeout
timeout
timeout
filesystem event filter=-10 mount
timeout
timeout
filesystem event filter=-10 unmount
timeout
timeout
filesystem event filter=-10 mount
filesystem event filter=-10 unmount
timeout
timeout
timeout
^C

--
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account

--
Tomorrow Will Never Die

Actions #2

Updated by tkusumi almost 8 years ago

Sephe, thanks for your review.
I'll commit this soon if there is no objection.

Actions #3

Updated by tkusumi almost 8 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF