Whamcloud - gitweb
Land b_head_quota onto HEAD (20081116_0105)
[fs/lustre-release.git] / lustre / obdclass / llog.c
index de2b350..4c63f6f 100644 (file)
@@ -16,8 +16,8 @@
  * in the LICENSE file that accompanied this code).
  *
  * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see [sun.com URL with a
- * copy of GPLv2].
+ * 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
@@ -100,17 +100,17 @@ int llog_cancel_rec(struct llog_handle *loghandle, int index)
         int rc = 0;
         ENTRY;
 
-        CDEBUG(D_RPCTRACE, "canceling %d in log "LPX64"\n",
+        CDEBUG(D_RPCTRACE, "Canceling %d in log "LPX64"\n",
                index, loghandle->lgh_id.lgl_oid);
 
         if (index == 0) {
-                CERROR("cannot cancel index 0 (which is header)\n");
+                CERROR("Can't cancel index 0 which is header\n");
                 RETURN(-EINVAL);
         }
 
         if (!ext2_clear_bit(index, llh->llh_bitmap)) {
-                CDEBUG(D_RPCTRACE, "catalog index %u already clear?\n", index);
-                RETURN(-EINVAL);
+                CDEBUG(D_RPCTRACE, "Catalog index %u already clear?\n", index);
+                RETURN(-ENOENT);
         }
 
         llh->llh_count--;
@@ -120,7 +120,7 @@ int llog_cancel_rec(struct llog_handle *loghandle, int index)
             (loghandle->lgh_last_idx == (LLOG_BITMAP_BYTES * 8) - 1)) {
                 rc = llog_destroy(loghandle);
                 if (rc) {
-                        CERROR("failure destroying log after last cancel: %d\n",
+                        CERROR("Failure destroying log after last cancel: %d\n",
                                rc);
                         ext2_set_bit(index, llh->llh_bitmap);
                         llh->llh_count++;
@@ -132,7 +132,7 @@ int llog_cancel_rec(struct llog_handle *loghandle, int index)
 
         rc = llog_write_rec(loghandle, &llh->llh_hdr, NULL, 0, NULL, 0);
         if (rc) {
-                CERROR("failure re-writing header %d\n", rc);
+                CERROR("Failure re-writing header %d\n", rc);
                 ext2_set_bit(index, llh->llh_bitmap);
                 llh->llh_count++;
         }
@@ -245,11 +245,11 @@ static int llog_process_thread(void *arg)
         cfs_daemonize_ctxt("llog_process_thread");
 
         if (cd != NULL) {
-                last_called_index = cd->first_idx;
-                index = cd->first_idx + 1;
+                last_called_index = cd->lpcd_first_idx;
+                index = cd->lpcd_first_idx + 1;
         }
-        if (cd != NULL && cd->last_idx)
-                last_index = cd->last_idx;
+        if (cd != NULL && cd->lpcd_last_idx)
+                last_index = cd->lpcd_last_idx;
         else
                 last_index = LLOG_BITMAP_BYTES * 8 - 1;
 
@@ -348,7 +348,7 @@ static int llog_process_thread(void *arg)
 
  out:
         if (cd != NULL)
-                cd->last_idx = last_called_index;
+                cd->lpcd_last_idx = last_called_index;
         if (buf)
                 OBD_FREE(buf, LLOG_CHUNK_SIZE);
         lpi->lpi_rc = rc;
@@ -415,9 +415,9 @@ int llog_reverse_process(struct llog_handle *loghandle, llog_cb_t cb,
                 RETURN(-ENOMEM);
 
         if (cd != NULL)
-                first_index = cd->first_idx + 1;
-        if (cd != NULL && cd->last_idx)
-                index = cd->last_idx;
+                first_index = cd->lpcd_first_idx + 1;
+        if (cd != NULL && cd->lpcd_last_idx)
+                index = cd->lpcd_last_idx;
         else
                 index = LLOG_BITMAP_BYTES * 8 - 1;