Whamcloud - gitweb
- improved seq ranges debug messages, fixes in comments.
authoryury <yury>
Fri, 6 Oct 2006 07:34:01 +0000 (07:34 +0000)
committeryury <yury>
Fri, 6 Oct 2006 07:34:01 +0000 (07:34 +0000)
lustre/fid/fid_handler.c
lustre/fid/fid_request.c
lustre/fid/fid_store.c

index 391a7d1..117cab3 100644 (file)
@@ -74,15 +74,19 @@ int seq_server_set_cli(struct lu_server_seq *seq,
                "sequence client %s\n", seq->lss_name,
                cli->lcs_name);
 
-        /* asking client for new range, assign that range to ->seq_super and
-         * write seq state to backing store should be atomic. */
+        /*
+         * Asking client for new range, assign that range to ->seq_super and
+         * write seq state to backing store should be atomic.
+         */
         down(&seq->lss_sem);
 
-        /* assign controller */
+        /* Assign controller */
         seq->lss_cli = cli;
 
-        /* get new range from controller only if super-sequence is not yet
-         * initialized from backing store or something else. */
+        /*
+         * Get new range from controller only if super-sequence is not yet
+         * initialized from backing store or something else.
+         */
         if (range_is_zero(&seq->lss_super)) {
                 rc = seq_client_alloc_super(cli, env);
                 if (rc) {
@@ -110,8 +114,9 @@ int seq_server_set_cli(struct lu_server_seq *seq,
 }
 EXPORT_SYMBOL(seq_server_set_cli);
 
-/* on controller node, allocate new super sequence for regular sequence
- * server. */
+/*
+ * On controller node, allocate new super sequence for regular sequence server.
+ */
 static int __seq_server_alloc_super(struct lu_server_seq *seq,
                                     struct lu_range *in,
                                     struct lu_range *out,
index 8caec85..f36872c 100644 (file)
@@ -210,6 +210,9 @@ static int __seq_client_alloc_seq(struct lu_client_seq *seq, seqno_t *seqnr)
                         CERROR("%s: Can't allocate new meta-sequence, "
                                "rc %d\n", seq->lcs_name, rc);
                         RETURN(rc);
+                } else {
+                        CDEBUG(D_INFO|D_WARNING, "%s: New range - "DRANGE"\n",
+                               seq->lcs_name, &seq->lcs_range);
                 }
         }
 
@@ -266,6 +269,9 @@ int seq_client_alloc_fid(struct lu_client_seq *seq, struct lu_fid *fid)
                 /* inform caller that sequence switch is performed to allow it
                  * to setup FLD for it. */
                 rc = 1;
+
+                CDEBUG(D_INFO|D_WARNING, "%s: New sequence - "LPX64"\n",
+                       seq->lcs_name, seqnr);
         } else {
                 seq->lcs_fid.f_oid++;
                 rc = 0;
index 0e89a8a..8ad592d 100644 (file)
@@ -91,14 +91,11 @@ int seq_store_write(struct lu_server_seq *seq,
                                                     seq_record_buf(info),
                                                     &pos, th, BYPASS_CAPA);
                 if (rc == sizeof(info->sti_record)) {
-                        if (seq->lss_type == LUSTRE_SEQ_SERVER) {
-                                CDEBUG(D_INFO|D_WARNING, "%s: Pool - "DRANGE"\n",
-                                       seq->lss_name, PRANGE(&seq->lss_super));
-                        } else {
-                                CDEBUG(D_INFO|D_WARNING, "%s: Space - "DRANGE
-                                       ", Pool - "DRANGE"\n", seq->lss_name,
-                                       PRANGE(&seq->lss_space), PRANGE(&seq->lss_super));
-                        }
+                        struct lu_range *r = (seq->lss_type == LUSTRE_SEQ_SERVER ?
+                                              &seq->lss_super : &seq->lss_space);
+                        
+                        CDEBUG(D_INFO|D_WARNING, "%s: Space - "DRANGE"\n",
+                               seq->lss_name, PRANGE(r));
                         rc = 0;
                 } else if (rc >= 0) {
                         rc = -EIO;
@@ -131,17 +128,14 @@ int seq_store_read(struct lu_server_seq *seq,
                                            BYPASS_CAPA);
 
         if (rc == sizeof(info->sti_record)) {
+                struct lu_range *r = (seq->lss_type == LUSTRE_SEQ_SERVER ?
+                                      &seq->lss_super : &seq->lss_space);
+                
                 range_le_to_cpu(&seq->lss_space, &info->sti_record.ssr_space);
                 range_le_to_cpu(&seq->lss_super, &info->sti_record.ssr_super);
 
-                if (seq->lss_type == LUSTRE_SEQ_SERVER) {
-                        CDEBUG(D_INFO|D_WARNING, "%s: Pool - "DRANGE"\n",
-                               seq->lss_name, PRANGE(&seq->lss_super));
-                } else {
-                        CDEBUG(D_INFO|D_WARNING, "%s: Space - "DRANGE", Pool - "
-                               DRANGE"\n", seq->lss_name, PRANGE(&seq->lss_space),
-                               PRANGE(&seq->lss_super));
-                }
+                CDEBUG(D_INFO|D_WARNING, "%s: Space - "DRANGE"\n",
+                       seq->lss_name, PRANGE(r));
                 rc = 0;
         } else if (rc == 0) {
                 rc = -ENODATA;