Skip to content

Commit

Permalink
Manually applied: Fix typos: super block -> superblock (#8974)
Browse files Browse the repository at this point in the history
by: Przemysław Buczkowski <przemub@yahoo.pl>
  • Loading branch information
mmadia committed Dec 9, 2012
1 parent 46cf7a5 commit 5644d28
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 105 deletions.
72 changes: 36 additions & 36 deletions src/add-ons/kernel/file_systems/ext2/Journal.cpp
Expand Up @@ -114,7 +114,7 @@ Journal::Journal(Volume* fsVolume, Volume* jVolume)
fInitStatus = B_NO_MEMORY;
else {
fInitStatus = revokeManager->Init();

if (fInitStatus == B_OK) {
fRevokeManager = revokeManager;
fInitStatus = _LoadSuperBlock();
Expand Down Expand Up @@ -270,7 +270,7 @@ Journal::Unlock(Transaction* owner, bool success)
{
TRACE("Journal::Unlock(): Lock recursion: %ld\n",
recursive_lock_get_recursion(&fLock));
if (fSeparateSubTransactions
if (fSeparateSubTransactions
|| recursive_lock_get_recursion(&fLock) == 1) {
// we only end the transaction if we unlock it
if (owner != NULL) {
Expand Down Expand Up @@ -309,7 +309,7 @@ Journal::MapBlock(off_t logical, fsblock_t& physical)
{
TRACE("Journal::MapBlock()\n");
physical = logical;

return B_OK;
}

Expand Down Expand Up @@ -340,7 +340,7 @@ Journal::TransactionID() const


status_t
Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock,
Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock,
bool detached, uint8** _escapedData, uint32 &logBlock, off_t& blockNumber,
long& cookie, ArrayDeleter<uint8>& escapedDataDeleter, uint32& blockCount,
bool& finished)
Expand All @@ -353,7 +353,7 @@ Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock,
JournalBlockTag* tag = (JournalBlockTag*)descriptorBlock->data;
JournalBlockTag* lastTag = (JournalBlockTag*)((uint8*)descriptorBlock
+ fBlockSize - sizeof(JournalHeader));

finished = false;
status_t status = B_OK;

Expand Down Expand Up @@ -430,11 +430,11 @@ Journal::_WritePartialTransactionToLog(JournalHeader* descriptorBlock,
}

finished = status != B_OK;

// Write descriptor block
--tag;
tag->SetLastTagFlag();

fsblock_t physicalBlock;
status = MapBlock(descriptorBlockPos, physicalBlock);
if (status != B_OK)
Expand Down Expand Up @@ -493,14 +493,14 @@ Journal::_WriteTransactionToLog()
if (size > FreeLogBlocks()) {
TRACE("Journal::_WriteTransactionToLog(): Syncing block cache\n");
cache_sync_transaction(fFilesystemBlockCache, fTransactionID);

if (size > FreeLogBlocks()) {
panic("Transaction fits, but sync didn't result in enough"
"free space.\n\tGot %ld when at least %ld was expected.",
FreeLogBlocks(), size);
}
}

TRACE("Journal::_WriteTransactionToLog(): finished managing space for "
"the transaction\n");

Expand All @@ -511,7 +511,7 @@ Journal::_WriteTransactionToLog()
// Prepare Descriptor block
TRACE("Journal::_WriteTransactionToLog(): attempting to allocate space for "
"the descriptor block, block size %lu\n", fBlockSize);
JournalHeader* descriptorBlock =
JournalHeader* descriptorBlock =
(JournalHeader*)new(std::nothrow) uint8[fBlockSize];
if (descriptorBlock == NULL) {
TRACE("Journal::_WriteTransactionToLog(): Failed to allocate a buffer "
Expand All @@ -525,7 +525,7 @@ Journal::_WriteTransactionToLog()
// Prepare Commit block
TRACE("Journal::_WriteTransactionToLog(): attempting to allocate space for "
"the commit block, block size %lu\n", fBlockSize);
JournalHeader* commitBlock =
JournalHeader* commitBlock =
(JournalHeader*)new(std::nothrow) uint8[fBlockSize];
if (descriptorBlock == NULL) {
TRACE("Journal::_WriteTransactionToLog(): Failed to allocate a buffer "
Expand Down Expand Up @@ -555,7 +555,7 @@ Journal::_WriteTransactionToLog()
uint32 blockCount = 0;

uint32 logBlock = _WrapAroundLog(fLogEnd);

bool finished = false;

status = _WritePartialTransactionToLog(descriptorBlock, detached,
Expand All @@ -574,10 +574,10 @@ Journal::_WriteTransactionToLog()
blockCount, finished);
if (!finished && status != B_OK)
return status;

// It is okay to write the commit blocks of the partial transactions
// as long as the commit block of the first partial transaction isn't
// written. When it recovery reaches where the first commit should be
// written. When it recovery reaches where the first commit should be
// and doesn't find it, it considers it found the end of the log.

fsblock_t physicalBlock;
Expand All @@ -586,7 +586,7 @@ Journal::_WriteTransactionToLog()
return status;

off_t logOffset = physicalBlock * fBlockSize;

TRACE("Journal::_WriteTransactionToLog(): Writting commit block to "
"%lld\n", logOffset);
off_t written = write_pos(fJournalVolume->Device(), logOffset,
Expand All @@ -598,7 +598,7 @@ Journal::_WriteTransactionToLog()

commitBlock->IncrementSequence();
blockCount++;

logBlock = _WrapAroundLog(logBlock + 1);
}

Expand All @@ -617,7 +617,7 @@ Journal::_WriteTransactionToLog()
TRACE("Failed to write journal commit block.\n");
return B_IO_ERROR;
}

blockCount++;
fLogEnd = _WrapAroundLog(fLogEnd + blockCount);

Expand Down Expand Up @@ -670,15 +670,15 @@ Journal::_SaveSuperBlock()
off_t superblockPos = physicalBlock * fBlockSize;

JournalSuperBlock superblock;
size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos,
size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos,
&superblock, sizeof(superblock));

if (bytesRead != sizeof(superblock))
return B_IO_ERROR;

superblock.SetFirstCommitID(fFirstCommitID);
superblock.SetLogStart(fLogStart);

TRACE("Journal::SaveSuperBlock(): Write to %lld\n", superblockPos);
size_t bytesWritten = write_pos(fJournalVolume->Device(), superblockPos,
&superblock, sizeof(superblock));
Expand All @@ -701,10 +701,10 @@ Journal::_LoadSuperBlock()
status_t status = MapBlock(0, superblockPos);
if (status != B_OK)
return status;
TRACE("Journal::_LoadSuperBlock(): super block physical block: %llu\n",

TRACE("Journal::_LoadSuperBlock(): superblock physical block: %llu\n",
superblockPos);

JournalSuperBlock superblock;
size_t bytesRead = read_pos(fJournalVolume->Device(), superblockPos
* fJournalVolume->BlockSize(), &superblock, sizeof(superblock));
Expand Down Expand Up @@ -803,7 +803,7 @@ Journal::_CountTags(JournalHeader* descriptorBlock)

if ((tags->Flags() & JOURNAL_FLAG_LAST_TAG) != 0)
count++;

TRACE("Journal::_CountTags(): counted tags: %lu\n", count);

return count;
Expand All @@ -824,7 +824,7 @@ Journal::Recover()
status_t status = _RecoverPassScan(lastCommitID);
if (status != B_OK)
return status;

status = _RecoverPassRevoke(lastCommitID);
if (status != B_OK)
return status;
Expand Down Expand Up @@ -978,7 +978,7 @@ Journal::_RecoverPassReplay(uint32 lastCommitID)
"data\n");
return B_NO_MEMORY;
}

ArrayDeleter<uint8> dataDeleter(data);

while (nextCommitID < lastCommitID) {
Expand All @@ -994,15 +994,15 @@ Journal::_RecoverPassReplay(uint32 lastCommitID)
JournalBlockTag* last_tag = (JournalBlockTag*)((uint8*)header
+ fBlockSize - sizeof(JournalBlockTag));

for (JournalBlockTag* tag = (JournalBlockTag*)header->data;
for (JournalBlockTag* tag = (JournalBlockTag*)header->data;
tag <= last_tag; ++tag) {
nextBlock = _WrapAroundLog(nextBlock + 1);

status = MapBlock(nextBlock, nextBlockPos);
if (status != B_OK)
return status;

if (!fRevokeManager->Lookup(tag->BlockNumber(),
if (!fRevokeManager->Lookup(tag->BlockNumber(),
nextCommitID)) {
// Block isn't revoked
size_t read = read_pos(fJournalVolume->Device(),
Expand Down Expand Up @@ -1111,7 +1111,7 @@ Journal::_FlushLog(bool canWait, bool flushBlocks)
TRACE("Journal::_FlushLog(): Finished. Releasing lock\n");

recursive_lock_unlock(&fLock);

TRACE("Journal::_FlushLog(): Done, final status: %s\n", strerror(status));
return status;
}
Expand Down Expand Up @@ -1160,9 +1160,9 @@ Journal::_FullTransactionSize() const

size_t count = cache_blocks_in_transaction(fFilesystemBlockCache,
fTransactionID);

TRACE("\tFull transaction size: %ld\n", count);

return count;
}

Expand All @@ -1174,9 +1174,9 @@ Journal::_MainTransactionSize() const

size_t count = cache_blocks_in_main_transaction(fFilesystemBlockCache,
fTransactionID);

TRACE("\tMain transaction size: %ld\n", count);

return count;
}

Expand All @@ -1200,7 +1200,7 @@ Journal::_TransactionDone(bool success)
TRACE("Journal::_TransactionDone(): returning B_OK\n");
return B_OK;
}

// If possible, delay flushing the transaction
uint32 size = _FullTransactionSize();
TRACE("Journal::_TransactionDone(): full transaction size: %lu, max "
Expand All @@ -1209,11 +1209,11 @@ Journal::_TransactionDone(bool success)
if (fMaxTransactionSize > 0 && size < fMaxTransactionSize) {
TRACE("Journal::_TransactionDone(): delaying flush of transaction "
"%ld\n", fTransactionID);

// Make sure the transaction fits in the log
if (size < FreeLogBlocks())
cache_sync_transaction(fFilesystemBlockCache, fTransactionID);

fUnwrittenTransactions++;
TRACE("Journal::_TransactionDone(): returning B_OK\n");
return B_OK;
Expand Down Expand Up @@ -1253,7 +1253,7 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void* _logEntry)
if (journal->_SaveSuperBlock() != B_OK)
panic("ext2: Failed to write journal superblock\n");
}

TRACE("Journal::_TransactionWritten(): Removing log entry\n");
journal->fLogEntries.Remove(logEntry);

Expand Down
24 changes: 12 additions & 12 deletions src/bin/bfs_tools/chkindex.cpp
Expand Up @@ -52,10 +52,10 @@ class BlockRunHashtable : public Hashtable
return false;

memcpy(value,&run,sizeof(block_run));

if (Hashtable::Put(value,value))
return true;

free(value);
return false;
}
Expand Down Expand Up @@ -133,7 +133,7 @@ collectFiles(Disk &disk)
return;
}
collectFiles(disk,root);

printf(" %7Ld files found.\n",gCount);

delete root;
Expand Down Expand Up @@ -201,7 +201,7 @@ checkFiles(Disk &disk,BPlusTree &tree,char *attribute)
{
runs[index++] = *run;
}

// sort array to speed up disk access
qsort(runs,index,sizeof(block_run),(int (*)(const void *,const void *))compareBlockRuns);

Expand All @@ -227,7 +227,7 @@ checkFiles(Disk &disk,BPlusTree &tree,char *attribute)
delete inode;
continue;
}

// check indices not based on standard attributes
if (sizeIndex)
{
Expand Down Expand Up @@ -422,7 +422,7 @@ main(int argc,char **argv)
printUsage(toolName);
return -1;
}

while (*++argv)
{
char *arg = *argv;
Expand All @@ -447,7 +447,7 @@ main(int argc,char **argv)
else
break;
}

char *attribute = argv[0];
if (!gCheckAll && attribute == NULL)
{
Expand Down Expand Up @@ -476,13 +476,13 @@ main(int argc,char **argv)
fprintf(stderr,"Could not open device or file \"%s\": %s\n",info.device_name,strerror(status));
return -1;
}

if (disk.ValidateSuperBlock() < B_OK)
{
fprintf(stderr,"The disk's super block is corrupt!\n");
fprintf(stderr,"The disk's superblock is corrupt!\n");
return -1;
}

Directory *indices = (Directory *)Inode::Factory(&disk,disk.Indices());
if (indices == NULL || (status = indices->InitCheck()) < B_OK)
{
Expand All @@ -497,7 +497,7 @@ main(int argc,char **argv)
delete indices;
return -1;
}

block_run run;

if (gCheckAll)
Expand All @@ -515,7 +515,7 @@ main(int argc,char **argv)
fprintf(stderr," Could not find index directory for \"%s\"!\n",attribute);

delete indices;

gHashtable.MakeEmpty(HASH_EMPTY_NONE,HASH_EMPTY_FREE);

return 0;
Expand Down

0 comments on commit 5644d28

Please sign in to comment.