/*
* Author: Brian Behlendorf <behlendorf1@llnl.gov>
*/
-
+#include "mount_utils.h"
#include <stdio.h>
#include <string.h>
-#include <libzfs/libzfs.h>
+#include <libzfs.h>
#include <dlfcn.h>
-#include "mount_utils.h"
-
/* Persistent mount data is stored in these user attributes */
#define LDD_VERSION_PROP "lustre:version"
#define LDD_FLAGS_PROP "lustre:flags"
ret = zfs_read_ldd(ds, &tmp_ldd);
if ((ret == 0) && (tmp_ldd.ldd_config_ver > 0) &&
- (strlen(tmp_ldd.ldd_fsname) > 0) &&
(strlen(tmp_ldd.ldd_svname) > 0)) {
*mount_type = tmp_ldd.ldd_mount_type;
return 1;
return 0;
}
+int zfs_tune_lustre(char *dev, struct mount_opts *mop)
+{
+ if (osd_check_zfs_setup() == 0)
+ return EINVAL;
+
+ return 0;
+}
+
+int zfs_label_lustre(struct mount_opts *mop)
+{
+ zfs_handle_t *zhp;
+ int ret;
+
+ if (osd_check_zfs_setup() == 0)
+ return EINVAL;
+
+ zhp = zfs_open(g_zfs, mop->mo_source, ZFS_TYPE_FILESYSTEM);
+ if (zhp == NULL)
+ return EINVAL;
+
+ ret = zfs_set_prop_str(zhp, LDD_SVNAME_PROP, mop->mo_ldd.ldd_svname);
+ zfs_close(zhp);
+
+ return ret;
+}
+
int zfs_init(void)
{
int ret = 0;