mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Make zfsdev_getminor signature cross platform
Only pass the file descriptor to make zfsdev_get_miror() portable. Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #9466
This commit is contained in:
committed by
Brian Behlendorf
parent
0e939e434a
commit
08f530c699
@@ -175,14 +175,18 @@ zfsdev_ioctl(struct file *filp, unsigned cmd, unsigned long arg)
|
||||
}
|
||||
|
||||
int
|
||||
zfsdev_getminor(struct file *filp, minor_t *minorp)
|
||||
zfsdev_getminor(int fd, minor_t *minorp)
|
||||
{
|
||||
zfsdev_state_t *zs, *fpd;
|
||||
file_t *fp;
|
||||
|
||||
ASSERT(filp != NULL);
|
||||
ASSERT(!MUTEX_HELD(&zfsdev_state_lock));
|
||||
fp = getf(fd);
|
||||
|
||||
fpd = filp->private_data;
|
||||
if (fp == NULL)
|
||||
return (SET_ERROR(EBADF));
|
||||
|
||||
fpd = fp->f_file->private_data;
|
||||
if (fpd == NULL)
|
||||
return (SET_ERROR(EBADF));
|
||||
|
||||
|
||||
@@ -40,15 +40,10 @@
|
||||
int
|
||||
zfs_onexit_fd_hold(int fd, minor_t *minorp)
|
||||
{
|
||||
file_t *fp;
|
||||
zfs_onexit_t *zo = NULL;
|
||||
int error;
|
||||
|
||||
fp = getf(fd);
|
||||
if (fp == NULL)
|
||||
return (SET_ERROR(EBADF));
|
||||
|
||||
error = zfsdev_getminor(fp->f_file, minorp);
|
||||
error = zfsdev_getminor(fd, minorp);
|
||||
if (error) {
|
||||
zfs_onexit_fd_rele(fd);
|
||||
return (error);
|
||||
|
||||
Reference in New Issue
Block a user