100 static void write_one_revoke_record(journal_t *,
transaction_t *,
103 static void flush_descriptor(journal_t *,
struct journal_head *,
int);
109 static inline int hash(journal_t *journal,
unsigned long block)
133 hash_list = &journal->j_revoke->hash_table[
hash(journal,
blocknr)];
134 jbd_lock(&journal->j_revoke_lock);
136 jbd_unlock(&journal->j_revoke_lock);
140 if (!journal_oom_retry)
155 hash_list = &journal->j_revoke->hash_table[
hash(journal,
blocknr)];
157 jbd_lock(&journal->j_revoke_lock);
161 jbd_unlock(&journal->j_revoke_lock);
166 jbd_unlock(&journal->j_revoke_lock);
205 J_ASSERT (journal->j_revoke_table[0] ==
NULL);
209 while ((tmp >>= 1
UL) != 0
UL)
213 if (!journal->j_revoke_table[0])
215 journal->j_revoke = journal->j_revoke_table[0];
220 journal->j_revoke->hash_size = hash_size;
222 journal->j_revoke->hash_shift =
shift;
224 journal->j_revoke->hash_table =
226 if (!journal->j_revoke->hash_table) {
228 journal->j_revoke =
NULL;
232 for (tmp = 0; tmp < hash_size; tmp++)
236 if (!journal->j_revoke_table[1]) {
237 kfree(journal->j_revoke_table[0]->hash_table);
242 journal->j_revoke = journal->j_revoke_table[1];
247 journal->j_revoke->hash_size = hash_size;
249 journal->j_revoke->hash_shift =
shift;
251 journal->j_revoke->hash_table =
253 if (!journal->j_revoke->hash_table) {
254 kfree(journal->j_revoke_table[0]->hash_table);
257 journal->j_revoke =
NULL;
261 for (tmp = 0; tmp < hash_size; tmp++)
264 jbd_lock_init(&journal->j_revoke_lock);
277 table = journal->j_revoke_table[0];
281 for (
i=0;
i<
table->hash_size;
i++) {
282 hash_list = &
table->hash_table[
i];
288 journal->j_revoke =
NULL;
290 table = journal->j_revoke_table[1];
294 for (
i=0;
i<
table->hash_size;
i++) {
295 hash_list = &
table->hash_table[
i];
301 journal->j_revoke =
NULL;
341 BUFFER_TRACE(bh_in,
"enter");
343 journal =
handle->h_transaction->t_journal;
345 J_ASSERT (!
"Cannot set revoke feature!");
349 bdev = journal->j_fs_dev;
355 BUFFER_TRACE(bh,
"found on hash");
357 #ifdef JBD_EXPENSIVE_CHECKING 366 if (bh2 != bh && buffer_revokevalid(bh2))
373 J_ASSERT_BH(bh2, buffer_revoked(bh2));
383 if (!J_EXPECT_BH(bh, !buffer_revoked(bh),
384 "inconsistent data on disk")) {
389 set_buffer_revoked(bh);
390 set_buffer_revokevalid(bh);
392 BUFFER_TRACE(bh_in,
"call journal_forget");
395 BUFFER_TRACE(bh,
"call brelse");
400 jbd_debug(2,
"insert revoke for block %lu, bh_in=%p\n", blocknr, bh_in);
402 handle->h_transaction->t_tid);
403 BUFFER_TRACE(bh_in,
"exit");
427 journal_t *journal =
handle->h_transaction->t_journal;
432 jbd_debug(4,
"journal_head %p, cancelling revoke\n", jh);
438 if (test_set_buffer_revokevalid(bh)) {
439 need_cancel = test_clear_buffer_revoked(bh);
442 clear_buffer_revoked(bh);
448 jbd_debug(4,
"cancelled existing revoke on " 450 jbd_lock(&journal->j_revoke_lock);
452 jbd_unlock(&journal->j_revoke_lock);
458 #ifdef JBD_EXPENSIVE_CHECKING 473 clear_buffer_revoked(bh2);
484 void journal_switch_revoke_table(journal_t *journal)
488 if (journal->j_revoke == journal->j_revoke_table[0])
489 journal->j_revoke = journal->j_revoke_table[1];
491 journal->j_revoke = journal->j_revoke_table[0];
493 for (
i = 0;
i < journal->j_revoke->hash_size;
i++)
504 void journal_write_revoke_records(journal_t *journal,
518 revoke = journal->j_revoke == journal->j_revoke_table[0] ?
519 journal->j_revoke_table[1] : journal->j_revoke_table[0];
527 write_one_revoke_record(journal, transaction,
537 jbd_debug(1,
"Wrote %d revoke records\n",
count);
545 static void write_one_revoke_record(journal_t *journal,
559 if (is_journal_aborted(journal))
567 if (
offset == journal->j_blocksize) {
583 JBUFFER_TRACE(
descriptor,
"file as BJ_LogCtl");
603 static void flush_descriptor(journal_t *journal,
610 if (is_journal_aborted(journal)) {
617 set_buffer_jwrite(bh);
618 BUFFER_TRACE(bh,
"write");
619 set_buffer_dirty(bh);
647 unsigned long blocknr,
696 revoke = journal->j_revoke;
static unsigned int block
int kmem_cache_destroy(kmem_cache_t *kc)
static int insert_revoke_hash(journal_t *journal, unsigned long blocknr, tid_t seq)
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
static void list_add(struct list_entry *entry, struct list_entry *prev, struct list_entry *next)
int __init journal_init_revoke_caches(void)
int journal_test_revoke(journal_t *journal, unsigned long blocknr, tid_t sequence)
struct list_head * hash_table
#define SLAB_HWCACHE_ALIGN
static void list_del(struct list_head *entry)
GLuint GLuint GLsizei count
int journal_init_revoke(journal_t *journal, int hash_size)
static int tid_gt(tid_t x, tid_t y)
#define INIT_LIST_HEAD(ptr)
void * kmem_cache_alloc(kmem_cache_t *kc, int flags)
void journal_destroy_revoke_caches(void)
void ll_rw_block(int, int, struct buffer_head *bh[])
static void put_bh(struct buffer_head *bh)
GLenum GLsizei GLenum GLenum const GLvoid * table
kmem_cache_t * kmem_cache_create(const char *name, size_t size, size_t offset, unsigned long flags, kmem_cache_cb_t ctor)
void journal_clear_revoke(journal_t *journal)
struct journal_head * journal_get_descriptor_buffer(journal_t *journal)
struct transaction_s transaction_t
static int hash(journal_t *journal, unsigned long block)
struct block_device * b_bdev
static struct kmem_cache * revoke_record_cache
struct buffer_head * __find_get_block(struct block_device *bdev, sector_t block, unsigned long size)
void __brelse(struct buffer_head *)
int journal_forget(handle_t *handle, struct buffer_head *bh)
struct journal_revoke_header_s journal_revoke_header_t
int journal_set_features(journal_t *journal, unsigned long compat, unsigned long ro, unsigned long incompat)
static struct message * sequence
static void brelse(struct buffer_head *bh)
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
void * kmalloc(size_t, int)
void kmem_cache_free(kmem_cache_t *kc, void *p)
static struct jbd_revoke_record_s * find_revoke_record(journal_t *journal, unsigned long blocknr)
void journal_file_buffer(struct journal_head *jh, transaction_t *transaction, int jlist)
static struct kmem_cache * revoke_table_cache
void journal_destroy_revoke(journal_t *journal)
#define JFS_FEATURE_INCOMPAT_REVOKE
int journal_set_revoke(journal_t *journal, unsigned long blocknr, tid_t sequence)