From 49171951e3c2ee391cc14135ca9389ecb4e38f47 Mon Sep 17 00:00:00 2001 From: davide Date: Sat, 4 May 2013 14:03:18 +0000 Subject: Completely rewrite the interface to smbdev switching from dev_clone to cdevpriv(9). This commit changes the semantic of mount_smbfs in userland as well, which now passes file descriptor in order to to mount a specific filesystem istance. Reviewed by: attilio, ed Tested by: martymac --- contrib/smbfs/lib/smb/ctx.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'contrib/smbfs/lib/smb/ctx.c') diff --git a/contrib/smbfs/lib/smb/ctx.c b/contrib/smbfs/lib/smb/ctx.c index 0709b6b..c7b3ecab 100644 --- a/contrib/smbfs/lib/smb/ctx.c +++ b/contrib/smbfs/lib/smb/ctx.c @@ -602,40 +602,12 @@ smb_ctx_gethandle(struct smb_ctx *ctx) int fd, i; char buf[20]; - /* - * First, try to open as cloned device - */ fd = open("/dev/"NSMB_NAME, O_RDWR); if (fd >= 0) { ctx->ct_fd = fd; return 0; } - /* - * well, no clone capabilities available - we have to scan - * all devices in order to get free one - */ - for (i = 0; i < 1024; i++) { - snprintf(buf, sizeof(buf), "/dev/%s%d", NSMB_NAME, i); - fd = open(buf, O_RDWR); - if (fd >= 0) { - ctx->ct_fd = fd; - return 0; - } - } - /* - * This is a compatibility with old /dev/net/nsmb device - */ - for (i = 0; i < 1024; i++) { - snprintf(buf, sizeof(buf), "/dev/net/%s%d", NSMB_NAME, i); - fd = open(buf, O_RDWR); - if (fd >= 0) { - ctx->ct_fd = fd; - return 0; - } - if (errno == ENOENT) - return ENOENT; - } - return ENOENT; + return ENOENT; } int -- cgit v1.1