X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fjbd%2Frevoke.c;h=0bb60dba76cc7c3348848abd0a0798ad6a4638aa;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=6bbd73644e8f1a55d8240c5292eecd926be84e13;hpb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;p=linux-2.6.git diff --git a/fs/jbd/revoke.c b/fs/jbd/revoke.c index 6bbd73644..0bb60dba7 100644 --- a/fs/jbd/revoke.c +++ b/fs/jbd/revoke.c @@ -187,9 +187,9 @@ int __init journal_init_revoke_caches(void) void journal_destroy_revoke_caches(void) { kmem_cache_destroy(revoke_record_cache); - revoke_record_cache = 0; + revoke_record_cache = NULL; kmem_cache_destroy(revoke_table_cache); - revoke_table_cache = 0; + revoke_table_cache = NULL; } /* Initialise the revoke table for a given journal to a given size. */ @@ -332,6 +332,7 @@ int journal_revoke(handle_t *handle, unsigned long blocknr, struct block_device *bdev; int err; + might_sleep(); if (bh_in) BUFFER_TRACE(bh_in, "enter"); @@ -565,9 +566,9 @@ static void write_one_revoke_record(journal_t *journal, if (!descriptor) return; header = (journal_header_t *) &jh2bh(descriptor)->b_data[0]; - header->h_magic = htonl(JFS_MAGIC_NUMBER); - header->h_blocktype = htonl(JFS_REVOKE_BLOCK); - header->h_sequence = htonl(transaction->t_tid); + header->h_magic = cpu_to_be32(JFS_MAGIC_NUMBER); + header->h_blocktype = cpu_to_be32(JFS_REVOKE_BLOCK); + header->h_sequence = cpu_to_be32(transaction->t_tid); /* Record it so that we can wait for IO completion later */ JBUFFER_TRACE(descriptor, "file as BJ_LogCtl"); @@ -577,8 +578,8 @@ static void write_one_revoke_record(journal_t *journal, *descriptorp = descriptor; } - * ((unsigned int *)(&jh2bh(descriptor)->b_data[offset])) = - htonl(record->blocknr); + * ((__be32 *)(&jh2bh(descriptor)->b_data[offset])) = + cpu_to_be32(record->blocknr); offset += 4; *offsetp = offset; } @@ -603,7 +604,7 @@ static void flush_descriptor(journal_t *journal, } header = (journal_revoke_header_t *) jh2bh(descriptor)->b_data; - header->r_count = htonl(offset); + header->r_count = cpu_to_be32(offset); set_buffer_jwrite(bh); BUFFER_TRACE(bh, "write"); set_buffer_dirty(bh);