zfs_link.c revision fa9e4066f08beec538e775443c5be79dd423fcab
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <regex.h>
#include <devfsadm.h>
#include <stdio.h>
#include <strings.h>
#include <stdlib.h>
#include <limits.h>
/* zfs and zvol name info */
#define ZVOL_LINK_RE_DEVICES "zvol/r?dsk/.*/.*$"
/*
* devfs create callback register
*/
static devfsadm_create_t zfs_create_cbt[] = {
},
};
/*
* devfs cleanup register
*/
static devfsadm_remove_t zfs_remove_cbt[] = {
};
/*
* For the zfs control node:
* For zvols:
*/
static int
{
int err;
char *name;
} else {
if (err < 0) {
/* property not defined so can't do anything */
return (DEVFSADM_CONTINUE);
}
/*
* This is where the actual public name gets constructed.
* Change the snprintf format to change the public
* path that gets constructed.
*/
ZVOL_DEV_DIR, name);
} else {
return (DEVFSADM_CONTINUE);
}
}
return (DEVFSADM_CONTINUE);
}