• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/jbd/

Lines Matching refs:journal

2  * linux/fs/jbd/journal.c
12 * Generic filesystem journal-writing code; part of the ext2fs
19 * We do not actually manage the physical storage of the journal in this
20 * file: that is left to a per-journal policy function, which allows us
21 * to store the journal within a filesystem-specified area for ext2
83 static void __journal_abort_soft (journal_t *journal, int errno);
98 * journal.
103 * filesystem to disk. The journal thread is responsible for writing
114 journal_t *journal = arg;
121 setup_timer(&journal->j_commit_timer, commit_timeout,
124 /* Record that the journal thread is running */
125 journal->j_task = current;
126 wake_up(&journal->j_wait_done_commit);
129 journal->j_commit_interval / HZ);
134 spin_lock(&journal->j_state_lock);
137 if (journal->j_flags & JFS_UNMOUNT)
141 journal->j_commit_sequence, journal->j_commit_request);
143 if (journal->j_commit_sequence != journal->j_commit_request) {
145 spin_unlock(&journal->j_state_lock);
146 del_timer_sync(&journal->j_commit_timer);
147 journal_commit_transaction(journal);
148 spin_lock(&journal->j_state_lock);
152 wake_up(&journal->j_wait_done_commit);
155 * The simpler the better. Flushing journal isn't a
160 spin_unlock(&journal->j_state_lock);
162 spin_lock(&journal->j_state_lock);
171 prepare_to_wait(&journal->j_wait_commit, &wait,
173 if (journal->j_commit_sequence != journal->j_commit_request)
175 transaction = journal->j_running_transaction;
179 if (journal->j_flags & JFS_UNMOUNT)
182 spin_unlock(&journal->j_state_lock);
184 spin_lock(&journal->j_state_lock);
186 finish_wait(&journal->j_wait_commit, &wait);
194 transaction = journal->j_running_transaction;
196 journal->j_commit_request = transaction->t_tid;
202 spin_unlock(&journal->j_state_lock);
203 del_timer_sync(&journal->j_commit_timer);
204 journal->j_task = NULL;
205 wake_up(&journal->j_wait_done_commit);
210 static int journal_start_thread(journal_t *journal)
214 t = kthread_run(kjournald, journal, "kjournald");
218 wait_event(journal->j_wait_done_commit, journal->j_task != NULL);
222 static void journal_kill_thread(journal_t *journal)
224 spin_lock(&journal->j_state_lock);
225 journal->j_flags |= JFS_UNMOUNT;
227 while (journal->j_task) {
228 wake_up(&journal->j_wait_commit);
229 spin_unlock(&journal->j_state_lock);
230 wait_event(journal->j_wait_done_commit,
231 journal->j_task == NULL);
232 spin_lock(&journal->j_state_lock);
234 spin_unlock(&journal->j_state_lock);
238 * journal_write_metadata_buffer: write a metadata buffer to the journal.
263 * We assume that the journal has already been locked in this function.
288 journal_t *journal = transaction->t_journal;
384 spin_lock(&journal->j_list_lock);
386 spin_unlock(&journal->j_list_lock);
396 * Allocation code for the journal file. Manage the space left in the
397 * journal, so that we can begin checkpointing when appropriate.
401 * __log_space_left: Return the number of free blocks left in the journal.
403 * Called with the journal already locked.
408 int __log_space_left(journal_t *journal)
410 int left = journal->j_free;
412 assert_spin_locked(&journal->j_state_lock);
432 int __log_start_commit(journal_t *journal, tid_t target)
437 if (!tid_geq(journal->j_commit_request, target)) {
443 journal->j_commit_request = target;
445 journal->j_commit_request,
446 journal->j_commit_sequence);
447 wake_up(&journal->j_wait_commit);
453 int log_start_commit(journal_t *journal, tid_t tid)
457 spin_lock(&journal->j_state_lock);
458 ret = __log_start_commit(journal, tid);
459 spin_unlock(&journal->j_state_lock);
473 int journal_force_commit_nested(journal_t *journal)
478 spin_lock(&journal->j_state_lock);
479 if (journal->j_running_transaction && !current->journal_info) {
480 transaction = journal->j_running_transaction;
481 __log_start_commit(journal, transaction->t_tid);
482 } else if (journal->j_committing_transaction)
483 transaction = journal->j_committing_transaction;
486 spin_unlock(&journal->j_state_lock);
491 spin_unlock(&journal->j_state_lock);
492 log_wait_commit(journal, tid);
501 int journal_start_commit(journal_t *journal, tid_t *ptid)
505 spin_lock(&journal->j_state_lock);
506 if (journal->j_running_transaction) {
507 tid_t tid = journal->j_running_transaction->t_tid;
509 __log_start_commit(journal, tid);
515 } else if (journal->j_committing_transaction) {
521 *ptid = journal->j_committing_transaction->t_tid;
524 spin_unlock(&journal->j_state_lock);
530 * The caller may not hold the journal lock.
532 int log_wait_commit(journal_t *journal, tid_t tid)
537 spin_lock(&journal->j_state_lock);
538 if (!tid_geq(journal->j_commit_request, tid)) {
541 __func__, journal->j_commit_request, tid);
543 spin_unlock(&journal->j_state_lock);
545 spin_lock(&journal->j_state_lock);
546 while (tid_gt(tid, journal->j_commit_sequence)) {
548 tid, journal->j_commit_sequence);
549 wake_up(&journal->j_wait_commit);
550 spin_unlock(&journal->j_state_lock);
551 wait_event(journal->j_wait_done_commit,
552 !tid_gt(tid, journal->j_commit_sequence));
553 spin_lock(&journal->j_state_lock);
555 spin_unlock(&journal->j_state_lock);
557 if (unlikely(is_journal_aborted(journal))) {
558 printk(KERN_EMERG "journal commit I/O error\n");
570 int journal_trans_will_send_data_barrier(journal_t *journal, tid_t tid)
575 if (!(journal->j_flags & JFS_BARRIER))
577 spin_lock(&journal->j_state_lock);
579 if (tid_geq(journal->j_commit_sequence, tid))
585 commit_trans = journal->j_committing_transaction;
591 spin_unlock(&journal->j_state_lock);
600 int journal_next_log_block(journal_t *journal, unsigned int *retp)
604 spin_lock(&journal->j_state_lock);
605 J_ASSERT(journal->j_free > 1);
607 blocknr = journal->j_head;
608 journal->j_head++;
609 journal->j_free--;
610 if (journal->j_head == journal->j_last)
611 journal->j_head = journal->j_first;
612 spin_unlock(&journal->j_state_lock);
613 return journal_bmap(journal, blocknr, retp);
617 * Conversion of logical to physical block numbers for the journal
619 * On external journals the journal blocks are identity-mapped, so
623 int journal_bmap(journal_t *journal, unsigned int blocknr,
629 if (journal->j_inode) {
630 ret = bmap(journal->j_inode, blocknr);
636 printk(KERN_ALERT "%s: journal block not found "
640 bdevname(journal->j_dev, b));
642 __journal_abort_soft(journal, err);
645 *retp = blocknr; /* +journal->j_blk_offset */
652 * the journal without copying their contents, but for journal
660 struct journal_head *journal_get_descriptor_buffer(journal_t *journal)
666 err = journal_next_log_block(journal, &blocknr);
671 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize);
675 memset(bh->b_data, 0, journal->j_blocksize);
683 * Management for journal control blocks: functions to create and
685 * journal blocks from disk. */
689 * journal structures from from scratch, or loaded them from disk. */
693 journal_t *journal;
696 journal = kzalloc(sizeof(*journal), GFP_KERNEL);
697 if (!journal)
700 init_waitqueue_head(&journal->j_wait_transaction_locked);
701 init_waitqueue_head(&journal->j_wait_logspace);
702 init_waitqueue_head(&journal->j_wait_done_commit);
703 init_waitqueue_head(&journal->j_wait_checkpoint);
704 init_waitqueue_head(&journal->j_wait_commit);
705 init_waitqueue_head(&journal->j_wait_updates);
706 mutex_init(&journal->j_barrier);
707 mutex_init(&journal->j_checkpoint_mutex);
708 spin_lock_init(&journal->j_revoke_lock);
709 spin_lock_init(&journal->j_list_lock);
710 spin_lock_init(&journal->j_state_lock);
712 journal->j_commit_interval = (HZ * JBD_DEFAULT_MAX_COMMIT_AGE);
714 /* The journal is marked for error until we succeed with recovery! */
715 journal->j_flags = JFS_ABORT;
718 err = journal_init_revoke(journal, JOURNAL_REVOKE_DEFAULT_HASH);
720 kfree(journal);
723 return journal;
730 * Create a journal structure assigned some fixed set of disk blocks to
731 * the journal. We don't actually touch those disk blocks yet, but we
733 * system where the journal blocks are.
738 * journal_t * journal_init_dev() - creates and initialises a journal structure
739 * @bdev: Block device on which to create the journal
740 * @fs_dev: Device which hold journalled filesystem for this journal.
741 * @start: Block nr Start of journal.
742 * @len: Length of the journal in blocks.
747 * journal_init_dev creates a journal which maps a fixed contiguous
755 journal_t *journal = journal_init_common();
759 if (!journal)
762 /* journal descriptor can store up to n blocks -bzzz */
763 journal->j_blocksize = blocksize;
764 n = journal->j_blocksize / sizeof(journal_block_tag_t);
765 journal->j_wbufsize = n;
766 journal->j_wbuf = kmalloc(n * sizeof(struct buffer_head*), GFP_KERNEL);
767 if (!journal->j_wbuf) {
772 journal->j_dev = bdev;
773 journal->j_fs_dev = fs_dev;
774 journal->j_blk_offset = start;
775 journal->j_maxlen = len;
777 bh = __getblk(journal->j_dev, start, journal->j_blocksize);
780 "%s: Cannot get buffer for journal superblock\n",
784 journal->j_sb_buffer = bh;
785 journal->j_superblock = (journal_superblock_t *)bh->b_data;
787 return journal;
789 kfree(journal->j_wbuf);
790 kfree(journal);
795 * journal_t * journal_init_inode () - creates a journal which maps to a inode.
796 * @inode: An inode to create the journal in
798 * journal_init_inode creates a journal which maps an on-disk inode as
799 * the journal. The inode must exist already, must support bmap() and
805 journal_t *journal = journal_init_common();
810 if (!journal)
813 journal->j_dev = journal->j_fs_dev = inode->i_sb->s_bdev;
814 journal->j_inode = inode;
816 "journal %p: inode %s/%ld, size %Ld, bits %d, blksize %ld\n",
817 journal, inode->i_sb->s_id, inode->i_ino,
821 journal->j_maxlen = inode->i_size >> inode->i_sb->s_blocksize_bits;
822 journal->j_blocksize = inode->i_sb->s_blocksize;
824 /* journal descriptor can store up to n blocks -bzzz */
825 n = journal->j_blocksize / sizeof(journal_block_tag_t);
826 journal->j_wbufsize = n;
827 journal->j_wbuf = kmalloc(n * sizeof(struct buffer_head*), GFP_KERNEL);
828 if (!journal->j_wbuf) {
834 err = journal_bmap(journal, 0, &blocknr);
837 printk(KERN_ERR "%s: Cannnot locate journal superblock\n",
842 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize);
845 "%s: Cannot get buffer for journal superblock\n",
849 journal->j_sb_buffer = bh;
850 journal->j_superblock = (journal_superblock_t *)bh->b_data;
852 return journal;
854 kfree(journal->j_wbuf);
855 kfree(journal);
860 * If the journal init or create aborts, we need to mark the journal
861 * superblock as being NULL to prevent the journal destroy from writing
864 static void journal_fail_superblock (journal_t *journal)
866 struct buffer_head *bh = journal->j_sb_buffer;
868 journal->j_sb_buffer = NULL;
874 * a journal, and after recovering an old journal to reset it for
878 static int journal_reset(journal_t *journal)
880 journal_superblock_t *sb = journal->j_superblock;
888 journal_fail_superblock(journal);
892 journal->j_first = first;
893 journal->j_last = last;
895 journal->j_head = first;
896 journal->j_tail = first;
897 journal->j_free = last - first;
899 journal->j_tail_sequence = journal->j_transaction_sequence;
900 journal->j_commit_sequence = journal->j_transaction_sequence - 1;
901 journal->j_commit_request = journal->j_commit_sequence;
903 journal->j_max_transaction_buffers = journal->j_maxlen / 4;
906 journal_update_superblock(journal, 1);
907 return journal_start_thread(journal);
911 * int journal_create() - Initialise the new journal file
912 * @journal: Journal to create. This structure must have been initialised
915 * use, create a new journal superblock and initialise all of the
916 * journal fields from scratch.
918 int journal_create(journal_t *journal)
925 if (journal->j_maxlen < JFS_MIN_JOURNAL_BLOCKS) {
927 journal->j_maxlen);
928 journal_fail_superblock(journal);
932 if (journal->j_inode == NULL) {
937 "%s: creation of journal on external device!\n",
942 /* Zero out the entire journal on disk. We cannot afford to
944 jbd_debug(1, "JBD: Zeroing out journal blocks...\n");
945 for (i = 0; i < journal->j_maxlen; i++) {
946 err = journal_bmap(journal, i, &blocknr);
949 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize);
951 memset (bh->b_data, 0, journal->j_blocksize);
960 sync_blockdev(journal->j_dev);
961 jbd_debug(1, "JBD: journal cleared.\n");
964 sb = journal->j_superblock;
969 sb->s_blocksize = cpu_to_be32(journal->j_blocksize);
970 sb->s_maxlen = cpu_to_be32(journal->j_maxlen);
973 journal->j_transaction_sequence = 1;
975 journal->j_flags &= ~JFS_ABORT;
976 journal->j_format_version = 2;
978 return journal_reset(journal);
982 * void journal_update_superblock() - Update journal sb on disk.
983 * @journal: The journal to update.
986 * Update a journal's dynamic superblock fields and write it to disk,
989 void journal_update_superblock(journal_t *journal, int wait)
991 journal_superblock_t *sb = journal->j_superblock;
992 struct buffer_head *bh = journal->j_sb_buffer;
1001 if (sb->s_start == 0 && journal->j_tail_sequence ==
1002 journal->j_transaction_sequence) {
1005 journal->j_tail, journal->j_tail_sequence,
1006 journal->j_errno);
1010 spin_lock(&journal->j_state_lock);
1012 journal->j_tail, journal->j_tail_sequence, journal->j_errno);
1014 sb->s_sequence = cpu_to_be32(journal->j_tail_sequence);
1015 sb->s_start = cpu_to_be32(journal->j_tail);
1016 sb->s_errno = cpu_to_be32(journal->j_errno);
1017 spin_unlock(&journal->j_state_lock);
1031 spin_lock(&journal->j_state_lock);
1033 journal->j_flags &= ~JFS_FLUSHED;
1035 journal->j_flags |= JFS_FLUSHED;
1036 spin_unlock(&journal->j_state_lock);
1040 * Read the superblock for a given journal, performing initial
1044 static int journal_get_superblock(journal_t *journal)
1050 bh = journal->j_sb_buffer;
1058 "JBD: IO error reading journal superblock\n");
1063 sb = journal->j_superblock;
1068 sb->s_blocksize != cpu_to_be32(journal->j_blocksize)) {
1069 printk(KERN_WARNING "JBD: no valid journal superblock found\n");
1075 journal->j_format_version = 1;
1078 journal->j_format_version = 2;
1085 if (be32_to_cpu(sb->s_maxlen) < journal->j_maxlen)
1086 journal->j_maxlen = be32_to_cpu(sb->s_maxlen);
1087 else if (be32_to_cpu(sb->s_maxlen) > journal->j_maxlen) {
1088 printk (KERN_WARNING "JBD: journal file too short\n");
1095 journal_fail_superblock(journal);
1100 * Load the on-disk journal superblock and read the key fields into the
1104 static int load_superblock(journal_t *journal)
1109 err = journal_get_superblock(journal);
1113 sb = journal->j_superblock;
1115 journal->j_tail_sequence = be32_to_cpu(sb->s_sequence);
1116 journal->j_tail = be32_to_cpu(sb->s_start);
1117 journal->j_first = be32_to_cpu(sb->s_first);
1118 journal->j_last = be32_to_cpu(sb->s_maxlen);
1119 journal->j_errno = be32_to_cpu(sb->s_errno);
1126 * int journal_load() - Read journal from disk.
1127 * @journal: Journal to act on.
1130 * a journal, read the journal from disk to initialise the in-memory
1133 int journal_load(journal_t *journal)
1138 err = load_superblock(journal);
1142 sb = journal->j_superblock;
1146 if (journal->j_format_version >= 2) {
1152 "JBD: Unrecognised features on journal\n");
1158 * data from the journal. */
1159 if (journal_recover(journal))
1162 /* OK, we've finished with the dynamic journal bits:
1165 if (journal_reset(journal))
1168 journal->j_flags &= ~JFS_ABORT;
1169 journal->j_flags |= JFS_LOADED;
1179 * @journal: Journal to act on.
1183 * Return <0 if we couldn't clean up the journal.
1185 int journal_destroy(journal_t *journal)
1191 journal_kill_thread(journal);
1194 if (journal->j_running_transaction)
1195 journal_commit_transaction(journal);
1200 spin_lock(&journal->j_list_lock);
1201 while (journal->j_checkpoint_transactions != NULL) {
1202 spin_unlock(&journal->j_list_lock);
1203 log_do_checkpoint(journal);
1204 spin_lock(&journal->j_list_lock);
1207 J_ASSERT(journal->j_running_transaction == NULL);
1208 J_ASSERT(journal->j_committing_transaction == NULL);
1209 J_ASSERT(journal->j_checkpoint_transactions == NULL);
1210 spin_unlock(&journal->j_list_lock);
1212 if (journal->j_sb_buffer) {
1213 if (!is_journal_aborted(journal)) {
1214 /* We can now mark the journal as empty. */
1215 journal->j_tail = 0;
1216 journal->j_tail_sequence =
1217 ++journal->j_transaction_sequence;
1218 journal_update_superblock(journal, 1);
1222 brelse(journal->j_sb_buffer);
1225 if (journal->j_inode)
1226 iput(journal->j_inode);
1227 if (journal->j_revoke)
1228 journal_destroy_revoke(journal);
1229 kfree(journal->j_wbuf);
1230 kfree(journal);
1238 * @journal: Journal to check.
1243 * Check whether the journal uses all of a given set of
1247 int journal_check_used_features (journal_t *journal, unsigned long compat,
1254 if (journal->j_format_version == 1)
1257 sb = journal->j_superblock;
1269 * @journal: Journal to check.
1275 * all of a given set of features on this journal. Return true
1278 int journal_check_available_features (journal_t *journal, unsigned long compat,
1288 if (journal->j_format_version != 2)
1300 * int journal_set_features () - Mark a given journal feature in the superblock
1301 * @journal: Journal to act on.
1306 * Mark a given journal feature as present on the
1311 int journal_set_features (journal_t *journal, unsigned long compat,
1316 if (journal_check_used_features(journal, compat, ro, incompat))
1319 if (!journal_check_available_features(journal, compat, ro, incompat))
1325 sb = journal->j_superblock;
1336 * int journal_update_format () - Update on-disk journal structure.
1337 * @journal: Journal to act on.
1339 * Given an initialised but unloaded journal struct, poke about in the
1342 int journal_update_format (journal_t *journal)
1347 err = journal_get_superblock(journal);
1351 sb = journal->j_superblock;
1357 return journal_convert_superblock_v1(journal, sb);
1364 static int journal_convert_superblock_v1(journal_t *journal,
1380 journal->j_format_version = 2;
1382 bh = journal->j_sb_buffer;
1391 * int journal_flush () - Flush journal
1392 * @journal: Journal to act on.
1394 * Flush all data for a given journal to disk and empty the journal.
1399 int journal_flush(journal_t *journal)
1405 spin_lock(&journal->j_state_lock);
1408 if (journal->j_running_transaction) {
1409 transaction = journal->j_running_transaction;
1410 __log_start_commit(journal, transaction->t_tid);
1411 } else if (journal->j_committing_transaction)
1412 transaction = journal->j_committing_transaction;
1418 spin_unlock(&journal->j_state_lock);
1419 log_wait_commit(journal, tid);
1421 spin_unlock(&journal->j_state_lock);
1425 spin_lock(&journal->j_list_lock);
1426 while (!err && journal->j_checkpoint_transactions != NULL) {
1427 spin_unlock(&journal->j_list_lock);
1428 mutex_lock(&journal->j_checkpoint_mutex);
1429 err = log_do_checkpoint(journal);
1430 mutex_unlock(&journal->j_checkpoint_mutex);
1431 spin_lock(&journal->j_list_lock);
1433 spin_unlock(&journal->j_list_lock);
1435 if (is_journal_aborted(journal))
1438 cleanup_journal_tail(journal);
1440 /* Finally, mark the journal as really needing no recovery.
1443 * commits of data to the journal will restore the current
1445 spin_lock(&journal->j_state_lock);
1446 old_tail = journal->j_tail;
1447 journal->j_tail = 0;
1448 spin_unlock(&journal->j_state_lock);
1449 journal_update_superblock(journal, 1);
1450 spin_lock(&journal->j_state_lock);
1451 journal->j_tail = old_tail;
1453 J_ASSERT(!journal->j_running_transaction);
1454 J_ASSERT(!journal->j_committing_transaction);
1455 J_ASSERT(!journal->j_checkpoint_transactions);
1456 J_ASSERT(journal->j_head == journal->j_tail);
1457 J_ASSERT(journal->j_tail_sequence == journal->j_transaction_sequence);
1458 spin_unlock(&journal->j_state_lock);
1463 * int journal_wipe() - Wipe journal contents
1464 * @journal: Journal to act on.
1467 * Wipe out all of the contents of a journal, safely. This will produce
1468 * a warning if the journal contains any valid recovery information.
1471 * If 'write' is non-zero, then we wipe out the journal on disk; otherwise
1475 int journal_wipe(journal_t *journal, int write)
1479 J_ASSERT (!(journal->j_flags & JFS_LOADED));
1481 err = load_superblock(journal);
1485 if (!journal->j_tail)
1488 printk (KERN_WARNING "JBD: %s recovery information on journal\n",
1491 err = journal_skip_recovery(journal);
1493 journal_update_superblock(journal, 1);
1501 * device this journal is present.
1504 static const char *journal_dev_name(journal_t *journal, char *buffer)
1508 if (journal->j_inode)
1509 bdev = journal->j_inode->i_sb->s_bdev;
1511 bdev = journal->j_dev;
1518 * for journal abort.
1525 * Quick version for internal journal use (doesn't lock the journal).
1527 * and don't attempt to make any other journal updates.
1529 static void __journal_abort_hard(journal_t *journal)
1534 if (journal->j_flags & JFS_ABORT)
1537 printk(KERN_ERR "Aborting journal on device %s.\n",
1538 journal_dev_name(journal, b));
1540 spin_lock(&journal->j_state_lock);
1541 journal->j_flags |= JFS_ABORT;
1542 transaction = journal->j_running_transaction;
1544 __log_start_commit(journal, transaction->t_tid);
1545 spin_unlock(&journal->j_state_lock);
1548 /* Soft abort: record the abort error status in the journal superblock,
1550 static void __journal_abort_soft (journal_t *journal, int errno)
1552 if (journal->j_flags & JFS_ABORT)
1555 if (!journal->j_errno)
1556 journal->j_errno = errno;
1558 __journal_abort_hard(journal);
1561 journal_update_superblock(journal, 1);
1565 * void journal_abort () - Shutdown the journal immediately.
1566 * @journal: the journal to shutdown.
1567 * @errno: an error number to record in the journal indicating
1571 * journal (not of a single transaction). This operation cannot be
1572 * undone without closing and reopening the journal.
1584 * hitting the journal. Atomicity cannot be guaranteed on an aborted
1588 * Any attempt to get a new transaction handle on a journal which is in
1593 * Recursive transactions are not disturbed by journal abort until the
1597 * which will be recorded (if possible) in the journal superblock. This
1605 * writes are done to the journal (unless there are any already in
1610 void journal_abort(journal_t *journal, int errno)
1612 __journal_abort_soft(journal, errno);
1616 * int journal_errno () - returns the journal's error state.
1617 * @journal: journal to examine.
1620 * time the journal was mounted - if the journal was stopped
1623 * If the journal has been aborted on this mount time -EROFS will
1626 int journal_errno(journal_t *journal)
1630 spin_lock(&journal->j_state_lock);
1631 if (journal->j_flags & JFS_ABORT)
1634 err = journal->j_errno;
1635 spin_unlock(&journal->j_state_lock);
1640 * int journal_clear_err () - clears the journal's error state
1641 * @journal: journal to act on.
1646 int journal_clear_err(journal_t *journal)
1650 spin_lock(&journal->j_state_lock);
1651 if (journal->j_flags & JFS_ABORT)
1654 journal->j_errno = 0;
1655 spin_unlock(&journal->j_state_lock);
1660 * void journal_ack_err() - Ack journal err.
1661 * @journal: journal to act on.
1666 void journal_ack_err(journal_t *journal)
1668 spin_lock(&journal->j_state_lock);
1669 if (journal->j_errno)
1670 journal->j_flags |= JFS_ACK_ERR;
1671 spin_unlock(&journal->j_state_lock);
1753 * Doesn't need the journal lock.