From: yury Date: Thu, 22 Jun 2006 14:42:00 +0000 (+0000) Subject: - various sequence manager proc related fixes. X-Git-Tag: v1_8_0_110~486^2~1575 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=fb913d2f51cecef68a2837a73a7b05faa1c4df7c;p=fs%2Flustre-release.git - various sequence manager proc related fixes. --- diff --git a/lustre/fid/lproc_fid.c b/lustre/fid/lproc_fid.c index 188cd67..93f2f2c 100644 --- a/lustre/fid/lproc_fid.c +++ b/lustre/fid/lproc_fid.c @@ -66,11 +66,11 @@ seq_proc_write_range(struct file *file, const char *buffer, if (rc != 2 || !range_is_sane(&tmp) || range_is_zero(&tmp)) { CERROR("can't parse input string or " "input is not correct\n"); - RETURN(count); + RETURN(-EINVAL); } *range = tmp; - RETURN(count); + RETURN(0); } static int @@ -92,17 +92,19 @@ seq_proc_write_space(struct file *file, const char *buffer, unsigned long count, void *data) { struct lu_server_seq *seq = (struct lu_server_seq *)data; + int rc; ENTRY; LASSERT(seq != NULL); down(&seq->seq_sem); - seq_proc_write_range(file, buffer, count, - data, &seq->seq_space); - - CDEBUG(D_WARNING, "SEQ-MGR(srv): sequences space is changed " - "to ["LPU64"-"LPU64"]\n", seq->seq_space.lr_start, - seq->seq_space.lr_end); + rc = seq_proc_write_range(file, buffer, count, + data, &seq->seq_space); + if (rc == 0) { + CDEBUG(D_WARNING, "SEQ-MGR(srv): sequences space has changed " + "to ["LPU64"-"LPU64"]\n", seq->seq_space.lr_start, + seq->seq_space.lr_end); + } up(&seq->seq_sem); @@ -132,17 +134,20 @@ seq_proc_write_super(struct file *file, const char *buffer, unsigned long count, void *data) { struct lu_server_seq *seq = (struct lu_server_seq *)data; + int rc; ENTRY; LASSERT(seq != NULL); down(&seq->seq_sem); - seq_proc_write_range(file, buffer, count, - data, &seq->seq_super); + rc = seq_proc_write_range(file, buffer, count, + data, &seq->seq_super); - CDEBUG(D_WARNING, "SEQ-MGR(srv): super-sequence is changed to " - "["LPU64"-"LPU64"]\n", seq->seq_super.lr_start, - seq->seq_super.lr_end); + if (rc == 0) { + CDEBUG(D_WARNING, "SEQ-MGR(srv): super-sequence has changed to " + "["LPU64"-"LPU64"]\n", seq->seq_super.lr_start, + seq->seq_super.lr_end); + } up(&seq->seq_sem); diff --git a/lustre/ptlrpc/ptlrpc_internal.h b/lustre/ptlrpc/ptlrpc_internal.h index dc780d7..b7da6dd 100644 --- a/lustre/ptlrpc/ptlrpc_internal.h +++ b/lustre/ptlrpc/ptlrpc_internal.h @@ -98,7 +98,8 @@ static inline int opcode_offset(__u32 opc) { (MDS_LAST_OPC - MDS_FIRST_OPC) + \ (OST_LAST_OPC - OST_FIRST_OPC) + \ (OBD_LAST_OPC - OBD_FIRST_OPC) + \ - (FLD_LAST_OPC - FLD_FIRST_OPC)) + (FLD_LAST_OPC - FLD_FIRST_OPC) + \ + (SEQ_LAST_OPC - SEQ_FIRST_OPC)) enum { PTLRPC_REQWAIT_CNTR = 0,