From 5a96a94547fe345467c2ab2ec51cb3fade355bd9 Mon Sep 17 00:00:00 2001 From: Jie Liu Date: Mon, 12 Aug 2013 20:50:02 +1000 Subject: xfs: Add xfs_log_rlimit.c Add source files for xfs_log_rlimit.c The new file is used for log size calculations and validation shared with userspace. [dchinner: xfs_log_calc_max_attrsetm_res() does not modify the tr_attrsetm reservation, just calculates the maximum. ] [dchinner: rework loop in xfs_log_get_max_trans_res() ] Signed-off-by: Jie Liu Signed-off-by: Dave Chinner Reviewed-by: Mark Tinguely Signed-off-by: Ben Myers --- fs/xfs/xfs_log_format.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'fs/xfs/xfs_log_format.h') diff --git a/fs/xfs/xfs_log_format.h b/fs/xfs/xfs_log_format.h index cc08f597593c..a49ab2c1e7aa 100644 --- a/fs/xfs/xfs_log_format.h +++ b/fs/xfs/xfs_log_format.h @@ -19,6 +19,7 @@ #define __XFS_LOG_FORMAT_H__ struct xfs_mount; +struct xfs_trans_res; /* * On-disk Log Format definitions. @@ -51,6 +52,9 @@ typedef __uint32_t xlog_tid_t; #define XLOG_HEADER_SIZE 512 +/* Minimum number of transactions that must fit in the log (defined by mkfs) */ +#define XFS_MIN_LOG_FACTOR 3 + #define XLOG_REC_SHIFT(log) \ BTOBB(1 << (xfs_sb_version_haslogv2(&log->l_mp->m_sb) ? \ XLOG_MAX_RECORD_BSHIFT : XLOG_BIG_RECORD_BSHIFT)) @@ -135,7 +139,6 @@ typedef struct xlog_op_header { __u16 oh_res2; /* 32 bit align : 2 b */ } xlog_op_header_t; - /* valid values for h_fmt */ #define XLOG_FMT_UNKNOWN 0 #define XLOG_FMT_LINUX_LE 1 @@ -837,5 +840,7 @@ struct xfs_icreate_log { }; int xfs_log_calc_unit_res(struct xfs_mount *mp, int unit_bytes); +int xfs_log_calc_minimum_size(struct xfs_mount *); + #endif /* __XFS_LOG_FORMAT_H__ */ -- cgit v1.2.3