- cleanups and small fixes in FLD.
}
rc = lprocfs_add_vars(seq_type_proc_dir,
- seq_proc_list, seq);
+ seq_server_proc_list, seq);
if (rc) {
CERROR("can't init sequence manager "
"proc, rc %d\n", rc);
#define SEQ_SERVICE_WATCHDOG_TIMEOUT (obd_timeout * 1000)
#ifdef LPROCFS
-extern struct lprocfs_vars seq_proc_list[];
+extern struct lprocfs_vars seq_server_proc_list[];
+extern struct lprocfs_vars seq_client_proc_list[];
#endif
#endif
}
static int
+seq_proc_write_meta(struct file *file, const char *buffer,
+ unsigned long count, void *data)
+{
+ struct lu_client_seq *seq = (struct lu_client_seq *)data;
+ int rc;
+ ENTRY;
+
+ LASSERT(seq != NULL);
+
+ down(&seq->seq_sem);
+ rc = seq_proc_write_range(file, buffer, count,
+ data, &seq->seq_range);
+
+ if (rc == 0) {
+ CDEBUG(D_WARNING, "SEQ-MGR(cli): meta-sequence has changed to "
+ "["LPU64"-"LPU64"]\n", seq->seq_range.lr_start,
+ seq->seq_range.lr_end);
+ }
+
+ up(&seq->seq_sem);
+
+ RETURN(count);
+}
+
+static int
+seq_proc_read_meta(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ struct lu_client_seq *seq = (struct lu_client_seq *)data;
+ int rc;
+ ENTRY;
+
+ LASSERT(seq != NULL);
+
+ down(&seq->seq_sem);
+ rc = seq_proc_read_range(page, start, off, count, eof,
+ data, &seq->seq_range);
+ up(&seq->seq_sem);
+
+ RETURN(rc);
+}
+
+static int
seq_proc_read_controller(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
RETURN(rc);
}
-struct lprocfs_vars seq_proc_list[] = {
+struct lprocfs_vars seq_server_proc_list[] = {
{ "space", seq_proc_read_space, seq_proc_write_space, NULL },
{ "super", seq_proc_read_super, seq_proc_write_super, NULL },
{ "controller", seq_proc_read_controller, NULL, NULL },
{ NULL }};
+
+struct lprocfs_vars seq_client_proc_list[] = {
+ { "meta", seq_proc_read_meta, seq_proc_write_meta, NULL },
+ { NULL }};
#endif
dt->dd_ops->dt_trans_stop(ctx, th);
RETURN(rc);
- /* XXX: stub until IAM is ready */
- return 0;
}
int fld_index_handle_delete(struct lu_server_fld *fld,
dt->dd_ops->dt_trans_stop(ctx, th);
RETURN(rc);
- /* XXX: stub until IAM is ready */
- return 0;
}
int fld_index_handle_lookup(struct lu_server_fld *fld,
if (rc == 0)
*mds = be64_to_cpu(*(__u64 *)rec);
RETURN(rc);
- /* XXX: stub until IAM is ready */
- *mds = 0;
- return 0;
}
int fld_index_init(struct lu_server_fld *fld,
md_fld.mf_mds = mds;
rc = fld_client_rpc(fld_exp, &md_fld, FLD_CREATE);
+
#ifdef __KERNEL__
- fld_cache_insert(fld_cache, seq, mds);
+ if (rc == 0)
+ rc = fld_cache_insert(fld_cache, seq, mds);
#endif
RETURN(rc);
int
fld_client_delete(struct lu_client_fld *fld,
- __u64 seq, mdsno_t mds)
+ __u64 seq)
{
struct obd_export *fld_exp;
struct md_fld md_fld;
RETURN(-EINVAL);
md_fld.mf_seq = seq;
- md_fld.mf_mds = mds;
+ md_fld.mf_mds = 0;
rc = fld_client_rpc(fld_exp, &md_fld, FLD_DELETE);
RETURN(rc);
RETURN(rc);
#ifdef __KERNEL__
- rc = fld_cache_insert(fld_cache, seq, *mds);
+ if (rc == 0)
+ rc = fld_cache_insert(fld_cache, seq, *mds);
#endif
RETURN(rc);
void fld_client_fini(struct lu_client_fld *fld);
-int fld_client_add_export(struct lu_client_fld *fld,
- struct obd_export *exp);
-
-int fld_client_del_export(struct lu_client_fld *fld,
- struct obd_export *exp);
+int fld_client_lookup(struct lu_client_fld *fld,
+ __u64 seq, mdsno_t *mds);
int fld_client_create(struct lu_client_fld *fld,
__u64 seq, mdsno_t mds);
int fld_client_delete(struct lu_client_fld *fld,
- __u64 seq, mdsno_t mds);
+ __u64 seq);
-int fld_client_lookup(struct lu_client_fld *fld,
- __u64 seq, mdsno_t *mds);
+int fld_client_add_export(struct lu_client_fld *fld,
+ struct obd_export *exp);
+
+int fld_client_del_export(struct lu_client_fld *fld,
+ struct obd_export *exp);
#endif
fid_seq(fid), rc);
RETURN(rc);
}
- CDEBUG(D_WARNING, "LMV: got MDS %u for sequence: "LPU64"\n",
+ CDEBUG(D_WARNING, "LMV: got MDS "LPU64" for sequence: "LPU64"\n",
mds, fid_seq(fid));
if (mds >= lmv->desc.ld_tgt_count) {
- CERROR("Got invalid mdsno: %u (max: %d)\n",
+ CERROR("Got invalid mdsno: "LPU64" (max: %d)\n",
mds, lmv->desc.ld_tgt_count);
mds = (__u64)-EINVAL;
}