• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/fs/hfsplus_journal/

Lines Matching refs:journal

2 * HFSPlus journal implementation Tathagata Das 2010
128 printk(KERN_ERR "HFS+-fs: %s() unable to get journal write access\n", err_fn);
165 hfsplus_jbd_t *journal;
171 journal = HFSPLUS_SB(sb).jnl.s_journal;
173 ret = hfsplus_jbd_force_commit(journal);
179 hfsplus_jbd_t *journal = HFSPLUS_SB(sb).jnl.s_journal;
182 if ((hfsplus_handle->journaled != HFSPLUS_JOURNAL_PRESENT) || (journal == NULL)) {
188 if (is_hfsplus_jbd_aborted(journal)) {
189 hfsplus_abort(sb, __FUNCTION__, "Detected aborted journal");
195 hfsplus_handle->handle = hfsplus_jbd_start(journal, HFSPLUS_SB(sb).jnl.journal_maxblock, hfsplus_handle);
197 printk(KERN_ERR "HFS+fs: journal cannot be started from %s. Error number: %ld\n", err_fn, PTR_ERR(hfsplus_handle->handle));
213 /* Fill in the initial static fields in the new journal superblock */
214 static int hfsplus_journal_superblock_init(hfsplus_jbd_t *journal, int start)
221 if (journal->j_superblock == NULL)
224 jsb = journal->j_superblock;
231 dprint(DBG_JOURNAL, "HFS+-fs: Zeroing out journal blocks...\n");
232 for (i = start; i < journal->j_maxlen; i++) {
234 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize);
237 memset(bh->b_data + HFSPLUS_SECTOR_SIZE, 0, journal->j_blocksize - HFSPLUS_SECTOR_SIZE);
239 memset(bh->b_data, 0, journal->j_blocksize);
246 sync_blockdev(journal->j_dev);
247 dprint(DBG_JOURNAL, "HFS+-fs: journal cleared.\n");
252 jsb->s_blocksize = cpu_to_be32(journal->j_blocksize);
253 jsb->s_maxlen = cpu_to_be32(journal->j_maxlen);
254 jsb->s_first = cpu_to_be32(start+1); /* First block is for Mac's journal header and JBD superblock */
256 journal->j_transaction_sequence = 1;
258 journal->j_flags &= ~JFS_ABORT;
259 journal->j_format_version = 2;
261 /* Update journal superblock on disk and wait for the IO to complete.*/
262 hfsplus_jbd_update_superblock(journal, 1);
271 hfsplus_jbd_t *journal = NULL;
281 journal = hfsplus_jbd_init_dev(sb->s_bdev, sb->s_bdev, start, len, blocksize);
283 if (journal) {
284 dprint(DBG_JOURNAL, "HFS+-fs: Able to create device journal\n");
285 journal->j_private = sb;
286 ll_rw_block(READ, 1, &journal->j_sb_buffer);
287 wait_on_buffer(journal->j_sb_buffer);
288 if (!buffer_uptodate(journal->j_sb_buffer)) {
289 printk(KERN_ERR "HFS+-fs: I/O error on journal device\n");
293 /* Initialize journal superblock for the first time.
296 if (hfsplus_journal_superblock_init(journal, start) == HFSPLUS_JOURNAL_SUCCESS) {
297 dprint(DBG_JOURNAL, "HFS+-fs: success in initializeing journal superblock.\n");
299 printk(KERN_ERR "HFS+-fs: error in initializeing journal superblock.\n");
304 return journal;
307 hfsplus_jbd_destroy(journal);
438 void hfsplus_jhdr_checksum_calculate(hfsplus_jbd_t *journal)
440 struct hfsplus_journal_header *jh = &(journal->j_superblock->mac_jh);
446 void hfsplus_journal_header_start_update(hfsplus_jbd_t *journal, unsigned long freed)
448 struct super_block *sb = journal->j_private;
449 hfsplus_jbd_superblock_t *jsb = journal->j_superblock;
454 jh->start, HFSPLUS_SB(sb).jnl.jh_offset, mac_jh_start_blocknum, freed, journal->j_last, journal->j_first);
455 if ((mac_jh_start_blocknum + freed) < journal->j_last) {
459 jh->start = (journal->j_first + (freed - (journal->j_last - mac_jh_start_blocknum)))*sb->s_blocksize;
463 void inline hfsplus_journal_header_end_update(hfsplus_jbd_t *journal, struct hfsplus_journal_header *jh)
465 struct super_block *sb = journal->j_private;
467 jh->end = ((journal->j_head - journal->j_first) * sb->s_blocksize) + jh->blhdr_size;
470 void hfsplus_journal_mark_journal_empty(hfsplus_jbd_t *journal)
472 struct hfsplus_journal_header *jh = &(journal->j_superblock->mac_jh);
481 /* Write journal header during replay */
523 /* Create journal header, journal buffer and initialize them
524 * Assume that presence of journal is already verified
535 printk("HFS+-fs: journal size is not aligned\n");
540 printk("HFS+-fs: Error in mapping journal header\n");
546 /* Populate journal header and write it to the disk */
549 jhdr->start = sb->s_blocksize; /* First block is for journal header itself */
550 jhdr->end = sb->s_blocksize; /* Initially journal buffer is empty */
551 jhdr->size = 0x800000; /* Default size of journal log is 8MB */
553 jhdr->jhdr_size = sb->s_blocksize; /* Assign first block for journal header */
584 /* If the journal consists transaction then write them to disk.
683 /* Check tr_offset reaches at the end of journal buffer */
686 tr_offset = jnl->jh_offset + jh->jhdr_size; /* Set to the beginning of journal buffer */
704 printk("HFS+-fs: %s Error in journal replay\n", __func__);
745 /* Check consistency of journal log file in hfsplus volume
768 printk("HFS+-fs: Unable to access the journal.\n");
773 * Mark inconsistent if the journal is still not created yet
776 printk("HFS+-fs: Error, journal is not created\n");
797 /* Verify the journal header */
805 printk("HFS+-fs: Error in journal header checksum checksum: %x, org_checksum: %x\n", checksum, org_checksum);
819 /* Replay journal and bring the file system in consistent state */
831 /* Check journal present or not and initialize hfsplus_journal accordingly
850 /* Check the journal info block to find the block # of the journal */
871 printk("HFS+-fs: Fail to create journal\n");
876 /* Check already initialize in journal create */
898 /* Deinitialize journal if it is present */