#include <linux/slab.h>
#include <linux/loop.h>
#include <linux/errno.h>
+#include <linux/lustre_idl.h>
#include "smfs_internal.h"
/* Find the options for the clone. These consist of a cache device
and an index in the snaptable associated with that device.
*/
-static char *smfs_options(char *options, char **devstr, char **namestr)
+static char *smfs_options(char *options, char **devstr, char **namestr, int *kml)
{
struct option *opt_value = NULL;
char *pos;
} else if (!strcmp(opt_value->opt, "type")) {
if (namestr != NULL)
*namestr = opt_value->value;
+ } else if (!strcmp(opt_value->opt, "kml")) {
+ *kml = 1;
} else {
break;
}
}
return pos;
}
-static int close_fd(int fd)
-{
- struct files_struct *files = current->files;
-
- write_lock(&files->file_lock);
-
- files->fd[fd] = NULL;
- __put_unused_fd(files, fd);
-
- write_unlock(&files->file_lock);
- return 0;
-}
+
static int set_loop_fd(char *dev_path, char *loop_dev)
{
struct loop_info loopinfo;
memcpy(name, dev_path, strlen(dev_path) + 1);
RETURN(name);
}
-static void duplicate_sb(struct super_block *csb,
+void duplicate_sb(struct super_block *csb,
struct super_block *sb)
{
sb->s_blocksize = csb->s_blocksize;
free_page(page);
if (IS_ERR(mnt)) {
- CERROR("do_kern_mount failed: rc = %d\n", PTR_ERR(mnt));
+ CERROR("do_kern_mount failed: rc = %ld\n", PTR_ERR(mnt));
GOTO(err_out, err = PTR_ERR(mnt));
}
smb = S2SMI(sb);
char *devstr = NULL, *typestr = NULL;
char *cache_data;
ino_t root_ino;
- int err = 0;
+ int err = 0, kml = 0;
ENTRY;
init_option(data);
/* read and validate options */
- cache_data = smfs_options(data, &devstr, &typestr);
+ cache_data = smfs_options(data, &devstr, &typestr, &kml);
if (*cache_data) {
CERROR("invalid mount option %s\n", (char*)data);
GOTO(out_err, err=-EINVAL);
CERROR("Can not mount %s as %s\n", devstr, typestr);
GOTO(out_err, 0);
}
+
+ if (kml) smfs_kml_init(sb);
+
+ setup_sm_journal_ops(typestr);
+
dget(S2CSB(sb)->s_root);
root_ino = S2CSB(sb)->s_root->d_inode->i_ino;
root_inode = iget(sb, root_ino);