* Copyright (c) 1999 Stelias Computing, Inc.
* (authors {pschwan,braam}@stelias.com)
* Copyright (C) 1999 Seagate Technology, Inc.
+ * Copyright (C) 2001 Cluster File Systems, Inc.
*
*
*/
return 0;
}
-/* support function */
-static struct obd_type *obd_nm_to_type(char *nm)
+/*
+ * support functions: we could use inter-module communication, but this
+ * is more portable to other OS's
+ */
+static struct obd_type *obd_search_type(char *nm)
{
struct list_head *tmp;
struct obd_type *type;
return type;
}
}
- return NULL;
+ return NULL;
+}
+
+static struct obd_type *obd_nm_to_type(char *nm)
+{
+ struct obd_type *type = obd_search_type(nm);
+
+#ifdef CONFIG_KMOD
+ if ( !type ) {
+ if ( !request_module(nm) ) {
+ CDEBUG(D_PSDEV, "Loaded module '%s'\n", nm);
+ type = obd_search_type(nm);
+ } else {
+ CDEBUG(D_PSDEV, "Can't load module '%s'\n", nm);
+ }
+ }
+#endif
+ return type;
}
static int obd_devicename_from_path(obd_devicename* whoami,
uint32_t klen,
- char* kname)
+ char* kname, char *user_path)
{
+ int err;
+ struct nameidata nd;
whoami->len = klen;
whoami->name = kname;
-/* err = user_path_walk(user_string, &nd); */
-/* if (!err) { */
-/* whoami->dentry = nd.dentry; */
-/* path_release(&nd); */
-/* } */
-/* return err; */
+#if (LINUX_VERSION_CODE <= 0x20403)
+ err = user_path_walk(user_path, &nd);
+ if (!err) {
+ CDEBUG(D_INFO, "found dentry for %s\n", kname);
+ whoami->dentry = nd.dentry;
+ path_release(&nd);
+ }
+ return err;
+#endif
return 0;
}
/* find the type */
nm = input->att_type;
type = obd_nm_to_type(nm);
-#ifdef CONFIG_KMOD
- if ( !type ) {
- if ( !request_module(nm) ) {
- CDEBUG(D_PSDEV, "Loaded module '%s'\n", nm);
- type = obd_nm_to_type(nm);
- } else {
- CDEBUG(D_PSDEV, "Can't load module '%s'\n", nm);
- }
- }
-#endif
OBD_FREE(input->att_type, input->att_typelen + 1);
if ( !type ) {
int setup_datalen;
void *setup_data;
} *setup;
+ char *user_path;
setup = tmp_buf;
EXIT;
return err;
}
-
+ user_path = setup->setup_data;
+
/* get the attach data */
err = getdata(setup->setup_datalen, &setup->setup_data);
if ( err ) {
err = obd_devicename_from_path(&(obddev->obd_fsname),
setup->setup_datalen,
- (char*) setup->setup_data);
+ (char*) setup->setup_data,
+ user_path);
if (err) {
memset(&(obddev->obd_fsname), 0, sizeof(obd_devicename));
EXIT;
--- /dev/null
+--- linux/fs/super.c.orig Sat Sep 29 09:40:16 2001
++++ linux/fs/super.c Sat Sep 29 09:40:42 2001
+@@ -695,7 +695,7 @@
+ * the request.
+ */
+
+-static struct super_block *get_empty_super(void)
++struct super_block *get_empty_super(void)
+ {
+ struct super_block *s;
+
+--- linux/include/linux/fs.h.orig Sat Sep 29 09:42:14 2001
++++ linux/include/linux/fs.h Sat Sep 29 09:42:55 2001
+@@ -1360,6 +1360,7 @@
+ extern struct file_system_type *get_fs_type(const char *name);
+ extern struct super_block *get_super(kdev_t);
+ extern void put_super(kdev_t);
++struct super_block *get_empty_super(void);
+ unsigned long generate_cluster(kdev_t, int b[], int);
+ unsigned long generate_cluster_swab32(kdev_t, int b[], int);
+ extern kdev_t ROOT_DEV;
+--- linux/kernel/ksyms.c.orig Sat Sep 29 09:40:56 2001
++++ linux/kernel/ksyms.c Sat Sep 29 09:41:17 2001
+@@ -142,6 +142,7 @@
+ EXPORT_SYMBOL(igrab);
+ EXPORT_SYMBOL(iunique);
+ EXPORT_SYMBOL(iget4);
++EXPORT_SYMBOL(get_empty_super);
+ EXPORT_SYMBOL(iput);
+ EXPORT_SYMBOL(force_delete);
+ EXPORT_SYMBOL(follow_up);