#include "lfs_project.h"
#include <lustre/lustreapi.h>
+const char *progname;
+
struct lfs_project_item {
struct list_head lpi_list;
- char lpi_pathname[PATH_MAX];
+ char *lpi_pathname;
};
static int
return -ENOMEM;
}
- strncpy(lpi->lpi_pathname, pathname, sizeof(lpi->lpi_pathname) - 1);
- list_add_tail(&lpi->lpi_list, head);
+ lpi->lpi_pathname = strdup(pathname);
+ if (!lpi->lpi_pathname) {
+ free(lpi);
+ return -ENOMEM;
+ } else
+ list_add_tail(&lpi->lpi_list, head);
return 0;
}
phc, func);
if (!ret && rc)
ret = rc;
+ free(lpi->lpi_pathname);
free(lpi);
}
static int erase_param(const char *const buf, const char *const param,
bool withval)
{
- char search[PARAM_MAX + 1] = "";
+ char search[PARAM_MAX + 8] = "";
char *buffer = (char *)buf;
bool found = false;
void *dl_handle;
};
-struct module_backfs_ops zfs_ops;
-struct module_backfs_ops ldiskfs_ops;
+extern struct module_backfs_ops zfs_ops;
+extern struct module_backfs_ops ldiskfs_ops;
struct module_backfs_ops *load_backfs_module(enum ldd_mount_type mount_type);
void unload_backfs_ops(struct module_backfs_ops *ops);