*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
*
* GPL HEADER END
*/
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2015, Intel Corporation.
+ * Copyright (c) 2011, 2017, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
#include <lustre_fid.h>
#include "fid_internal.h"
-static void seq_server_proc_fini(struct lu_server_seq *seq);
-
/* Assigns client to sequence controller node. */
int seq_server_set_cli(const struct lu_env *env, struct lu_server_seq *seq,
struct lu_client_seq *cli)
*
* when lss_lowater_set reaches the end it is replaced with hiwater one and
* a write operation is initiated to allocate new hiwater range.
- * if last seq write opearion is still not commited, current operation is
+ * if last seq write opearion is still not committed, current operation is
* flaged as sync write op.
*/
static int range_alloc_set(const struct lu_env *env,
rc = seq_server_check_and_alloc_super(env, seq);
if (rc < 0) {
- CERROR("%s: Allocated super-sequence failed: rc = %d\n",
- seq->lss_name, rc);
+ if (rc == -EINPROGRESS) {
+ static int printed;
+
+ if (printed++ % 8 == 0)
+ LCONSOLE_INFO("%s: Waiting to contact MDT0000 "
+ "to allocate super-sequence\n",
+ seq->lss_name);
+ } else {
+ CERROR("%s: Allocated super-sequence failed: rc = %d\n",
+ seq->lss_name, rc);
+ }
RETURN(rc);
}
{
int rc;
struct seq_server_site *ss_site;
+ struct dt_device *dev;
ENTRY;
ss_site = lu_site2seq(site);
"initialized\n");
RETURN(-EINVAL);
}
+
+ dev = lu2dt_dev(ss_site->ss_server_seq->lss_obj->do_lu.lo_dev);
+ if (dev->dd_rdonly)
+ RETURN(-EROFS);
+
rc = seq_server_alloc_meta(ss_site->ss_server_seq, out, env);
break;
case SEQ_ALLOC_SUPER:
"initialized\n");
RETURN(-EINVAL);
}
+
+ dev = lu2dt_dev(ss_site->ss_control_seq->lss_obj->do_lu.lo_dev);
+ if (dev->dd_rdonly)
+ RETURN(-EROFS);
+
rc = seq_server_alloc_super(ss_site->ss_control_seq, out, env);
break;
default:
}
struct tgt_handler seq_handlers[] = {
-TGT_SEQ_HDL(HABEO_REFERO, SEQ_QUERY, seq_handler),
+TGT_SEQ_HDL(HAS_REPLY, SEQ_QUERY, seq_handler),
};
EXPORT_SYMBOL(seq_handlers);
/* context key: seq_thread_key */
LU_CONTEXT_KEY_DEFINE(seq, LCT_MD_THREAD | LCT_DT_THREAD);
-extern const struct file_operations seq_fld_proc_seq_fops;
+static void seq_server_debugfs_fini(struct lu_server_seq *seq)
+{
+ if (!IS_ERR_OR_NULL(seq->lss_debugfs_entry))
+ ldebugfs_remove(&seq->lss_debugfs_entry);
+}
-static int seq_server_proc_init(struct lu_server_seq *seq)
+static int seq_server_debugfs_init(struct lu_server_seq *seq)
{
-#ifdef CONFIG_PROC_FS
int rc;
ENTRY;
- seq->lss_proc_dir = lprocfs_register(seq->lss_name,
- seq_type_proc_dir,
- NULL, NULL);
- if (IS_ERR(seq->lss_proc_dir)) {
- rc = PTR_ERR(seq->lss_proc_dir);
+ seq->lss_debugfs_entry = ldebugfs_register(seq->lss_name,
+ seq_debugfs_dir,
+ NULL, NULL);
+ if (IS_ERR_OR_NULL(seq->lss_debugfs_entry)) {
+ rc = seq->lss_debugfs_entry ? PTR_ERR(seq->lss_debugfs_entry)
+ : -ENOMEM;
+ seq->lss_debugfs_entry = NULL;
RETURN(rc);
}
- rc = lprocfs_add_vars(seq->lss_proc_dir, seq_server_proc_list, seq);
+ rc = ldebugfs_add_vars(seq->lss_debugfs_entry,
+ seq_server_debugfs_list, seq);
if (rc) {
- CERROR("%s: Can't init sequence manager "
- "proc, rc %d\n", seq->lss_name, rc);
+ CERROR("%s: Can't init sequence manager debugfs, rc %d\n",
+ seq->lss_name, rc);
GOTO(out_cleanup, rc);
}
if (seq->lss_type == LUSTRE_SEQ_CONTROLLER) {
- rc = lprocfs_seq_create(seq->lss_proc_dir, "fldb", 0644,
- &seq_fld_proc_seq_fops, seq);
+ rc = ldebugfs_seq_create(seq->lss_debugfs_entry, "fldb", 0644,
+ &seq_fld_debugfs_seq_fops, seq);
if (rc) {
- CERROR("%s: Can't create fldb for sequence manager "
- "proc: rc = %d\n", seq->lss_name, rc);
+ CERROR("%s: Can't create fldb for sequence manager debugfs: rc = %d\n",
+ seq->lss_name, rc);
GOTO(out_cleanup, rc);
}
}
RETURN(0);
out_cleanup:
- seq_server_proc_fini(seq);
+ seq_server_debugfs_fini(seq);
return rc;
-#else /* !CONFIG_PROC_FS */
- return 0;
-#endif /* CONFIG_PROC_FS */
-}
-
-static void seq_server_proc_fini(struct lu_server_seq *seq)
-{
-#ifdef CONFIG_PROC_FS
- ENTRY;
- if (seq->lss_proc_dir != NULL) {
- if (!IS_ERR(seq->lss_proc_dir))
- lprocfs_remove(&seq->lss_proc_dir);
- seq->lss_proc_dir = NULL;
- }
- EXIT;
-#endif /* CONFIG_PROC_FS */
}
int seq_server_init(const struct lu_env *env,
lu_seq_range_is_sane(&seq->lss_space));
}
- rc = seq_server_proc_init(seq);
+ rc = seq_server_debugfs_init(seq);
if (rc)
GOTO(out, rc);
{
ENTRY;
- seq_server_proc_fini(seq);
+ seq_server_debugfs_fini(seq);
seq_store_fini(seq, env);
EXIT;