summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohnlev <none@none>2008-06-11 18:14:59 -0700
committerjohnlev <none@none>2008-06-11 18:14:59 -0700
commit43d5cd3d2ec5c3a1e2b2a9155ae4042c14a99011 (patch)
tree8278901792de80c4c0e30057df514f792313b574
parent23310c0096a05972772d3765714742fb3873fa2f (diff)
downloadillumos-gate-43d5cd3d2ec5c3a1e2b2a9155ae4042c14a99011.tar.gz
PSARC 2008/366 VSW_CANLOFI
6709611 PSARC 2008/366 VSW_CANLOFI
-rw-r--r--usr/src/uts/common/fs/hsfs/hsfs_vfsops.c3
-rw-r--r--usr/src/uts/common/fs/pcfs/pc_vfsops.c2
-rw-r--r--usr/src/uts/common/fs/udfs/udf_vfsops.c2
-rw-r--r--usr/src/uts/common/fs/ufs/ufs_vfsops.c2
-rw-r--r--usr/src/uts/common/fs/vfs.c25
-rw-r--r--usr/src/uts/common/gssapi/gssd_clnt_stubs.c9
-rw-r--r--usr/src/uts/common/os/modctl.c10
-rw-r--r--usr/src/uts/common/sys/modctl.h4
-rw-r--r--usr/src/uts/common/sys/vfs.h7
-rw-r--r--usr/src/uts/sun4u/serengeti/io/ssm.c3
10 files changed, 37 insertions, 30 deletions
diff --git a/usr/src/uts/common/fs/hsfs/hsfs_vfsops.c b/usr/src/uts/common/fs/hsfs/hsfs_vfsops.c
index 5b2ae35930..b8ee0060aa 100644
--- a/usr/src/uts/common/fs/hsfs/hsfs_vfsops.c
+++ b/usr/src/uts/common/fs/hsfs/hsfs_vfsops.c
@@ -150,7 +150,8 @@ static vfsdef_t vfw = {
VFSDEF_VERSION,
"hsfs",
hsfsinit,
- VSW_HASPROTO|VSW_STATS, /* We don't suppport remounting */
+ /* We don't suppport remounting */
+ VSW_HASPROTO|VSW_STATS|VSW_CANLOFI,
&hsfs_proto_opttbl
};
diff --git a/usr/src/uts/common/fs/pcfs/pc_vfsops.c b/usr/src/uts/common/fs/pcfs/pc_vfsops.c
index 9062bf1304..ea0c78da59 100644
--- a/usr/src/uts/common/fs/pcfs/pc_vfsops.c
+++ b/usr/src/uts/common/fs/pcfs/pc_vfsops.c
@@ -157,7 +157,7 @@ static vfsdef_t vfw = {
VFSDEF_VERSION,
"pcfs",
pcfsinit,
- VSW_HASPROTO|VSW_CANREMOUNT|VSW_STATS,
+ VSW_HASPROTO|VSW_CANREMOUNT|VSW_STATS|VSW_CANLOFI,
&pcfs_mntopts
};
diff --git a/usr/src/uts/common/fs/udfs/udf_vfsops.c b/usr/src/uts/common/fs/udfs/udf_vfsops.c
index 7d638f9066..bc8ca1096d 100644
--- a/usr/src/uts/common/fs/udfs/udf_vfsops.c
+++ b/usr/src/uts/common/fs/udfs/udf_vfsops.c
@@ -122,7 +122,7 @@ static vfsdef_t vfw = {
VFSDEF_VERSION,
"udfs",
udfinit,
- VSW_HASPROTO|VSW_CANREMOUNT|VSW_STATS,
+ VSW_HASPROTO|VSW_CANREMOUNT|VSW_STATS|VSW_CANLOFI,
&udfs_mntopts
};
diff --git a/usr/src/uts/common/fs/ufs/ufs_vfsops.c b/usr/src/uts/common/fs/ufs/ufs_vfsops.c
index bcc7bfbfd0..d2783fede8 100644
--- a/usr/src/uts/common/fs/ufs/ufs_vfsops.c
+++ b/usr/src/uts/common/fs/ufs/ufs_vfsops.c
@@ -197,7 +197,7 @@ static vfsdef_t vfw = {
VFSDEF_VERSION,
"ufs",
ufsinit,
- VSW_HASPROTO|VSW_CANREMOUNT|VSW_STATS,
+ VSW_HASPROTO|VSW_CANREMOUNT|VSW_STATS|VSW_CANLOFI,
&ufs_mntopts
};
diff --git a/usr/src/uts/common/fs/vfs.c b/usr/src/uts/common/fs/vfs.c
index e63615d464..feebcd2bd0 100644
--- a/usr/src/uts/common/fs/vfs.c
+++ b/usr/src/uts/common/fs/vfs.c
@@ -998,14 +998,21 @@ lofi_add(const char *fsname, struct vfs *vfsp,
struct pathname pn = { NULL };
ldi_ident_t ldi_id;
ldi_handle_t ldi_hdl;
+ vfssw_t *vfssw;
int minor;
int err = 0;
- if (fsname == NULL)
+ if (fsname == NULL ||
+ (vfssw = vfs_getvfssw(fsname)) == NULL)
return (0);
- if (strcmp(fsname, "mntfs") == 0 || strcmp(fsname, "lofs") == 0 ||
- strcmp(fsname, "autofs") == 0)
+
+ if (!(vfssw->vsw_flag & VSW_CANLOFI)) {
+ vfs_unrefvfssw(vfssw);
return (0);
+ }
+
+ vfs_unrefvfssw(vfssw);
+ vfssw = NULL;
if (pn_get(uap->spec, fromspace, &pn) != 0)
return (0);
@@ -3812,7 +3819,7 @@ vfs_opsinuse(vfsops_t *ops)
* Allocate an entry in vfssw for a file system type
*/
struct vfssw *
-allocate_vfssw(char *type)
+allocate_vfssw(const char *type)
{
struct vfssw *vswp;
@@ -3843,8 +3850,8 @@ allocate_vfssw(char *type)
* Impose additional layer of translation between vfstype names
* and module names in the filesystem.
*/
-static char *
-vfs_to_modname(char *vfstype)
+static const char *
+vfs_to_modname(const char *vfstype)
{
if (strcmp(vfstype, "proc") == 0) {
vfstype = "procfs";
@@ -3863,10 +3870,10 @@ vfs_to_modname(char *vfstype)
* If it's installed, return the vfssw locked to prevent unloading.
*/
struct vfssw *
-vfs_getvfssw(char *type)
+vfs_getvfssw(const char *type)
{
struct vfssw *vswp;
- char *modname;
+ const char *modname;
RLOCK_VFSSW();
vswp = vfs_getvfsswbyname(type);
@@ -3925,7 +3932,7 @@ vfs_getvfssw(char *type)
* Find a vfssw entry given a file system type name.
*/
struct vfssw *
-vfs_getvfsswbyname(char *type)
+vfs_getvfsswbyname(const char *type)
{
struct vfssw *vswp;
diff --git a/usr/src/uts/common/gssapi/gssd_clnt_stubs.c b/usr/src/uts/common/gssapi/gssd_clnt_stubs.c
index e6ef5ab189..774c2c5711 100644
--- a/usr/src/uts/common/gssapi/gssd_clnt_stubs.c
+++ b/usr/src/uts/common/gssapi/gssd_clnt_stubs.c
@@ -2,9 +2,8 @@
* 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.
+ * Common Development and Distribution License (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
* or http://www.opensolaris.org/os/licensing.
@@ -20,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -2759,7 +2758,7 @@ __kgss_reset_mech(gss_mechanism *mechp, gss_OID mech_oid)
kmod = kgss_get_kmod(mech_oid);
if (kmod) {
- extern int modload(char *, char *);
+ extern int modload(const char *, const char *);
if (modload("misc/kgss", kmod) < 0) {
/*
* Modload of 'kmod' failed, so log an
diff --git a/usr/src/uts/common/os/modctl.c b/usr/src/uts/common/os/modctl.c
index 501cb7ba09..d53528975f 100644
--- a/usr/src/uts/common/os/modctl.c
+++ b/usr/src/uts/common/os/modctl.c
@@ -2442,7 +2442,7 @@ modload_thread(struct loadmt *ltp)
* returned (-1 on error).
*/
static int
-modrload(char *subdir, char *filename, struct modctl **rmodp)
+modrload(const char *subdir, const char *filename, struct modctl **rmodp)
{
struct modctl *modp;
size_t size;
@@ -2467,7 +2467,7 @@ modrload(char *subdir, char *filename, struct modctl **rmodp)
fullname = kmem_zalloc(size, KM_SLEEP);
(void) sprintf(fullname, "%s/%s", subdir, filename);
} else {
- fullname = filename;
+ fullname = (char *)filename;
}
modp = mod_hold_installed_mod(fullname, 1, 0, &retval);
@@ -2496,7 +2496,7 @@ done: if (subdir != NULL)
* _fini/mod_remove implementation to determine if unload will succeed.
*/
int
-modload(char *subdir, char *filename)
+modload(const char *subdir, const char *filename)
{
return (modrload(subdir, filename, NULL));
}
@@ -2575,7 +2575,7 @@ modload_qualified(const char *subdir, const char *p1,
* Load a module.
*/
int
-modloadonly(char *subdir, char *filename)
+modloadonly(const char *subdir, const char *filename)
{
struct modctl *modp;
char *fullname;
@@ -2590,7 +2590,7 @@ modloadonly(char *subdir, char *filename)
fullname = kmem_zalloc(size, KM_SLEEP);
(void) sprintf(fullname, "%s/%s", subdir, filename);
} else {
- fullname = filename;
+ fullname = (char *)filename;
}
modp = mod_hold_loaded_mod(NULL, fullname, &retval);
diff --git a/usr/src/uts/common/sys/modctl.h b/usr/src/uts/common/sys/modctl.h
index 6ee8985346..e8462ddce4 100644
--- a/usr/src/uts/common/sys/modctl.h
+++ b/usr/src/uts/common/sys/modctl.h
@@ -543,8 +543,8 @@ extern int modload_qualified(const char *,
const char *, const char *, const char *, uint_t[], int, int *);
extern void mod_setup(void);
-extern int modload(char *, char *);
-extern int modloadonly(char *, char *);
+extern int modload(const char *, const char *);
+extern int modloadonly(const char *, const char *);
extern int modunload(int);
extern int mod_hold_stub(struct mod_stub_info *);
extern void modunload_disable(void);
diff --git a/usr/src/uts/common/sys/vfs.h b/usr/src/uts/common/sys/vfs.h
index 2cc2e4f64c..d253e8857c 100644
--- a/usr/src/uts/common/sys/vfs.h
+++ b/usr/src/uts/common/sys/vfs.h
@@ -432,6 +432,7 @@ enum {
#define VSW_VOLATILEDEV 0x10 /* vfs_dev can change each time fs is mounted */
#define VSW_STATS 0x20 /* file system can collect stats */
#define VSW_XID 0x40 /* file system supports extended ids */
+#define VSW_CANLOFI 0x80 /* file system supports lofi mounts */
#define VSW_INSTALLED 0x8000 /* this vsw is associated with a file system */
@@ -515,9 +516,9 @@ int vfs_opsinuse(vfsops_t *);
struct vfs *getvfs(fsid_t *);
struct vfs *vfs_dev2vfsp(dev_t);
struct vfs *vfs_mntpoint2vfsp(const char *);
-struct vfssw *allocate_vfssw(char *);
-struct vfssw *vfs_getvfssw(char *);
-struct vfssw *vfs_getvfsswbyname(char *);
+struct vfssw *allocate_vfssw(const char *);
+struct vfssw *vfs_getvfssw(const char *);
+struct vfssw *vfs_getvfsswbyname(const char *);
struct vfssw *vfs_getvfsswbyvfsops(vfsops_t *);
void vfs_refvfssw(struct vfssw *);
void vfs_unrefvfssw(struct vfssw *);
diff --git a/usr/src/uts/sun4u/serengeti/io/ssm.c b/usr/src/uts/sun4u/serengeti/io/ssm.c
index faa515113b..a498d304ae 100644
--- a/usr/src/uts/sun4u/serengeti/io/ssm.c
+++ b/usr/src/uts/sun4u/serengeti/io/ssm.c
@@ -20,7 +20,7 @@
*/
/*
- * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -709,7 +709,6 @@ ssm_open(dev_t *devi, int flags, int otyp, cred_t *credp)
{
struct ssm_soft_state *softsp;
minor_t board, instance;
- int modload(char *, char *);
int (*sbd_setup_instance)(int, dev_info_t *, int, int, caddr_t);
ssm_sbdp_info_t sbdp_info;
int rv;