used to write mountdata to backend
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I8cb0275372f00f12f54461ce9afb243283aff4f3
Reviewed-on: http://review.whamcloud.com/3223
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Li Wei <liwei@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
#endif
/* Write our config files */
#endif
/* Write our config files */
- ret = write_local_files(&mop);
+ ret = osd_write_ldd(&mop);
if (ret != 0) {
fatal();
fprintf(stderr, "failed to write local files\n");
if (ret != 0) {
fatal();
fprintf(stderr, "failed to write local files\n");
+/* Write the server config files */
+int osd_write_ldd(struct mkfs_opts *mop)
+{
+ struct lustre_disk_data *ldd = &mop->mo_ldd;
+ int ret;
+
+ switch (ldd->ldd_mount_type) {
+ case LDD_MT_LDISKFS:
+ case LDD_MT_LDISKFS2:
+ ret = ldiskfs_write_ldd(mop);
+ break;
+ default:
+ fatal();
+ fprintf(stderr, "unknown fs type %d '%s'\n",
+ ldd->ldd_mount_type, MT_STR(ldd));
+ ret = EINVAL;
+ break;
+ }
+
+ return ret;
+}
+
/* Read the server config files */
int osd_read_ldd(char *dev, struct lustre_disk_data *ldd)
{
/* Read the server config files */
int osd_read_ldd(char *dev, struct lustre_disk_data *ldd)
{
int loop_cleanup(struct mkfs_opts *mop);
/* generic target support */
int loop_cleanup(struct mkfs_opts *mop);
/* generic target support */
+int osd_write_ldd(struct mkfs_opts *mop);
int osd_read_ldd(char *dev, struct lustre_disk_data *ldd);
int osd_is_lustre(char *dev, unsigned *mount_type);
int osd_make_lustre(struct mkfs_opts *mop);
int osd_read_ldd(char *dev, struct lustre_disk_data *ldd);
int osd_is_lustre(char *dev, unsigned *mount_type);
int osd_make_lustre(struct mkfs_opts *mop);
char *default_mountopts, int default_len,
char *always_mountopts, int always_len);
char *default_mountopts, int default_len,
char *always_mountopts, int always_len);
+int ldiskfs_write_ldd(struct mkfs_opts *mop);
int ldiskfs_read_ldd(char *dev, struct lustre_disk_data *ldd);
int ldiskfs_is_lustre(char *dev, unsigned *mount_type);
int ldiskfs_make_lustre(struct mkfs_opts *mop);
int ldiskfs_read_ldd(char *dev, struct lustre_disk_data *ldd);
int ldiskfs_is_lustre(char *dev, unsigned *mount_type);
int ldiskfs_make_lustre(struct mkfs_opts *mop);
#define EXT3_DIRENT_SIZE DUMMY_FILE_NAME_LEN
/* Write the server config files */
#define EXT3_DIRENT_SIZE DUMMY_FILE_NAME_LEN
/* Write the server config files */
-int write_local_files(struct mkfs_opts *mop)
+int ldiskfs_write_ldd(struct mkfs_opts *mop)
{
char mntpt[] = "/tmp/mntXXXXXX";
char filepnm[128];
{
char mntpt[] = "/tmp/mntXXXXXX";
char filepnm[128];