summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-08-26 11:44:39 -0700
committerBrian Behlendorf <[email protected]>2010-08-31 13:41:50 -0700
commit325f023544bbec6a478882c442e15304ee379759 (patch)
treee41ddbab7f373fc7fd43390c4ba05ea722729e68 /lib
parent47d0ed1e6f8a8ee67492ec63173a27df8e4ca059 (diff)
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 <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_diff.c2
-rw-r--r--lib/libzfs/libzfs_sendrecv.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/libzfs/libzfs_diff.c b/lib/libzfs/libzfs_diff.c
index 5b3f93465..31e18aad2 100644
--- a/lib/libzfs/libzfs_diff.c
+++ b/lib/libzfs/libzfs_diff.c
@@ -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)
diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c
index 95c4b3568..48e77178f 100644
--- a/lib/libzfs/libzfs_sendrecv.c
+++ b/lib/libzfs/libzfs_sendrecv.c
@@ -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,