]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/linux/reiserfs_fs.h
reiserfs: rearrange journal abort
[net-next-2.6.git] / include / linux / reiserfs_fs.h
index bc5114d35e99b65db4e11acefe3bae623a7c9db9..d097966bbd91b7ec85a29edefda6ca465a1fb9e8 100644 (file)
@@ -79,15 +79,21 @@ struct fid;
 */
 #define REISERFS_DEBUG_CODE 5  /* extra messages to help find/debug errors */
 
-void reiserfs_warning(struct super_block *s, const char *fmt, ...);
+void __reiserfs_warning(struct super_block *s, const char *id,
+                        const char *func, const char *fmt, ...);
+#define reiserfs_warning(s, id, fmt, args...) \
+        __reiserfs_warning(s, id, __func__, fmt, ##args)
 /* assertions handling */
 
 /** always check a condition and panic if it's false. */
-#define __RASSERT( cond, scond, format, args... )                                      \
-if( !( cond ) )                                                                \
-  reiserfs_panic( NULL, "reiserfs[%i]: assertion " scond " failed at " \
-                 __FILE__ ":%i:%s: " format "\n",              \
-                 in_interrupt() ? -1 : task_pid_nr(current), __LINE__ , __func__ , ##args )
+#define __RASSERT(cond, scond, format, args...)                        \
+do {                                                                   \
+       if (!(cond))                                                    \
+               reiserfs_panic(NULL, "assertion failure", "(" #cond ") at " \
+                              __FILE__ ":%i:%s: " format "\n",         \
+                              in_interrupt() ? -1 : task_pid_nr(current), \
+                              __LINE__, __func__ , ##args);            \
+} while (0)
 
 #define RASSERT(cond, format, args...) __RASSERT(cond, #cond, format, ##args)
 
@@ -171,7 +177,11 @@ struct reiserfs_super_block {
        __le32 s_flags;         /* Right now used only by inode-attributes, if enabled */
        unsigned char s_uuid[16];       /* filesystem unique identifier */
        unsigned char s_label[16];      /* filesystem volume label */
-       char s_unused[88];      /* zero filled by mkreiserfs and
+       __le16 s_mnt_count;             /* Count of mounts since last fsck */
+       __le16 s_max_mnt_count;         /* Maximum mounts before check */
+       __le32 s_lastcheck;             /* Timestamp of last fsck */
+       __le32 s_check_interval;        /* Interval between checks */
+       char s_unused[76];      /* zero filled by mkreiserfs and
                                 * reiserfs_convert_objectid_map_v1()
                                 * so any additions must be updated
                                 * there as well. */
@@ -553,10 +563,8 @@ static inline int uniqueness2type(__u32 uniqueness)
                return TYPE_DIRECT;
        case V1_DIRENTRY_UNIQUENESS:
                return TYPE_DIRENTRY;
-       default:
-               reiserfs_warning(NULL, "vs-500: unknown uniqueness %d",
-                                uniqueness);
        case V1_ANY_UNIQUENESS:
+       default:
                return TYPE_ANY;
        }
 }
@@ -573,9 +581,8 @@ static inline __u32 type2uniqueness(int type)
                return V1_DIRECT_UNIQUENESS;
        case TYPE_DIRENTRY:
                return V1_DIRENTRY_UNIQUENESS;
-       default:
-               reiserfs_warning(NULL, "vs-501: unknown type %d", type);
        case TYPE_ANY:
+       default:
                return V1_ANY_UNIQUENESS;
        }
 }
@@ -1444,6 +1451,16 @@ struct buffer_info {
        int bi_position;
 };
 
+static inline struct super_block *sb_from_tb(struct tree_balance *tb)
+{
+       return tb ? tb->tb_sb : NULL;
+}
+
+static inline struct super_block *sb_from_bi(struct buffer_info *bi)
+{
+       return bi ? sb_from_tb(bi->tb) : NULL;
+}
+
 /* there are 4 types of items: stat data, directory item, indirect, direct.
 +-------------------+------------+--------------+------------+
 |                  |  k_offset  | k_uniqueness | mergeable? |
@@ -1672,7 +1689,7 @@ struct reiserfs_transaction_handle {
        int t_refcount;
        int t_blocks_logged;    /* number of blocks this writer has logged */
        int t_blocks_allocated; /* number of blocks this writer allocated */
-       unsigned long t_trans_id;       /* sanity check, equals the current trans id */
+       unsigned int t_trans_id;        /* sanity check, equals the current trans id */
        void *t_handle_save;    /* save existing current->journal_info */
        unsigned displace_new_blocks:1; /* if new block allocation occurres, that block
                                           should be displaced from others */
@@ -1754,7 +1771,7 @@ int journal_begin(struct reiserfs_transaction_handle *,
                  struct super_block *p_s_sb, unsigned long);
 int journal_join_abort(struct reiserfs_transaction_handle *,
                       struct super_block *p_s_sb, unsigned long);
-void reiserfs_journal_abort(struct super_block *sb, int errno);
+void reiserfs_abort_journal(struct super_block *sb, int errno);
 void reiserfs_abort(struct super_block *sb, int errno, const char *fmt, ...);
 int reiserfs_allocate_list_bitmaps(struct super_block *s,
                                   struct reiserfs_list_bitmap *, unsigned int);
@@ -1984,8 +2001,11 @@ int fix_nodes(int n_op_mode, struct tree_balance *p_s_tb,
 void unfix_nodes(struct tree_balance *);
 
 /* prints.c */
-void reiserfs_panic(struct super_block *s, const char *fmt, ...)
+void __reiserfs_panic(struct super_block *s, const char *id,
+                     const char *function, const char *fmt, ...)
     __attribute__ ((noreturn));
+#define reiserfs_panic(s, id, fmt, args...) \
+       __reiserfs_panic(s, id, __func__, fmt, ##args)
 void reiserfs_info(struct super_block *s, const char *fmt, ...);
 void reiserfs_debug(struct super_block *s, int level, const char *fmt, ...);
 void print_indirect_item(struct buffer_head *bh, int item_num);
@@ -2022,7 +2042,7 @@ void leaf_paste_in_buffer(struct buffer_info *bi, int pasted_item_num,
                          int zeros_number);
 void leaf_cut_from_buffer(struct buffer_info *bi, int cut_item_num,
                          int pos_in_item, int cut_size);
-void leaf_paste_entries(struct buffer_head *bh, int item_num, int before,
+void leaf_paste_entries(struct buffer_info *bi, int item_num, int before,
                        int new_entry_count, struct reiserfs_de_head *new_dehs,
                        const char *records, int paste_size);
 /* ibalance.c */