#include <linux/stat.h>
#include <linux/string.h>
#include <linux/smp_lock.h>
-#include <linux/suspend.h>
#include <linux/buffer_head.h>
#include <linux/workqueue.h>
#include <linux/writeback.h>
return (struct reiserfs_journal_cnode *)0 ;
}
-/* returns a cnode with same size, block number and dev as bh in the current transaction hash. NULL if not found */
-static inline struct reiserfs_journal_cnode *get_journal_hash(struct super_block *p_s_sb, struct buffer_head *bh) {
- struct reiserfs_journal *journal = SB_JOURNAL (p_s_sb);
- struct reiserfs_journal_cnode *cn ;
- if (bh) {
- cn = get_journal_hash_dev(p_s_sb, journal->j_hash_table, bh->b_blocknr);
- }
- else {
- return (struct reiserfs_journal_cnode *)0 ;
- }
- return cn ;
-}
-
/*
** this actually means 'can this block be reallocated yet?'. If you set search_all, a block can only be allocated
** if it is not in the current transaction, was not freed by the current transaction, and has no chance of ever
/* insert cn into table
*/
-inline void insert_journal_hash(struct reiserfs_journal_cnode **table, struct reiserfs_journal_cnode *cn) {
+static inline void insert_journal_hash(struct reiserfs_journal_cnode **table, struct reiserfs_journal_cnode *cn) {
struct reiserfs_journal_cnode *cn_orig ;
cn_orig = journal_hash(table, cn->sb, cn->blocknr) ;
}
-atomic_t nr_reiserfs_jh = ATOMIC_INIT(0);
+static atomic_t nr_reiserfs_jh = ATOMIC_INIT(0);
static struct reiserfs_jh *alloc_jh(void) {
struct reiserfs_jh *jh;
while(1) {
return NULL ;
}
-void remove_journal_hash(struct super_block *, struct reiserfs_journal_cnode **,
+static void remove_journal_hash(struct super_block *, struct reiserfs_journal_cnode **,
struct reiserfs_journal_list *, unsigned long, int);
/*
Right now it is only used from journal code. But later we might use it
from other places.
Note: Do not use journal_getblk/sb_getblk functions here! */
-struct buffer_head * reiserfs_breada (struct block_device *dev, int block, int bufsize,
+static struct buffer_head * reiserfs_breada (struct block_device *dev, int block, int bufsize,
unsigned int max_block)
{
struct buffer_head * bhlist[BUFNR];
if( !IS_ERR( journal -> j_dev_file ) ) {
struct inode *jdev_inode = journal->j_dev_file->f_mapping->host;
if( !S_ISBLK( jdev_inode -> i_mode ) ) {
- reiserfs_warning (super, "journal_init_dev: '%s' is "
- "not a block device", jdev_name );
+ reiserfs_warning(super, "journal_init_dev: '%s' is "
+ "not a block device", jdev_name );
result = -ENOTBLK;
+ release_journal_dev( super, journal );
} else {
/* ok */
journal->j_dev_bd = I_BDEV(jdev_inode);
set_blocksize(journal->j_dev_bd, super->s_blocksize);
+ reiserfs_info(super, "journal_init_dev: journal device: %s\n",
+ bdevname(journal->j_dev_bd, b));
}
} else {
result = PTR_ERR( journal -> j_dev_file );
"journal_init_dev: Cannot open '%s': %i",
jdev_name, result );
}
- if( result != 0 ) {
- release_journal_dev( super, journal );
- }
- reiserfs_info(super, "journal_init_dev: journal device: %s\n",
- bdevname(journal->j_dev_bd, b));
return result;
}
jh = (struct reiserfs_journal_header *)(bhjh->b_data);
/* make sure that journal matches to the super block */
- if (is_reiserfs_jr(rs) && (jh->jh_journal.jp_journal_magic != sb_jp_journal_magic(rs))) {
+ if (is_reiserfs_jr(rs) && (le32_to_cpu(jh->jh_journal.jp_journal_magic) != sb_jp_journal_magic(rs))) {
reiserfs_warning (p_s_sb, "sh-460: journal header magic %x "
"(device %s) does not match to magic found in super "
"block %x",
if (!already_cleaned) {
clear_buffer_journal_dirty (bh);
+ clear_buffer_dirty(bh);
+ clear_buffer_journal_test (bh);
put_bh(bh) ;
if (atomic_read(&(bh->b_count)) < 0) {
reiserfs_warning (p_s_sb, "journal-1752: remove from trans, b_count < 0");
** in the current trans
*/
clear_buffer_journal_dirty (cn->bh);
+ clear_buffer_dirty(cn->bh);
+ clear_buffer_journal_test(cn->bh);
cleaned = 1 ;
put_bh(cn->bh) ;
if (atomic_read(&(cn->bh->b_count)) < 0) {
return journal->j_errno;
}
-void
+static void
__reiserfs_journal_abort_hard (struct super_block *sb)
{
struct reiserfs_journal *journal = SB_JOURNAL (sb);
#endif
}
-void
+static void
__reiserfs_journal_abort_soft (struct super_block *sb, int errno)
{
struct reiserfs_journal *journal = SB_JOURNAL (sb);