From cdbba101f48bef68b46363a64880b51fa647ad45 Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Sun, 13 Oct 2019 19:19:39 -0700 Subject: Move zfs_onexit_fd_hold to platform code FreeBSD has a very different implementation. Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Matt Macy Closes #9442 --- module/zfs/zfs_onexit.c | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'module/zfs/zfs_onexit.c') diff --git a/module/zfs/zfs_onexit.c b/module/zfs/zfs_onexit.c index 31f77ce81..9f1f6e4e0 100644 --- a/module/zfs/zfs_onexit.c +++ b/module/zfs/zfs_onexit.c @@ -111,39 +111,6 @@ zfs_onexit_minor_to_state(minor_t minor, zfs_onexit_t **zo) return (0); } -/* - * Consumers might need to operate by minor number instead of fd, since - * they might be running in another thread (e.g. txg_sync_thread). Callers - * of this function must call zfs_onexit_fd_rele() when they're finished - * using the minor number. - */ -int -zfs_onexit_fd_hold(int fd, minor_t *minorp) -{ - file_t *fp; - zfs_onexit_t *zo; - int error; - - fp = getf(fd); - if (fp == NULL) - return (SET_ERROR(EBADF)); - - error = zfsdev_getminor(fp->f_file, minorp); - if (error == 0) - error = zfs_onexit_minor_to_state(*minorp, &zo); - - if (error) - zfs_onexit_fd_rele(fd); - - return (error); -} - -void -zfs_onexit_fd_rele(int fd) -{ - releasef(fd); -} - /* * Add a callback to be invoked when the calling process exits. */ -- cgit v1.2.3