]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/linux/reiserfs_fs.h
reiserfs: journaled xattrs
[linux-2.6-omap-h63xx.git] / include / linux / reiserfs_fs.h
index cf5407ee0f3246eb79dcd015dd1ab14873a4bd21..67ad310fa88b38571d229f48fd4081df3e270aec 100644 (file)
@@ -86,11 +86,14 @@ void __reiserfs_warning(struct super_block *s, const char *id,
 /* 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)
 
@@ -1448,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? |
@@ -1602,6 +1615,10 @@ struct reiserfs_journal_header {
 #define JOURNAL_MAX_COMMIT_AGE 30
 #define JOURNAL_MAX_TRANS_AGE 30
 #define JOURNAL_PER_BALANCE_CNT (3 * (MAX_HEIGHT-2) + 9)
+#define JOURNAL_BLOCKS_PER_OBJECT(sb)  (JOURNAL_PER_BALANCE_CNT * 3 + \
+                                        2 * (REISERFS_QUOTA_INIT_BLOCKS(sb) + \
+                                             REISERFS_QUOTA_TRANS_BLOCKS(sb)))
+
 #ifdef CONFIG_QUOTA
 /* We need to update data and inode (atime) */
 #define REISERFS_QUOTA_TRANS_BLOCKS(s) (REISERFS_SB(s)->s_mount_opt & (1<<REISERFS_QUOTA) ? 2 : 0)
@@ -1758,7 +1775,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);
@@ -1988,8 +2005,15 @@ 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_error(struct super_block *s, const char *id,
+                     const char *function, const char *fmt, ...);
+#define reiserfs_error(s, id, fmt, args...) \
+        __reiserfs_error(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);
@@ -2204,7 +2228,4 @@ int reiserfs_unpack(struct inode *inode, struct file *filp);
 #define reiserfs_write_lock( sb ) lock_kernel()
 #define reiserfs_write_unlock( sb ) unlock_kernel()
 
-/* xattr stuff */
-#define REISERFS_XATTR_DIR_SEM(s) (REISERFS_SB(s)->xattr_dir_sem)
-
 #endif                         /* _LINUX_REISER_FS_H */