Whamcloud - gitweb
- various sequence manager proc related fixes.
authoryury <yury>
Thu, 22 Jun 2006 14:42:00 +0000 (14:42 +0000)
committeryury <yury>
Thu, 22 Jun 2006 14:42:00 +0000 (14:42 +0000)
lustre/fid/lproc_fid.c
lustre/ptlrpc/ptlrpc_internal.h

index 188cd67..93f2f2c 100644 (file)
@@ -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);
        
index dc780d7..b7da6dd 100644 (file)
@@ -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,