mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Add linux kernel device support
This branch contains the majority of the changes required to cleanly intergrate with Linux style special devices (/dev/zfs). Mainly this means dropping all the Solaris style callbacks and replacing them with the Linux equivilants. This patch also adds the onexit infrastructure needed to track some minimal state between ioctls. Under Linux it would be easy to do this simply using the file->private_data. But under Solaris they apparent need to pass the file descriptor as part of the ioctl data and then perform a lookup in the kernel. Once again to keep code change to a minimum I've implemented the Solaris solution. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
@@ -726,7 +726,7 @@ setup_differ_info(zfs_handle_t *zhp, const char *fromsnap,
|
||||
{
|
||||
di->zhp = zhp;
|
||||
|
||||
di->cleanupfd = open(ZFS_DEV, O_RDWR|O_EXCL);
|
||||
di->cleanupfd = open(ZFS_DEV, O_RDWR);
|
||||
VERIFY(di->cleanupfd >= 0);
|
||||
|
||||
if (get_snapshot_names(di, fromsnap, tosnap) != 0)
|
||||
|
||||
@@ -1413,7 +1413,7 @@ zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
|
||||
++holdseq;
|
||||
(void) snprintf(sdd.holdtag, sizeof (sdd.holdtag),
|
||||
".send-%d-%llu", getpid(), (u_longlong_t)holdseq);
|
||||
sdd.cleanup_fd = open(ZFS_DEV, O_RDWR|O_EXCL);
|
||||
sdd.cleanup_fd = open(ZFS_DEV, O_RDWR);
|
||||
if (sdd.cleanup_fd < 0) {
|
||||
err = errno;
|
||||
goto stderr_out;
|
||||
@@ -2988,7 +2988,7 @@ zfs_receive(libzfs_handle_t *hdl, const char *tosnap, recvflags_t flags,
|
||||
int cleanup_fd;
|
||||
uint64_t action_handle = 0;
|
||||
|
||||
cleanup_fd = open(ZFS_DEV, O_RDWR|O_EXCL);
|
||||
cleanup_fd = open(ZFS_DEV, O_RDWR);
|
||||
VERIFY(cleanup_fd >= 0);
|
||||
|
||||
err = zfs_receive_impl(hdl, tosnap, flags, infd, NULL, NULL,
|
||||
|
||||
Reference in New Issue
Block a user