/linux-6.12.1/drivers/md/dm-vdo/ |
D | recovery-journal.c | 67 static inline atomic_t *get_zone_count_ptr(struct recovery_journal *journal, in get_zone_count_ptr() argument 72 ? &journal->lock_counter.logical_zone_counts[lock_number] in get_zone_count_ptr() 73 : &journal->lock_counter.physical_zone_counts[lock_number]); in get_zone_count_ptr() 85 static inline u16 *get_counter(struct recovery_journal *journal, in get_counter() argument 89 struct lock_counter *counter = &journal->lock_counter; in get_counter() 101 static atomic_t *get_decrement_counter(struct recovery_journal *journal, in get_decrement_counter() argument 104 return &journal->lock_counter.journal_decrement_counts[lock_number]; in get_decrement_counter() 114 static bool is_journal_zone_locked(struct recovery_journal *journal, in is_journal_zone_locked() argument 117 u16 journal_value = *get_counter(journal, lock_number, VDO_ZONE_TYPE_JOURNAL, 0); in is_journal_zone_locked() 118 u32 decrements = atomic_read(get_decrement_counter(journal, lock_number)); in is_journal_zone_locked() [all …]
|
D | slab-depot.c | 48 static inline struct journal_lock * __must_check get_lock(struct slab_journal *journal, in get_lock() argument 51 return &journal->locks[sequence_number % journal->size]; in get_lock() 66 static inline bool __must_check must_make_entries_to_flush(struct slab_journal *journal) in must_make_entries_to_flush() argument 68 return ((journal->slab->status != VDO_SLAB_REBUILDING) && in must_make_entries_to_flush() 69 vdo_waitq_has_waiters(&journal->entry_waiters)); in must_make_entries_to_flush() 78 static inline bool __must_check is_reaping(struct slab_journal *journal) in is_reaping() argument 80 return (journal->head != journal->unreapable); in is_reaping() 87 static void initialize_tail_block(struct slab_journal *journal) in initialize_tail_block() argument 89 struct slab_journal_block_header *header = &journal->tail_header; in initialize_tail_block() 91 header->sequence_number = journal->tail; in initialize_tail_block() [all …]
|
D | recovery-journal.h | 122 struct recovery_journal *journal; member 229 vdo_get_recovery_journal_block_number(const struct recovery_journal *journal, in vdo_get_recovery_journal_block_number() argument 236 return vdo_compute_recovery_journal_block_number(journal->size, sequence); in vdo_get_recovery_journal_block_number() 247 vdo_compute_recovery_journal_check_byte(const struct recovery_journal *journal, in vdo_compute_recovery_journal_check_byte() argument 251 return (((sequence / journal->size) & 0x7F) | 0x80); in vdo_compute_recovery_journal_check_byte() 261 void vdo_free_recovery_journal(struct recovery_journal *journal); 263 void vdo_initialize_recovery_journal_post_repair(struct recovery_journal *journal, 270 vdo_get_journal_block_map_data_blocks_used(struct recovery_journal *journal); 272 thread_id_t __must_check vdo_get_recovery_journal_thread_id(struct recovery_journal *journal); 274 void vdo_open_recovery_journal(struct recovery_journal *journal, [all …]
|
D | repair.c | 714 static struct packed_journal_sector * __must_check get_sector(struct recovery_journal *journal, in get_sector() argument 721 offset = ((vdo_get_recovery_journal_block_number(journal, sequence) * VDO_BLOCK_SIZE) + in get_sector() 798 struct recovery_journal *journal = vdo->recovery_journal; in add_slab_journal_entries() local 807 advance_points(repair, journal->entries_per_block)) { in add_slab_journal_entries() 1161 get_recovery_journal_block_header(struct recovery_journal *journal, char *data, in get_recovery_journal_block_header() argument 1165 vdo_get_recovery_journal_block_number(journal, sequence); in get_recovery_journal_block_header() 1183 static bool __must_check is_valid_recovery_journal_block(const struct recovery_journal *journal, in is_valid_recovery_journal_block() argument 1187 if ((header->nonce != journal->nonce) || in is_valid_recovery_journal_block() 1188 (header->recovery_count != journal->recovery_count)) in is_valid_recovery_journal_block() 1192 return (header->entry_count <= journal->entries_per_block); in is_valid_recovery_journal_block() [all …]
|
/linux-6.12.1/fs/jbd2/ |
D | journal.c | 137 journal_t *journal = from_timer(journal, t, j_commit_timer); in commit_timeout() local 139 wake_up_process(journal->j_task); in commit_timeout() 162 journal_t *journal = arg; in kjournald2() local 169 timer_setup(&journal->j_commit_timer, commit_timeout, 0); in kjournald2() 174 journal->j_task = current; in kjournald2() 175 wake_up(&journal->j_wait_done_commit); in kjournald2() 188 write_lock(&journal->j_state_lock); in kjournald2() 191 if (journal->j_flags & JBD2_UNMOUNT) in kjournald2() 195 journal->j_commit_sequence, journal->j_commit_request); in kjournald2() 197 if (journal->j_commit_sequence != journal->j_commit_request) { in kjournald2() [all …]
|
D | checkpoint.c | 49 void __jbd2_log_wait_for_space(journal_t *journal) in __jbd2_log_wait_for_space() argument 50 __acquires(&journal->j_state_lock) in __jbd2_log_wait_for_space() 51 __releases(&journal->j_state_lock) in __jbd2_log_wait_for_space() 56 nblocks = journal->j_max_transaction_buffers; in __jbd2_log_wait_for_space() 57 while (jbd2_log_space_left(journal) < nblocks) { in __jbd2_log_wait_for_space() 58 write_unlock(&journal->j_state_lock); in __jbd2_log_wait_for_space() 59 mutex_lock_io(&journal->j_checkpoint_mutex); in __jbd2_log_wait_for_space() 72 write_lock(&journal->j_state_lock); in __jbd2_log_wait_for_space() 73 if (journal->j_flags & JBD2_ABORT) { in __jbd2_log_wait_for_space() 74 mutex_unlock(&journal->j_checkpoint_mutex); in __jbd2_log_wait_for_space() [all …]
|
D | commit.c | 114 static int journal_submit_commit_record(journal_t *journal, in journal_submit_commit_record() argument 126 if (is_journal_aborted(journal)) in journal_submit_commit_record() 139 if (jbd2_has_feature_checksum(journal)) { in journal_submit_commit_record() 144 jbd2_commit_block_csum_set(journal, bh); in journal_submit_commit_record() 152 if (journal->j_flags & JBD2_BARRIER && in journal_submit_commit_record() 153 !jbd2_has_feature_async_commit(journal)) in journal_submit_commit_record() 165 static int journal_wait_on_commit_record(journal_t *journal, in journal_wait_on_commit_record() argument 181 int jbd2_submit_inode_data(journal_t *journal, struct jbd2_inode *jinode) in jbd2_submit_inode_data() argument 187 return journal->j_submit_inode_data_buffers(jinode); in jbd2_submit_inode_data() 192 int jbd2_wait_inode_data(journal_t *journal, struct jbd2_inode *jinode) in jbd2_wait_inode_data() argument [all …]
|
D | transaction.c | 80 static void jbd2_get_transaction(journal_t *journal, in jbd2_get_transaction() argument 83 transaction->t_journal = journal; in jbd2_get_transaction() 86 transaction->t_tid = journal->j_transaction_sequence++; in jbd2_get_transaction() 87 transaction->t_expires = jiffies + journal->j_commit_interval; in jbd2_get_transaction() 90 journal->j_transaction_overhead_buffers + in jbd2_get_transaction() 91 atomic_read(&journal->j_reserved_credits)); in jbd2_get_transaction() 98 journal->j_commit_timer.expires = round_jiffies_up(transaction->t_expires); in jbd2_get_transaction() 99 add_timer(&journal->j_commit_timer); in jbd2_get_transaction() 101 J_ASSERT(journal->j_running_transaction == NULL); in jbd2_get_transaction() 102 journal->j_running_transaction = transaction; in jbd2_get_transaction() [all …]
|
D | revoke.c | 131 static inline int hash(journal_t *journal, unsigned long long block) in hash() argument 133 return hash_64(block, journal->j_revoke->hash_shift); in hash() 136 static int insert_revoke_hash(journal_t *journal, unsigned long long blocknr, in insert_revoke_hash() argument 151 hash_list = &journal->j_revoke->hash_table[hash(journal, blocknr)]; in insert_revoke_hash() 152 spin_lock(&journal->j_revoke_lock); in insert_revoke_hash() 154 spin_unlock(&journal->j_revoke_lock); in insert_revoke_hash() 160 static struct jbd2_revoke_record_s *find_revoke_record(journal_t *journal, in find_revoke_record() argument 166 hash_list = &journal->j_revoke->hash_table[hash(journal, blocknr)]; in find_revoke_record() 168 spin_lock(&journal->j_revoke_lock); in find_revoke_record() 172 spin_unlock(&journal->j_revoke_lock); in find_revoke_record() [all …]
|
D | recovery.c | 40 static int do_one_pass(journal_t *journal, 68 static int do_readahead(journal_t *journal, unsigned int start) in do_readahead() argument 78 max = start + (128 * 1024 / journal->j_blocksize); in do_readahead() 79 if (max > journal->j_total_len) in do_readahead() 80 max = journal->j_total_len; in do_readahead() 88 err = jbd2_journal_bmap(journal, next, &blocknr); in do_readahead() 96 bh = __getblk(journal->j_dev, blocknr, journal->j_blocksize); in do_readahead() 130 static int jread(struct buffer_head **bhp, journal_t *journal, in jread() argument 139 if (offset >= journal->j_total_len) { in jread() 144 err = jbd2_journal_bmap(journal, offset, &blocknr); in jread() [all …]
|
/linux-6.12.1/fs/reiserfs/ |
D | journal.c | 93 static void release_journal_dev(struct reiserfs_journal *journal); 114 struct reiserfs_journal *journal = SB_JOURNAL(sb); in init_journal_hash() local 115 memset(journal->j_hash_table, 0, in init_journal_hash() 156 struct reiserfs_journal *journal = SB_JOURNAL(sb); in get_bitmap_node() local 158 struct list_head *entry = journal->j_bitmap_nodes.next; in get_bitmap_node() 160 journal->j_used_bitmap_nodes++; in get_bitmap_node() 163 if (entry != &journal->j_bitmap_nodes) { in get_bitmap_node() 167 journal->j_free_bitmap_nodes--; in get_bitmap_node() 180 struct reiserfs_journal *journal = SB_JOURNAL(sb); in free_bitmap_node() local 181 journal->j_used_bitmap_nodes--; in free_bitmap_node() [all …]
|
/linux-6.12.1/fs/bcachefs/ |
D | journal_reclaim.h | 7 static inline void journal_reclaim_kick(struct journal *j) in journal_reclaim_kick() 16 unsigned bch2_journal_dev_buckets_available(struct journal *, 19 void bch2_journal_set_watermark(struct journal *); 20 void bch2_journal_space_available(struct journal *); 28 journal_seq_pin(struct journal *j, u64 seq) in journal_seq_pin() 35 void bch2_journal_reclaim_fast(struct journal *); 36 bool __bch2_journal_pin_put(struct journal *, u64); 37 void bch2_journal_pin_put(struct journal *, u64); 38 void bch2_journal_pin_drop(struct journal *, struct journal_entry_pin *); 40 void bch2_journal_pin_set(struct journal *, u64, struct journal_entry_pin *, [all …]
|
D | journal.h | 118 static inline void journal_wake(struct journal *j) in journal_wake() 124 static inline struct journal_buf *journal_cur_buf(struct journal *j) in journal_cur_buf() 131 static inline u64 journal_last_seq(struct journal *j) in journal_last_seq() 136 static inline u64 journal_cur_seq(struct journal *j) in journal_cur_seq() 141 static inline u64 journal_last_unwritten_seq(struct journal *j) in journal_last_unwritten_seq() 174 static inline int journal_entry_overhead(struct journal *j) in journal_entry_overhead() 194 journal_res_entry(struct journal *j, struct journal_res *res) in journal_res_entry() 224 bch2_journal_add_entry(struct journal *j, struct journal_res *res, in bch2_journal_add_entry() 253 static inline union journal_res_state journal_state_buf_put(struct journal *j, unsigned idx) in journal_state_buf_put() 266 bool bch2_journal_entry_close(struct journal *); [all …]
|
D | journal_sb.c | 22 struct bch_sb_field_journal *journal = field_to_type(f, journal); in bch2_sb_journal_validate() local 29 nr = bch2_nr_journal_buckets(journal); in bch2_sb_journal_validate() 38 b[i] = le64_to_cpu(journal->buckets[i]); in bch2_sb_journal_validate() 74 struct bch_sb_field_journal *journal = field_to_type(f, journal); in bch2_sb_journal_to_text() local 75 unsigned i, nr = bch2_nr_journal_buckets(journal); in bch2_sb_journal_to_text() 79 prt_printf(out, " %llu", le64_to_cpu(journal->buckets[i])); in bch2_sb_journal_to_text() 104 struct bch_sb_field_journal_v2 *journal = field_to_type(f, journal_v2); in bch2_sb_journal_v2_validate() local 112 nr = bch2_sb_field_journal_v2_nr_entries(journal); in bch2_sb_journal_v2_validate() 121 b[i].start = le64_to_cpu(journal->d[i].start); in bch2_sb_journal_v2_validate() 122 b[i].end = b[i].start + le64_to_cpu(journal->d[i].nr); in bch2_sb_journal_v2_validate() [all …]
|
D | journal_reclaim.c | 37 unsigned bch2_journal_dev_buckets_available(struct journal *j, in bch2_journal_dev_buckets_available() 54 void bch2_journal_set_watermark(struct journal *j) in bch2_journal_set_watermark() 56 struct bch_fs *c = container_of(j, struct bch_fs, journal); in bch2_journal_set_watermark() 78 journal_dev_space_available(struct journal *j, struct bch_dev *ca, in journal_dev_space_available() 81 struct journal_device *ja = &ca->journal; in journal_dev_space_available() 134 static struct journal_space __journal_space_available(struct journal *j, unsigned nr_devs_want, in __journal_space_available() 137 struct bch_fs *c = container_of(j, struct bch_fs, journal); in __journal_space_available() 145 if (!ca->journal.nr) in __journal_space_available() 170 void bch2_journal_space_available(struct journal *j) in bch2_journal_space_available() 172 struct bch_fs *c = container_of(j, struct bch_fs, journal); in bch2_journal_space_available() [all …]
|
D | journal.c | 30 static inline bool journal_seq_unwritten(struct journal *j, u64 seq) in journal_seq_unwritten() 40 static inline unsigned nr_unwritten_journal_entries(struct journal *j) in nr_unwritten_journal_entries() 45 static bool journal_entry_is_open(struct journal *j) in journal_entry_is_open() 50 static void bch2_journal_buf_to_text(struct printbuf *out, struct journal *j, u64 seq) in bch2_journal_buf_to_text() 88 static void bch2_journal_bufs_to_text(struct printbuf *out, struct journal *j) in bch2_journal_bufs_to_text() 101 journal_seq_to_buf(struct journal *j, u64 seq) in journal_seq_to_buf() 137 journal_error_check_stuck(struct journal *j, int error, unsigned flags) in journal_error_check_stuck() 139 struct bch_fs *c = container_of(j, struct bch_fs, journal); in journal_error_check_stuck() 186 void bch2_journal_do_writes(struct journal *j) in bch2_journal_do_writes() 213 void bch2_journal_buf_put_final(struct journal *j, u64 seq) in bch2_journal_buf_put_final() [all …]
|
/linux-6.12.1/drivers/md/bcache/ |
D | journal.c | 38 struct journal_device *ja = &ca->journal; in journal_read_bucket() 42 struct jset *j, *data = ca->set->journal.w[0].data; in journal_read_bucket() 183 struct journal_device *ja = &ca->journal; in bch_journal_read() 285 c->journal.seq = list_entry(list->prev, in bch_journal_read() 298 struct journal *j = &c->journal; in bch_journal_mark() 409 void bch_journal_space_reserve(struct journal *j) in bch_journal_space_reserve() 424 if (c->journal.btree_flushing) in btree_flush_write() 427 spin_lock(&c->journal.flush_write_lock); in btree_flush_write() 428 if (c->journal.btree_flushing) { in btree_flush_write() 429 spin_unlock(&c->journal.flush_write_lock); in btree_flush_write() [all …]
|
D | journal.h | 104 struct journal { struct 163 (fifo_idx(&(c)->journal.pin, (l)) > fifo_idx(&(c)->journal.pin, (r))) 178 void bch_journal_next(struct journal *j); 186 void bch_journal_space_reserve(struct journal *j);
|
/linux-6.12.1/fs/ocfs2/ |
D | journal.c | 62 static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal, 155 ocfs2_queue_recovery_completion(osb->journal, i, NULL, in ocfs2_queue_replay_slots() 294 struct ocfs2_journal *journal = NULL; in ocfs2_commit_cache() local 296 journal = osb->journal; in ocfs2_commit_cache() 299 down_write(&journal->j_trans_barrier); in ocfs2_commit_cache() 301 flushed = atomic_read(&journal->j_num_trans); in ocfs2_commit_cache() 304 up_write(&journal->j_trans_barrier); in ocfs2_commit_cache() 308 jbd2_journal_lock_updates(journal->j_journal); in ocfs2_commit_cache() 309 status = jbd2_journal_flush(journal->j_journal, 0); in ocfs2_commit_cache() 310 jbd2_journal_unlock_updates(journal->j_journal); in ocfs2_commit_cache() [all …]
|
D | journal.h | 78 static inline void ocfs2_set_ci_lock_trans(struct ocfs2_journal *journal, in ocfs2_set_ci_lock_trans() argument 82 ci->ci_last_trans = journal->j_trans_id; in ocfs2_set_ci_lock_trans() 94 struct ocfs2_journal *journal = in ocfs2_ci_fully_checkpointed() local 95 OCFS2_SB(ocfs2_metadata_cache_get_super(ci))->journal; in ocfs2_ci_fully_checkpointed() 98 ret = time_after(journal->j_trans_id, ci->ci_last_trans); in ocfs2_ci_fully_checkpointed() 110 struct ocfs2_journal *journal = in ocfs2_ci_is_new() local 111 OCFS2_SB(ocfs2_metadata_cache_get_super(ci))->journal; in ocfs2_ci_is_new() 114 ret = !(time_after(journal->j_trans_id, ci->ci_created_trans)); in ocfs2_ci_is_new() 137 ci->ci_created_trans = osb->journal->j_trans_id; in ocfs2_ci_set_new() 175 int ocfs2_journal_wipe(struct ocfs2_journal *journal, [all …]
|
/linux-6.12.1/include/linux/ |
D | jbd2.h | 1278 void (*j_fc_cleanup_callback)(struct journal_s *journal, int full, tid_t tid); 1291 int (*j_fc_replay_callback)(struct journal_s *journal, 1302 int (*j_bmap)(struct journal_s *journal, sector_t *block); 1435 int jbd2_journal_get_log_tail(journal_t *journal, tid_t *tid, 1437 int __jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block); 1438 void jbd2_update_log_tail(journal_t *journal, tid_t tid, unsigned long block); 1446 void __jbd2_journal_clean_checkpoint_list(journal_t *journal, enum jbd2_shrink_type type); 1447 unsigned long jbd2_journal_shrink_checkpoint_list(journal_t *journal, unsigned long *nr_to_scan); 1450 void jbd2_journal_destroy_checkpoint(journal_t *journal); 1537 bool jbd2_journal_try_to_free_buffers(journal_t *journal, struct folio *folio); [all …]
|
/linux-6.12.1/include/trace/events/ |
D | jbd2.h | 16 TP_PROTO(journal_t *journal, int result), 18 TP_ARGS(journal, result), 26 __entry->dev = journal->j_fs_dev->bd_dev; 36 TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 38 TP_ARGS(journal, commit_transaction), 47 __entry->dev = journal->j_fs_dev->bd_dev; 59 TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 61 TP_ARGS(journal, commit_transaction) 66 TP_PROTO(journal_t *journal, transaction_t *commit_transaction), 68 TP_ARGS(journal, commit_transaction) [all …]
|
/linux-6.12.1/Documentation/filesystems/ext4/ |
D | journal.rst | 6 Introduced in ext3, the ext4 filesystem employs a journal to protect the 8 to 10,240,000 file system blocks (see man mke2fs(8) for more details on journal 12 cache, a record of the data being committed is also written to the journal. At 13 some later point in time, the journal code writes the transactions to their 16 crash during the second slow write, the journal can be replayed all the 18 gets written through the journal to the disk. The effect of this is to 23 through the journal. This means that file data blocks are /not/ 26 option to control journal behavior. If ``data=journal``, all data and 27 metadata are written to disk through the journal. This is slower but 29 disk before the metadata are written to disk through the journal. [all …]
|
/linux-6.12.1/Documentation/admin-guide/device-mapper/ |
D | dm-integrity.rst | 12 To guarantee write atomicity, the dm-integrity target uses journal, it 13 writes sector data and integrity tags into a journal, commits the journal 29 instead of a journal. If a bit in the bitmap is 1, the corresponding 32 is faster than the journal mode, because we don't have to write the data 75 D - direct writes (without journal) 82 journal and atomicity is guaranteed. In case of crash, 90 R - recovery mode - in this mode, journal is not replayed, 101 The size of journal, this argument is used only if formatting the 119 The journal watermark in percents. When the size of the journal 120 exceeds this watermark, the thread that flushes the journal will [all …]
|
/linux-6.12.1/Documentation/filesystems/ |
D | journalling.rst | 12 how you decide to allocate the physical media on which the journal 15 for journal stored on a raw device (in a continuous range of blocks). A 21 journal file. The journalling layer expects the space for the journal 23 When loading the journal you must call jbd2_journal_load() to process 24 journal contents. If the client file system detects the journal contents 26 may call jbd2_journal_wipe() to clear the journal contents before 31 transactions in the journal and similarly jbd2_journal_load() will 38 You still need to actually journal your filesystem changes, this is done 40 the modification of each of the buffers with calls to the journal layer, 70 jbd2_journal_destroy() to clean up your in-core journal object. [all …]
|