xfsprogs: sync transaction log spaces changes to the user space
PATCH v2 2/2 xfsprogs: sync transaction log spaces changes to the user space
Sync the kernel codes changes regarding transaction log space reservations to the user space.
As we have splitted the calculation of attrset log space reservations into mount time and runtime in kernel code, here we need to fix max_attrset_trans_res_adjust() to reflect this change.
--- include/xfs_mount.h | 3 +- include/xfs_trans.h | 9 +- libxfs/xfs_attr.c | 9 +- libxfs/xfs_trans.c | 265 ++++++++++++++++++++++++++------------------------- mkfs/maxtrres.c | 9 +- 5 files changed, 147 insertions(+), 148 deletions(-)
include/xfs_mount.h +2 -1
@@ -34,7 +34,8 @@ typedef struct xfs_trans_reservations {uint tr_addafork;/* cvt inode to attributed trans */ uint tr_writeid;/* write setuid/setgid file */ uint tr_attrinval;/* attr fork buffer invalidation */ -uint tr_attrset;/* set/create an attribute */ +uint tr_attrsetm;/* set/create an attribute at mount time */ +uint tr_attrsetrt;/* set/create an attribute at runtime */ uint tr_attrrm;/* remove an attribute */ uint tr_clearagi;/* clear bad agi unlinked ino bucket */ uint tr_growrtalloc;/* grow realtime allocations */
include/xfs_trans.h +3 -6
@@ -254,12 +254,9 @@ struct xfs_log_item_desc {#define XFS_WRITEID_LOG_RES (mp) ((mp)->m_reservations.tr_swrite)#define XFS_ADDAFORK_LOG_RES (mp) ((mp)->m_reservations.tr_addafork)#define XFS_ATTRINVAL_LOG_RES (mp) ((mp)->m_reservations.tr_attrinval) -#define XFS_ATTRSET_LOG_RES (mp, ext) \ - ((mp)->m_reservations.tr_attrset + \ - (ext * (mp)->m_sb.sb_sectsize) + \ - (ext * XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))) + \ - (128 * (ext + (ext * XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))))) -#define XFS_ATTRRM_LOG_RES (mp) ((mp)->m_reservations.tr_attrrm) +#define XFS_ATTRSETM_LOG_RES (mp) ((mp)->m_reservations.tr_attrsetm) +#define XFS_ATTRSETRT_LOG_RES (mp) ((mp)->m_reservations.tr_attrsetrt) +#define XFS_ATTRRM_LOG_RES (mp) ((mp)->m_reservations.tr_attrrm)#define XFS_CLEAR_AGI_BUCKET_LOG_RES (mp) ((mp)->m_reservations.tr_clearagi)
libxfs/xfs_attr.c +6 -3
@@ -275,9 +275,12 @@ xfs_attr_set_int(if (rsvd) args.trans->t_flags |=XFS_TRANS_RESERVE ; -if ((error =xfs_trans_reserve (args.trans, args.total, -XFS_ATTRSET_LOG_RES (mp, args.total),0 , -XFS_TRANS_PERM_LOG_RES ,XFS_ATTRSET_LOG_COUNT ))) { + error =xfs_trans_reserve (args.trans, args.total, +XFS_ATTRSETM_LOG_RES (mp) + +XFS_ATTRSETRT_LOG_RES (mp) * args.total, +0 ,XFS_TRANS_PERM_LOG_RES , +XFS_ATTRSET_LOG_COUNT ); +if (error) {xfs_trans_cancel (args.trans,0 );return (error); }
libxfs/xfs_trans.c +134 -131
397 lines not on this page · raw message
mkfs/maxtrres.c +2 -7
@@ -34,7 +34,6 @@ max_attrset_trans_res_adjust(int local;int size;int nblks; -int res;/* * Determine space the maximal sized attribute will use,
@@ -46,13 +45,9 @@ max_attrset_trans_res_adjust( nblks =XFS_DAENTER_SPACE_RES (mp,XFS_ATTR_FORK ); nblks +=XFS_B_TO_FSB (mp, size); nblks +=XFS_NEXTENTADD_SPACE_RES (mp, size,XFS_ATTR_FORK ); - res =XFS_ATTRSET_LOG_RES (mp, nblks); -#if 0 -printf ("size = %d nblks = %d res = %d\n" , size, nblks, res); -#endif - - mp->m_reservations.tr_attrset = res; + mp->m_reservations.tr_attrsetm =XFS_ATTRSETM_LOG_RES (mp); + mp->m_reservations.tr_attrsetrt =XFS_ATTRSETRT_LOG_RES (mp) * nblks; } static int
Signature · 6 lines
1.7.9.5 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 9 lines · Jeff Liu
Sync the kernel codes changes regarding transaction log space reservations to the user space.
As we have splitted the calculation of attrset log space reservations into mount time and runtime in kernel code, here we need to fix
max_attrset_trans_res_adjust()to reflect this change.Signed-off-by Jie Liu<[email protected]>
Quoted 8 lines
--- include/xfs_mount.h | 3 +- include/xfs_trans.h | 9 +- libxfs/xfs_attr.c | 9 +- libxfs/xfs_trans.c | 265 ++++++++++++++++++++++++++------------------------- mkfs/maxtrres.c | 9 +- 5 files changed, 147 insertions(+), 148 deletions(-)
For anyone else looking at this. This is basically kernel log reservation patch 2 and 13 combined.
Quoted 18 lines
include/xfs_trans.h +3
-6@@ -254,12 +254,9 @@ struct xfs_log_item_desc {#define XFS_WRITEID_LOG_RES (mp) ((mp)->m_reservations.tr_swrite)#define XFS_ADDAFORK_LOG_RES (mp) ((mp)->m_reservations.tr_addafork)#define XFS_ATTRINVAL_LOG_RES (mp) ((mp)->m_reservations.tr_attrinval) -#define XFS_ATTRSET_LOG_RES (mp, ext) \ - ((mp)->m_reservations.tr_attrset + \ - (ext * (mp)->m_sb.sb_sectsize) + \ - (ext * XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))) + \ - (128 * (ext + (ext * XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))))) -#define XFS_ATTRRM_LOG_RES (mp) ((mp)->m_reservations.tr_attrrm) +#define XFS_ATTRSETM_LOG_RES (mp) ((mp)->m_reservations.tr_attrsetm) +#define XFS_ATTRSETRT_LOG_RES (mp) ((mp)->m_reservations.tr_attrsetrt) +#define XFS_ATTRRM_LOG_RES (mp) ((mp)->m_reservations.tr_attrrm)#define XFS_CLEAR_AGI_BUCKET_LOG_RES (mp) ((mp)->m_reservations.tr_clearagi)
...
Quoted 12 lines
index 33dee52..bf8a2c5 100644
mkfs/maxtrres.c +0
-1@@ -34,7 +34,6 @@ max_attrset_trans_res_adjust(int local;int size;int nblks; -int res;/* * Determine space the maximal sized attribute will use,
mkfs/maxtrres.c max_attrset_trans_res_adjust( · line 55
Quoted 10 lines
mkfs/maxtrres.c +0
-6@@ -46,13 +45,9 @@ max_attrset_trans_res_adjust( nblks =XFS_DAENTER_SPACE_RES (mp,XFS_ATTR_FORK ); nblks +=XFS_B_TO_FSB (mp, size); nblks +=XFS_NEXTENTADD_SPACE_RES (mp, size,XFS_ATTR_FORK ); - res =XFS_ATTRSET_LOG_RES (mp, nblks); -#if 0 -printf ("size = %d nblks = %d res = %d\n" , size, nblks, res); -#endif - - mp->m_reservations.tr_attrset = res;
This number used to be the mount portion of constant that was multiplied times args.total.
Isn't this value (res) what we want to place into tr_attrsetm like before?
and then tr_attrsetrt is from xfs_calc_attrsetrt_reservation()?
mkfs/maxtrres.c max_attrset_trans_res_adjust( · line 53
Quoted 5 lines
mkfs/maxtrres.c +2
-0+ mp->m_reservations.tr_attrsetm =XFS_ATTRSETM_LOG_RES (mp); + mp->m_reservations.tr_attrsetrt =XFS_ATTRSETRT_LOG_RES (mp) * nblks; } static int
--Mark.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Hi Mark,
Quoted 70 lines · Mark Tinguely
Quoted 9 lines · Jeff Liu
Sync the kernel codes changes regarding transaction log space reservations to the user space.
As we have splitted the calculation of attrset log space reservations into mount time and runtime in kernel code, here we need to fix
max_attrset_trans_res_adjust()to reflect this change.Signed-off-by Jie Liu<[email protected]>Quoted 8 lines
--- include/xfs_mount.h | 3 +- include/xfs_trans.h | 9 +- libxfs/xfs_attr.c | 9 +- libxfs/xfs_trans.c | 265 ++++++++++++++++++++++++++------------------------- mkfs/maxtrres.c | 9 +- 5 files changed, 147 insertions(+), 148 deletions(-)For anyone else looking at this. This is basically kernel log reservation patch 2 and 13 combined.
Quoted 18 lines
include/xfs_trans.h +3
-6@@ -254,12 +254,9 @@ struct xfs_log_item_desc {#define XFS_WRITEID_LOG_RES (mp) ((mp)->m_reservations.tr_swrite)#define XFS_ADDAFORK_LOG_RES (mp) ((mp)->m_reservations.tr_addafork)#define XFS_ATTRINVAL_LOG_RES (mp) ((mp)->m_reservations.tr_attrinval) -#define XFS_ATTRSET_LOG_RES (mp, ext) \ - ((mp)->m_reservations.tr_attrset + \ - (ext * (mp)->m_sb.sb_sectsize) + \ - (ext * XFS_FSB_TO_B((mp), XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))) + \ - (128 * (ext + (ext * XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK))))) -#define XFS_ATTRRM_LOG_RES (mp) ((mp)->m_reservations.tr_attrrm) +#define XFS_ATTRSETM_LOG_RES (mp) ((mp)->m_reservations.tr_attrsetm) +#define XFS_ATTRSETRT_LOG_RES (mp) ((mp)->m_reservations.tr_attrsetrt) +#define XFS_ATTRRM_LOG_RES (mp) ((mp)->m_reservations.tr_attrrm)#define XFS_CLEAR_AGI_BUCKET_LOG_RES (mp) ((mp)->m_reservations.tr_clearagi)...
Quoted 12 lines
index 33dee52..bf8a2c5 100644
mkfs/maxtrres.c +0
-1@@ -34,7 +34,6 @@ max_attrset_trans_res_adjust(int local;int size;int nblks; -int res;/* * Determine space the maximal sized attribute will use, mkfs/maxtrres.c max_attrset_trans_res_adjust( · line 55
Quoted 10 lines
mkfs/maxtrres.c +0
-6@@ -46,13 +45,9 @@ max_attrset_trans_res_adjust( nblks =XFS_DAENTER_SPACE_RES (mp,XFS_ATTR_FORK ); nblks +=XFS_B_TO_FSB (mp, size); nblks +=XFS_NEXTENTADD_SPACE_RES (mp, size,XFS_ATTR_FORK ); - res =XFS_ATTRSET_LOG_RES (mp, nblks); -#if 0 -printf ("size = %d nblks = %d res = %d\n" , size, nblks, res); -#endif - - mp->m_reservations.tr_attrset = res;This number used to be the mount portion of constant that was multiplied times args.total.
Quoted 2 lines
Isn't this value (res) what we want to place into
tr_attrsetmlike before?
This is not because we have to figure out the max transaction space reservations for the attrset at first, and then it will be used for the max trans space reservations by mount...
The old attrset includes both mount(attrsetm) and realtime(attrsetrt), that's why I splitted them as below.
Quoted 7 lines
and then
tr_attrsetrtis fromxfs_calc_attrsetrt_reservation()?mkfs/maxtrres.c max_attrset_trans_res_adjust( · line 52
Quoted 4 lines
mkfs/maxtrres.c +2
-0+ mp->m_reservations.tr_attrsetm =XFS_ATTRSETM_LOG_RES (mp); + mp->m_reservations.tr_attrsetrt =XFS_ATTRSETRT_LOG_RES (mp) * nblks; }
I have tested it by putting printf statement to max_attrset_trans_res_adjust(), and verified that the "res = XFS_ATTRSET_LOG_RES(mp, nblks)" is equal to the "XFS_ATTRSETM_LOG_RES(mp) + XFS_ATTRSETRT_LOG_RES(mp) * nblks".
Thanks,
-Jeff
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs