• 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

20  *   transaction's revoked blocks to the journal
37 * need either to cancel the journal entry or to write the revoke
73 journal replay, this involves recording the transaction ID of the
105 static inline int hash(hfsplus_jbd_t *journal, unsigned long block)
107 struct hfsplus_jbd_revoke_table_s *table = journal->j_revoke;
115 static int insert_revoke_hash(hfsplus_jbd_t *journal, unsigned long blocknr,
128 hash_list = &journal->j_revoke->hash_table[hash(journal, blocknr)];
129 spin_lock(&journal->j_revoke_lock);
131 spin_unlock(&journal->j_revoke_lock);
142 /* Find a revoke record in the journal's hash table. */
144 static struct hfsplus_jbd_revoke_record_s *find_revoke_record(hfsplus_jbd_t *journal,
150 hash_list = &journal->j_revoke->hash_table[hash(journal, blocknr)];
152 spin_lock(&journal->j_revoke_lock);
156 spin_unlock(&journal->j_revoke_lock);
161 spin_unlock(&journal->j_revoke_lock);
192 /* Initialise the revoke table for a given journal to a given size. */
194 int hfsplus_jbd_init_revoke(hfsplus_jbd_t *journal, int hash_size)
198 HFSPLUS_J_ASSERT (journal->j_revoke_table[0] == NULL);
205 journal->j_revoke_table[0] = kmem_cache_alloc(hfsplus_revoke_table_cache, GFP_KERNEL);
206 if (!journal->j_revoke_table[0])
208 journal->j_revoke = journal->j_revoke_table[0];
213 journal->j_revoke->hash_size = hash_size;
215 journal->j_revoke->hash_shift = shift;
217 journal->j_revoke->hash_table =
219 if (!journal->j_revoke->hash_table) {
220 kmem_cache_free(hfsplus_revoke_table_cache, journal->j_revoke_table[0]);
221 journal->j_revoke = NULL;
226 INIT_LIST_HEAD(&journal->j_revoke->hash_table[tmp]);
228 journal->j_revoke_table[1] = kmem_cache_alloc(hfsplus_revoke_table_cache, GFP_KERNEL);
229 if (!journal->j_revoke_table[1]) {
230 kfree(journal->j_revoke_table[0]->hash_table);
231 kmem_cache_free(hfsplus_revoke_table_cache, journal->j_revoke_table[0]);
235 journal->j_revoke = journal->j_revoke_table[1];
240 journal->j_revoke->hash_size = hash_size;
242 journal->j_revoke->hash_shift = shift;
244 journal->j_revoke->hash_table =
246 if (!journal->j_revoke->hash_table) {
247 kfree(journal->j_revoke_table[0]->hash_table);
248 kmem_cache_free(hfsplus_revoke_table_cache, journal->j_revoke_table[0]);
249 kmem_cache_free(hfsplus_revoke_table_cache, journal->j_revoke_table[1]);
250 journal->j_revoke = NULL;
255 INIT_LIST_HEAD(&journal->j_revoke->hash_table[tmp]);
257 spin_lock_init(&journal->j_revoke_lock);
262 /* Destoy a journal's revoke table. The table must already be empty! */
264 void hfsplus_jbd_destroy_revoke(hfsplus_jbd_t *journal)
270 table = journal->j_revoke_table[0];
281 journal->j_revoke = NULL;
283 table = journal->j_revoke_table[1];
294 journal->j_revoke = NULL;
301 * hfsplus_jbd_revoke: revoke a given buffer_head from the journal. This
328 hfsplus_jbd_t *journal;
336 journal = handle->h_transaction->t_journal;
337 if (!hfsplus_jbd_set_features(journal, 0, 0, JFS_FEATURE_INCOMPAT_REVOKE)){
342 bdev = journal->j_fs_dev;
346 bh = __find_get_block(bdev, blocknr, journal->j_blocksize);
356 bh2 = __find_get_block(bdev, blocknr, journal->j_blocksize);
394 err = insert_revoke_hash(journal, blocknr,
415 * The caller must have the journal locked.
420 hfsplus_jbd_t *journal = handle->h_transaction->t_journal;
439 record = find_revoke_record(journal, bh->b_blocknr);
443 spin_lock(&journal->j_revoke_lock);
445 spin_unlock(&journal->j_revoke_lock);
453 record = find_revoke_record(journal, bh->b_blocknr);
477 void hfsplus_jbd_switch_revoke_table(hfsplus_jbd_t *journal)
481 if (journal->j_revoke == journal->j_revoke_table[0])
482 journal->j_revoke = journal->j_revoke_table[1];
484 journal->j_revoke = journal->j_revoke_table[0];
486 for (i = 0; i < journal->j_revoke->hash_size; i++)
487 INIT_LIST_HEAD(&journal->j_revoke->hash_table[i]);
491 * Write revoke records to the journal for all entries in the current
494 * Called with the journal lock held.
497 void hfsplus_jbd_write_revoke_records(hfsplus_jbd_t *journal,
511 revoke = journal->j_revoke == journal->j_revoke_table[0] ?
512 journal->j_revoke_table[1] : journal->j_revoke_table[0];
520 write_one_revoke_record(journal, transaction,
529 flush_descriptor(journal, descriptor, offset);
538 static void write_one_revoke_record(hfsplus_jbd_t *journal,
551 revoke records: only the IO to the journal is omitted. */
552 if (is_hfsplus_jbd_aborted(journal))
560 if (offset == journal->j_blocksize) {
561 flush_descriptor(journal, descriptor, offset);
567 descriptor = hfsplus_jbd_get_descriptor_buffer(journal);
591 * Flush a revoke descriptor out to the journal. If we are aborting,
594 * journal buffer list.
597 static void flush_descriptor(hfsplus_jbd_t *journal,
604 if (is_hfsplus_jbd_aborted(journal)) {
624 * of each revoke in the journal
640 int hfsplus_jbd_set_revoke(hfsplus_jbd_t *journal,
646 record = find_revoke_record(journal, blocknr);
654 return insert_revoke_hash(journal, blocknr, sequence);
664 int hfsplus_jbd_test_revoke(hfsplus_jbd_t *journal,
670 record = find_revoke_record(journal, blocknr);
683 void hfsplus_jbd_clear_revoke(hfsplus_jbd_t *journal)
690 revoke = journal->j_revoke;