-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
- * Copyright (C) 2001 Cluster File Systems, Inc. <braam@clusterfs.com>
- *
- * This file is part of Lustre, http://www.lustre.org.
- *
- * Lustre is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * Lustre is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Lustre; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * lustre VFS/process permission interface
- */
-
-#ifndef __LVFS_H__
-#define __LVFS_H__
+ /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ * Copyright (C) 2001 Cluster File Systems, Inc. <braam@clusterfs.com>
+ *
+ * This file is part of Lustre, http://www.lustre.org.
+ *
+ * Lustre is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * Lustre is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Lustre; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * lustre VFS/process permission interface
+ */
+
+ #ifndef __LVFS_H__
+ #define __LVFS_H__
#include <libcfs/kp30.h>
/* lvfs_common.c */
struct dentry *lvfs_fid2dentry(struct lvfs_run_ctxt *, __u64, __u32, __u64 ,void *data);
-int lvfs_open_llog(struct lvfs_run_ctxt*, __u64, struct dentry*, void *data);
void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx,
struct lvfs_ucred *cred);
return ctxt->cb_ops.l_fid2dentry(id, gen, gr, data);
}
-int lvfs_open_llog(struct lvfs_run_ctxt *ctxt, __u64 id,
- struct dentry *dentry, void *data)
-{
- if (ctxt->cb_ops.l_open_llog)
- return ctxt->cb_ops.l_open_llog(id, dentry, data);
- else
- return 0;
-}
EXPORT_SYMBOL(lvfs_fid2dentry);
-EXPORT_SYMBOL(lvfs_open_llog);
struct dentry *dentry;
int err = 0;
+
LASSERT(sbi);
obd->obd_fsops = fsfilt_get_ops(MT_STR(sbi->lsi_ldd));
return mgs_fid2dentry(&obd->u.mgs, &fid, NULL);
}
-static int mgs_lvfs_open_llog(__u64 id, struct dentry *dentry , void *data)
+static int mgs_open_llog(__u64 id, void *data, void *handle)
{
struct obd_device *obd = data;
+ struct mgs_update_llh *mul = handle;
+ struct llog_handle *lgh = &mul->mul_lgh;
+ struct dentry *dentry = lgh->lgh_file->f_dentry;
+ __u64 id = dentry->d_inode->i_ino;
struct mgs_obd *mgs = &obd->u.mgs;
struct mgs_open_llog *mollog, *n;
struct list_head *llog_list = &mgs->mgs_open_llogs;
list_add(&mollog->mol_list, &mgs->mgs_open_llogs);
spin_unlock(&mgs->mgs_llogs_lock);
+ lgh->
return 0;
}
rc = llog_create(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT),
llh_res, NULL, fsname, name);
if (rc == 0)
- llog_init_handle(*llh_res, LLOG_F_IS_PLAIN,
- &cfg_uuid);
+ llog_init_handle(mul->mul_llh, LLOG_F_IS_PLAIN, &cfg_uuid);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
RETURN(rc);
}
+int mgs_update_llog(struct obd_device *obd,
+ struct obd_ioctl_data *data)
+{
+ struct mgs_obd *mgs = &obd->u.mgs;
+ struct mgs_update_llh *mul;
+ char *name = data->ioc_inlbuf1;
+ char *fsname = data->ioc_inlbuf2;
+ int rc;
+
+ /*First phase: writing mds log */
+ logname = name;
+ data->ioc_inlbuf1 = logname;
+ data->ioc_inllen1 = strlen(data->ioc_inlbuf1) + 1;
+ data->ioc_inlbuf2 = fsname;
+ data->ioc_inllen2 = strlen(data->ioc_inlbuf2) + 1;
+
+ rc = mgs_clear_record(obd, data);
+ if (rc) {
+ CERROR("failed to clear log %s: %d\n", logname, rc);
+ RETURN(rc);
+ }
+
+ rc = mgs_start_record(obd, data);
+ if (rc) {
+ CERROR("failed to record log %s: %d\n", logname, rc);
+ RETURN(rc);
+ }
+ sprintf(lovuuid, "lov_%s_%s", fsname, name);
+
+}
+
int mgs_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
void *karg, void *uarg)
{
RETURN(rc);
}
+ case OBD_IOC_UPDATE_LOG: {
+ rc = mgs_update_llog(obd, data);
+ RETURN(rc);
+ }
case OBD_IOC_PARSE: {
struct llog_ctxt *ctxt =
llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT);