Lines Matching refs:journal
134 static inline int hash(journal_t *journal, unsigned long long block) in hash() argument
136 struct jbd2_revoke_table_s *table = journal->j_revoke; in hash()
141 static int insert_revoke_hash(journal_t *journal, unsigned long long blocknr, in insert_revoke_hash() argument
154 hash_list = &journal->j_revoke->hash_table[hash(journal, blocknr)]; in insert_revoke_hash()
155 spin_lock(&journal->j_revoke_lock); in insert_revoke_hash()
157 spin_unlock(&journal->j_revoke_lock); in insert_revoke_hash()
170 static struct jbd2_revoke_record_s *find_revoke_record(journal_t *journal, in find_revoke_record() argument
176 hash_list = &journal->j_revoke->hash_table[hash(journal, blocknr)]; in find_revoke_record()
178 spin_lock(&journal->j_revoke_lock); in find_revoke_record()
182 spin_unlock(&journal->j_revoke_lock); in find_revoke_record()
187 spin_unlock(&journal->j_revoke_lock); in find_revoke_record()
269 int journal_init_revoke(journal_t *journal, int hash_size) in journal_init_revoke() argument
271 J_ASSERT(journal->j_revoke_table[0] == NULL); in journal_init_revoke()
274 journal->j_revoke_table[0] = journal_init_revoke_table(hash_size); in journal_init_revoke()
275 if (!journal->j_revoke_table[0]) in journal_init_revoke()
278 journal->j_revoke_table[1] = journal_init_revoke_table(hash_size); in journal_init_revoke()
279 if (!journal->j_revoke_table[1]) in journal_init_revoke()
282 journal->j_revoke = journal->j_revoke_table[1]; in journal_init_revoke()
284 spin_lock_init(&journal->j_revoke_lock); in journal_init_revoke()
289 journal_destroy_revoke_table(journal->j_revoke_table[0]); in journal_init_revoke()
295 void journal_destroy_revoke(journal_t *journal) in journal_destroy_revoke() argument
297 journal->j_revoke = NULL; in journal_destroy_revoke()
298 if (journal->j_revoke_table[0]) in journal_destroy_revoke()
299 journal_destroy_revoke_table(journal->j_revoke_table[0]); in journal_destroy_revoke()
300 if (journal->j_revoke_table[1]) in journal_destroy_revoke()
301 journal_destroy_revoke_table(journal->j_revoke_table[1]); in journal_destroy_revoke()
335 journal_t *journal; in journal_revoke() local
343 journal = handle->h_transaction->t_journal; in journal_revoke()
344 if (!journal_set_features(journal, 0, 0, JFS_FEATURE_INCOMPAT_REVOKE)){ in journal_revoke()
349 bdev = journal->j_fs_dev; in journal_revoke()
353 bh = __find_get_block(bdev, blocknr, journal->j_blocksize); in journal_revoke()
363 bh2 = __find_get_block(bdev, blocknr, journal->j_blocksize); in journal_revoke()
401 err = insert_revoke_hash(journal, blocknr, in journal_revoke()
425 journal_t *journal = handle->h_transaction->t_journal; in journal_cancel_revoke() local
444 record = find_revoke_record(journal, bh->b_blocknr); in journal_cancel_revoke()
448 spin_lock(&journal->j_revoke_lock); in journal_cancel_revoke()
450 spin_unlock(&journal->j_revoke_lock); in journal_cancel_revoke()
458 record = find_revoke_record(journal, bh->b_blocknr); in journal_cancel_revoke()
483 void jbd2_clear_buffer_revoked_flags(journal_t *journal) in jbd2_clear_buffer_revoked_flags() argument
485 struct jbd2_revoke_table_s *revoke = journal->j_revoke; in jbd2_clear_buffer_revoked_flags()
497 bh = __find_get_block(journal->j_fs_dev, in jbd2_clear_buffer_revoked_flags()
499 journal->j_blocksize); in jbd2_clear_buffer_revoked_flags()
512 void journal_switch_revoke_table(journal_t *journal) in journal_switch_revoke_table() argument
516 if (journal->j_revoke == journal->j_revoke_table[0]) in journal_switch_revoke_table()
517 journal->j_revoke = journal->j_revoke_table[1]; in journal_switch_revoke_table()
519 journal->j_revoke = journal->j_revoke_table[0]; in journal_switch_revoke_table()
521 for (i = 0; i < journal->j_revoke->hash_size; i++) in journal_switch_revoke_table()
522 INIT_LIST_HEAD(&journal->j_revoke->hash_table[i]); in journal_switch_revoke_table()
529 void journal_write_revoke_records(journal_t *journal, in journal_write_revoke_records() argument
545 revoke = journal->j_revoke == journal->j_revoke_table[0] ? in journal_write_revoke_records()
546 journal->j_revoke_table[1] : journal->j_revoke_table[0]; in journal_write_revoke_records()
554 write_one_revoke_record(journal, transaction, log_bufs, in journal_write_revoke_records()
563 flush_descriptor(journal, descriptor, offset, write_op); in journal_write_revoke_records()
572 static void write_one_revoke_record(journal_t *journal, argument
589 if (is_journal_aborted(journal))
596 if (journal_has_csum_v2or3(journal))
599 if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT))
606 if (offset + sz > journal->j_blocksize - csum_size) {
607 flush_descriptor(journal, descriptor, offset, write_op);
613 descriptor = journal_get_descriptor_buffer(journal);
629 if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_64BIT)) {
662 static void flush_descriptor(journal_t *journal,
668 if (is_journal_aborted(journal)) {
675 jbd2_revoke_csum_set(journal, descriptor);
706 int journal_set_revoke(journal_t *journal,
712 record = find_revoke_record(journal, blocknr);
720 return insert_revoke_hash(journal, blocknr, sequence);
730 int journal_test_revoke(journal_t *journal,
736 record = find_revoke_record(journal, blocknr);
749 void journal_clear_revoke(journal_t *journal)
756 revoke = journal->j_revoke;