*
* @APPLE_LICENSE_HEADER_START@
*
- * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
+ * The contents of this file constitute Original Code as defined in and
+ * are subject to the Apple Public Source License Version 1.1 (the
+ * "License"). You may not use this file except in compliance with the
+ * License. Please obtain a copy of the License at
+ * http://www.apple.com/publicsource and read it before using this file.
*
- * This file contains Original Code and/or Modifications of Original Code
- * as defined in and that are subject to the Apple Public Source License
- * Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
- *
- * The Original Code and all software distributed under the License are
- * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * This Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
- * Please see the License for the specific language governing rights and
- * limitations under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
// desired_size, free_space(jnl));
while (1) {
- int old_start_empty;
-
if (counter++ == 5000) {
dump_journal(jnl);
panic("jnl: check_free_space: buffer flushing isn't working "
// here's where we lazily bump up jnl->jhdr->start. we'll consume
// entries until there is enough space for the next transaction.
//
- old_start_empty = 1;
simple_lock(&jnl->old_start_lock);
for(i=0; i < sizeof(jnl->old_start)/sizeof(jnl->old_start[0]); i++) {
int counter;
continue;
}
- old_start_empty = 0;
jnl->jhdr->start = jnl->old_start[i];
jnl->old_start[i] = 0;
if (free_space(jnl) > desired_size) {
// if we bumped the start, loop and try again
if (i < sizeof(jnl->old_start)/sizeof(jnl->old_start[0])) {
continue;
- } else if (old_start_empty) {
- //
- // if there is nothing in old_start anymore then we can
- // bump the jhdr->start to be the same as active_start
- // since it is possible there was only one very large
- // transaction in the old_start array. if we didn't do
- // this then jhdr->start would never get updated and we
- // would wind up looping until we hit the panic at the
- // start of the loop.
- //
- jnl->jhdr->start = jnl->active_start;
- write_journal_header(jnl);
- continue;
}