1
2
3
4
5
6
7#include "xfs.h"
8#include "xfs_fs.h"
9#include "xfs_shared.h"
10#include "xfs_format.h"
11#include "xfs_log_format.h"
12#include "xfs_trans_resv.h"
13#include "xfs_mount.h"
14#include "xfs_da_format.h"
15#include "xfs_da_btree.h"
16#include "xfs_inode.h"
17#include "xfs_bmap_btree.h"
18#include "xfs_quota.h"
19#include "xfs_trans.h"
20#include "xfs_qm.h"
21#include "xfs_trans_space.h"
22
23#define _ALLOC true
24#define _FREE false
25
26
27
28
29
30
31
32
33STATIC uint
34xfs_buf_log_overhead(void)
35{
36 return round_up(sizeof(struct xlog_op_header) +
37 sizeof(struct xfs_buf_log_format), 128);
38}
39
40
41
42
43
44
45
46
47STATIC uint
48xfs_calc_buf_res(
49 uint nbufs,
50 uint size)
51{
52 return nbufs * (size + xfs_buf_log_overhead());
53}
54
55
56
57
58
59
60
61
62
63
64
65
66uint
67xfs_allocfree_log_count(
68 struct xfs_mount *mp,
69 uint num_ops)
70{
71 uint blocks;
72
73 blocks = num_ops * 2 * (2 * mp->m_ag_maxlevels - 1);
74 if (xfs_sb_version_hasrmapbt(&mp->m_sb))
75 blocks += num_ops * (2 * mp->m_rmap_maxlevels - 1);
76 if (xfs_sb_version_hasreflink(&mp->m_sb))
77 blocks += num_ops * (2 * mp->m_refc_maxlevels - 1);
78
79 return blocks;
80}
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111STATIC uint
112xfs_calc_inode_res(
113 struct xfs_mount *mp,
114 uint ninodes)
115{
116 return ninodes *
117 (4 * sizeof(struct xlog_op_header) +
118 sizeof(struct xfs_inode_log_format) +
119 mp->m_sb.sb_inodesize +
120 2 * XFS_BMBT_BLOCK_LEN(mp));
121}
122
123
124
125
126
127
128
129
130
131
132
133STATIC uint
134xfs_calc_inobt_res(
135 struct xfs_mount *mp)
136{
137 return xfs_calc_buf_res(M_IGEO(mp)->inobt_maxlevels,
138 XFS_FSB_TO_B(mp, 1)) +
139 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
140 XFS_FSB_TO_B(mp, 1));
141}
142
143
144
145
146
147
148
149
150
151
152
153
154STATIC uint
155xfs_calc_finobt_res(
156 struct xfs_mount *mp)
157{
158 if (!xfs_sb_version_hasfinobt(&mp->m_sb))
159 return 0;
160
161 return xfs_calc_inobt_res(mp);
162}
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179STATIC uint
180xfs_calc_inode_chunk_res(
181 struct xfs_mount *mp,
182 bool alloc)
183{
184 uint res, size = 0;
185
186 res = xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
187 XFS_FSB_TO_B(mp, 1));
188 if (alloc) {
189
190 if (xfs_sb_version_hascrc(&mp->m_sb))
191 return res;
192 size = XFS_FSB_TO_B(mp, 1);
193 }
194
195 res += xfs_calc_buf_res(M_IGEO(mp)->ialloc_blks, size);
196 return res;
197}
198
199
200
201
202
203
204
205static unsigned int
206xfs_rtalloc_log_count(
207 struct xfs_mount *mp,
208 unsigned int num_ops)
209{
210 unsigned int blksz = XFS_FSB_TO_B(mp, 1);
211 unsigned int rtbmp_bytes;
212
213 rtbmp_bytes = (MAXEXTLEN / mp->m_sb.sb_rextsize) / NBBY;
214 return (howmany(rtbmp_bytes, blksz) + 1) * num_ops;
215}
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259STATIC uint
260xfs_calc_write_reservation(
261 struct xfs_mount *mp)
262{
263 unsigned int t1, t2, t3;
264 unsigned int blksz = XFS_FSB_TO_B(mp, 1);
265
266 t1 = xfs_calc_inode_res(mp, 1) +
267 xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK), blksz) +
268 xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
269 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2), blksz);
270
271 if (xfs_sb_version_hasrealtime(&mp->m_sb)) {
272 t2 = xfs_calc_inode_res(mp, 1) +
273 xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK),
274 blksz) +
275 xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
276 xfs_calc_buf_res(xfs_rtalloc_log_count(mp, 1), blksz) +
277 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1), blksz);
278 } else {
279 t2 = 0;
280 }
281
282 t3 = xfs_calc_buf_res(5, mp->m_sb.sb_sectsize) +
283 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2), blksz);
284
285 return XFS_DQUOT_LOGRES(mp) + max3(t1, t2, t3);
286}
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307STATIC uint
308xfs_calc_itruncate_reservation(
309 struct xfs_mount *mp)
310{
311 unsigned int t1, t2, t3;
312 unsigned int blksz = XFS_FSB_TO_B(mp, 1);
313
314 t1 = xfs_calc_inode_res(mp, 1) +
315 xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK) + 1, blksz);
316
317 t2 = xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) +
318 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 4), blksz);
319
320 if (xfs_sb_version_hasrealtime(&mp->m_sb)) {
321 t3 = xfs_calc_buf_res(5, mp->m_sb.sb_sectsize) +
322 xfs_calc_buf_res(xfs_rtalloc_log_count(mp, 2), blksz) +
323 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2), blksz);
324 } else {
325 t3 = 0;
326 }
327
328 return XFS_DQUOT_LOGRES(mp) + max3(t1, t2, t3);
329}
330
331
332
333
334
335
336
337
338
339
340
341
342
343STATIC uint
344xfs_calc_rename_reservation(
345 struct xfs_mount *mp)
346{
347 return XFS_DQUOT_LOGRES(mp) +
348 max((xfs_calc_inode_res(mp, 4) +
349 xfs_calc_buf_res(2 * XFS_DIROP_LOG_COUNT(mp),
350 XFS_FSB_TO_B(mp, 1))),
351 (xfs_calc_buf_res(7, mp->m_sb.sb_sectsize) +
352 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 3),
353 XFS_FSB_TO_B(mp, 1))));
354}
355
356
357
358
359
360
361
362STATIC uint
363xfs_calc_iunlink_remove_reservation(
364 struct xfs_mount *mp)
365{
366 return xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) +
367 2 * M_IGEO(mp)->inode_cluster_size;
368}
369
370
371
372
373
374
375
376
377
378
379
380
381
382STATIC uint
383xfs_calc_link_reservation(
384 struct xfs_mount *mp)
385{
386 return XFS_DQUOT_LOGRES(mp) +
387 xfs_calc_iunlink_remove_reservation(mp) +
388 max((xfs_calc_inode_res(mp, 2) +
389 xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp),
390 XFS_FSB_TO_B(mp, 1))),
391 (xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
392 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
393 XFS_FSB_TO_B(mp, 1))));
394}
395
396
397
398
399
400
401STATIC uint
402xfs_calc_iunlink_add_reservation(xfs_mount_t *mp)
403{
404 return xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) +
405 M_IGEO(mp)->inode_cluster_size;
406}
407
408
409
410
411
412
413
414
415
416
417
418
419
420STATIC uint
421xfs_calc_remove_reservation(
422 struct xfs_mount *mp)
423{
424 return XFS_DQUOT_LOGRES(mp) +
425 xfs_calc_iunlink_add_reservation(mp) +
426 max((xfs_calc_inode_res(mp, 1) +
427 xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp),
428 XFS_FSB_TO_B(mp, 1))),
429 (xfs_calc_buf_res(4, mp->m_sb.sb_sectsize) +
430 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2),
431 XFS_FSB_TO_B(mp, 1))));
432}
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450STATIC uint
451xfs_calc_create_resv_modify(
452 struct xfs_mount *mp)
453{
454 return xfs_calc_inode_res(mp, 2) +
455 xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) +
456 (uint)XFS_FSB_TO_B(mp, 1) +
457 xfs_calc_buf_res(XFS_DIROP_LOG_COUNT(mp), XFS_FSB_TO_B(mp, 1)) +
458 xfs_calc_finobt_res(mp);
459}
460
461
462
463
464
465
466
467
468
469STATIC uint
470xfs_calc_icreate_resv_alloc(
471 struct xfs_mount *mp)
472{
473 return xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) +
474 mp->m_sb.sb_sectsize +
475 xfs_calc_inode_chunk_res(mp, _ALLOC) +
476 xfs_calc_inobt_res(mp) +
477 xfs_calc_finobt_res(mp);
478}
479
480STATIC uint
481xfs_calc_icreate_reservation(xfs_mount_t *mp)
482{
483 return XFS_DQUOT_LOGRES(mp) +
484 max(xfs_calc_icreate_resv_alloc(mp),
485 xfs_calc_create_resv_modify(mp));
486}
487
488STATIC uint
489xfs_calc_create_tmpfile_reservation(
490 struct xfs_mount *mp)
491{
492 uint res = XFS_DQUOT_LOGRES(mp);
493
494 res += xfs_calc_icreate_resv_alloc(mp);
495 return res + xfs_calc_iunlink_add_reservation(mp);
496}
497
498
499
500
501STATIC uint
502xfs_calc_mkdir_reservation(
503 struct xfs_mount *mp)
504{
505 return xfs_calc_icreate_reservation(mp);
506}
507
508
509
510
511
512
513
514STATIC uint
515xfs_calc_symlink_reservation(
516 struct xfs_mount *mp)
517{
518 return xfs_calc_icreate_reservation(mp) +
519 xfs_calc_buf_res(1, XFS_SYMLINK_MAXLEN);
520}
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537STATIC uint
538xfs_calc_ifree_reservation(
539 struct xfs_mount *mp)
540{
541 return XFS_DQUOT_LOGRES(mp) +
542 xfs_calc_inode_res(mp, 1) +
543 xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
544 xfs_calc_iunlink_remove_reservation(mp) +
545 xfs_calc_inode_chunk_res(mp, _FREE) +
546 xfs_calc_inobt_res(mp) +
547 xfs_calc_finobt_res(mp);
548}
549
550
551
552
553
554STATIC uint
555xfs_calc_ichange_reservation(
556 struct xfs_mount *mp)
557{
558 return XFS_DQUOT_LOGRES(mp) +
559 xfs_calc_inode_res(mp, 1) +
560 xfs_calc_buf_res(1, mp->m_sb.sb_sectsize);
561
562}
563
564
565
566
567
568
569
570STATIC uint
571xfs_calc_growdata_reservation(
572 struct xfs_mount *mp)
573{
574 return xfs_calc_buf_res(3, mp->m_sb.sb_sectsize) +
575 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
576 XFS_FSB_TO_B(mp, 1));
577}
578
579
580
581
582
583
584
585
586
587
588
589STATIC uint
590xfs_calc_growrtalloc_reservation(
591 struct xfs_mount *mp)
592{
593 return xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) +
594 xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK),
595 XFS_FSB_TO_B(mp, 1)) +
596 xfs_calc_inode_res(mp, 1) +
597 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
598 XFS_FSB_TO_B(mp, 1));
599}
600
601
602
603
604
605
606STATIC uint
607xfs_calc_growrtzero_reservation(
608 struct xfs_mount *mp)
609{
610 return xfs_calc_buf_res(1, mp->m_sb.sb_blocksize);
611}
612
613
614
615
616
617
618
619
620
621
622
623STATIC uint
624xfs_calc_growrtfree_reservation(
625 struct xfs_mount *mp)
626{
627 return xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) +
628 xfs_calc_inode_res(mp, 2) +
629 xfs_calc_buf_res(1, mp->m_sb.sb_blocksize) +
630 xfs_calc_buf_res(1, mp->m_rsumsize);
631}
632
633
634
635
636
637STATIC uint
638xfs_calc_swrite_reservation(
639 struct xfs_mount *mp)
640{
641 return xfs_calc_inode_res(mp, 1);
642}
643
644
645
646
647
648STATIC uint
649xfs_calc_writeid_reservation(
650 struct xfs_mount *mp)
651{
652 return xfs_calc_inode_res(mp, 1);
653}
654
655
656
657
658
659
660
661
662
663STATIC uint
664xfs_calc_addafork_reservation(
665 struct xfs_mount *mp)
666{
667 return XFS_DQUOT_LOGRES(mp) +
668 xfs_calc_inode_res(mp, 1) +
669 xfs_calc_buf_res(2, mp->m_sb.sb_sectsize) +
670 xfs_calc_buf_res(1, mp->m_dir_geo->blksize) +
671 xfs_calc_buf_res(XFS_DAENTER_BMAP1B(mp, XFS_DATA_FORK) + 1,
672 XFS_FSB_TO_B(mp, 1)) +
673 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 1),
674 XFS_FSB_TO_B(mp, 1));
675}
676
677
678
679
680
681
682
683
684
685
686
687
688STATIC uint
689xfs_calc_attrinval_reservation(
690 struct xfs_mount *mp)
691{
692 return max((xfs_calc_inode_res(mp, 1) +
693 xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK),
694 XFS_FSB_TO_B(mp, 1))),
695 (xfs_calc_buf_res(9, mp->m_sb.sb_sectsize) +
696 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 4),
697 XFS_FSB_TO_B(mp, 1))));
698}
699
700
701
702
703
704
705
706
707
708
709
710
711STATIC uint
712xfs_calc_attrsetm_reservation(
713 struct xfs_mount *mp)
714{
715 return XFS_DQUOT_LOGRES(mp) +
716 xfs_calc_inode_res(mp, 1) +
717 xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) +
718 xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH, XFS_FSB_TO_B(mp, 1));
719}
720
721
722
723
724
725
726
727
728
729
730
731STATIC uint
732xfs_calc_attrsetrt_reservation(
733 struct xfs_mount *mp)
734{
735 return xfs_calc_buf_res(1, mp->m_sb.sb_sectsize) +
736 xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK),
737 XFS_FSB_TO_B(mp, 1));
738}
739
740
741
742
743
744
745
746
747
748
749
750
751STATIC uint
752xfs_calc_attrrm_reservation(
753 struct xfs_mount *mp)
754{
755 return XFS_DQUOT_LOGRES(mp) +
756 max((xfs_calc_inode_res(mp, 1) +
757 xfs_calc_buf_res(XFS_DA_NODE_MAXDEPTH,
758 XFS_FSB_TO_B(mp, 1)) +
759 (uint)XFS_FSB_TO_B(mp,
760 XFS_BM_MAXLEVELS(mp, XFS_ATTR_FORK)) +
761 xfs_calc_buf_res(XFS_BM_MAXLEVELS(mp, XFS_DATA_FORK), 0)),
762 (xfs_calc_buf_res(5, mp->m_sb.sb_sectsize) +
763 xfs_calc_buf_res(xfs_allocfree_log_count(mp, 2),
764 XFS_FSB_TO_B(mp, 1))));
765}
766
767
768
769
770STATIC uint
771xfs_calc_clear_agi_bucket_reservation(
772 struct xfs_mount *mp)
773{
774 return xfs_calc_buf_res(1, mp->m_sb.sb_sectsize);
775}
776
777
778
779
780
781STATIC uint
782xfs_calc_qm_setqlim_reservation(void)
783{
784 return xfs_calc_buf_res(1, sizeof(struct xfs_disk_dquot));
785}
786
787
788
789
790
791
792STATIC uint
793xfs_calc_qm_dqalloc_reservation(
794 struct xfs_mount *mp)
795{
796 return xfs_calc_write_reservation(mp) +
797 xfs_calc_buf_res(1,
798 XFS_FSB_TO_B(mp, XFS_DQUOT_CLUSTER_SIZE_FSB) - 1);
799}
800
801
802
803
804
805
806STATIC uint
807xfs_calc_qm_quotaoff_reservation(
808 struct xfs_mount *mp)
809{
810 return sizeof(struct xfs_qoff_logitem) * 2 +
811 xfs_calc_buf_res(1, mp->m_sb.sb_sectsize);
812}
813
814
815
816
817
818STATIC uint
819xfs_calc_qm_quotaoff_end_reservation(void)
820{
821 return sizeof(struct xfs_qoff_logitem) * 2;
822}
823
824
825
826
827
828STATIC uint
829xfs_calc_sb_reservation(
830 struct xfs_mount *mp)
831{
832 return xfs_calc_buf_res(1, mp->m_sb.sb_sectsize);
833}
834
835void
836xfs_trans_resv_calc(
837 struct xfs_mount *mp,
838 struct xfs_trans_resv *resp)
839{
840
841
842
843
844 resp->tr_write.tr_logres = xfs_calc_write_reservation(mp);
845 if (xfs_sb_version_hasreflink(&mp->m_sb))
846 resp->tr_write.tr_logcount = XFS_WRITE_LOG_COUNT_REFLINK;
847 else
848 resp->tr_write.tr_logcount = XFS_WRITE_LOG_COUNT;
849 resp->tr_write.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
850
851 resp->tr_itruncate.tr_logres = xfs_calc_itruncate_reservation(mp);
852 if (xfs_sb_version_hasreflink(&mp->m_sb))
853 resp->tr_itruncate.tr_logcount =
854 XFS_ITRUNCATE_LOG_COUNT_REFLINK;
855 else
856 resp->tr_itruncate.tr_logcount = XFS_ITRUNCATE_LOG_COUNT;
857 resp->tr_itruncate.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
858
859 resp->tr_rename.tr_logres = xfs_calc_rename_reservation(mp);
860 resp->tr_rename.tr_logcount = XFS_RENAME_LOG_COUNT;
861 resp->tr_rename.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
862
863 resp->tr_link.tr_logres = xfs_calc_link_reservation(mp);
864 resp->tr_link.tr_logcount = XFS_LINK_LOG_COUNT;
865 resp->tr_link.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
866
867 resp->tr_remove.tr_logres = xfs_calc_remove_reservation(mp);
868 resp->tr_remove.tr_logcount = XFS_REMOVE_LOG_COUNT;
869 resp->tr_remove.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
870
871 resp->tr_symlink.tr_logres = xfs_calc_symlink_reservation(mp);
872 resp->tr_symlink.tr_logcount = XFS_SYMLINK_LOG_COUNT;
873 resp->tr_symlink.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
874
875 resp->tr_create.tr_logres = xfs_calc_icreate_reservation(mp);
876 resp->tr_create.tr_logcount = XFS_CREATE_LOG_COUNT;
877 resp->tr_create.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
878
879 resp->tr_create_tmpfile.tr_logres =
880 xfs_calc_create_tmpfile_reservation(mp);
881 resp->tr_create_tmpfile.tr_logcount = XFS_CREATE_TMPFILE_LOG_COUNT;
882 resp->tr_create_tmpfile.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
883
884 resp->tr_mkdir.tr_logres = xfs_calc_mkdir_reservation(mp);
885 resp->tr_mkdir.tr_logcount = XFS_MKDIR_LOG_COUNT;
886 resp->tr_mkdir.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
887
888 resp->tr_ifree.tr_logres = xfs_calc_ifree_reservation(mp);
889 resp->tr_ifree.tr_logcount = XFS_INACTIVE_LOG_COUNT;
890 resp->tr_ifree.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
891
892 resp->tr_addafork.tr_logres = xfs_calc_addafork_reservation(mp);
893 resp->tr_addafork.tr_logcount = XFS_ADDAFORK_LOG_COUNT;
894 resp->tr_addafork.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
895
896 resp->tr_attrinval.tr_logres = xfs_calc_attrinval_reservation(mp);
897 resp->tr_attrinval.tr_logcount = XFS_ATTRINVAL_LOG_COUNT;
898 resp->tr_attrinval.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
899
900 resp->tr_attrsetm.tr_logres = xfs_calc_attrsetm_reservation(mp);
901 resp->tr_attrsetm.tr_logcount = XFS_ATTRSET_LOG_COUNT;
902 resp->tr_attrsetm.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
903
904 resp->tr_attrrm.tr_logres = xfs_calc_attrrm_reservation(mp);
905 resp->tr_attrrm.tr_logcount = XFS_ATTRRM_LOG_COUNT;
906 resp->tr_attrrm.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
907
908 resp->tr_growrtalloc.tr_logres = xfs_calc_growrtalloc_reservation(mp);
909 resp->tr_growrtalloc.tr_logcount = XFS_DEFAULT_PERM_LOG_COUNT;
910 resp->tr_growrtalloc.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
911
912 resp->tr_qm_dqalloc.tr_logres = xfs_calc_qm_dqalloc_reservation(mp);
913 if (xfs_sb_version_hasreflink(&mp->m_sb))
914 resp->tr_qm_dqalloc.tr_logcount = XFS_WRITE_LOG_COUNT_REFLINK;
915 else
916 resp->tr_qm_dqalloc.tr_logcount = XFS_WRITE_LOG_COUNT;
917 resp->tr_qm_dqalloc.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
918
919
920
921
922
923 resp->tr_qm_setqlim.tr_logres = xfs_calc_qm_setqlim_reservation();
924 resp->tr_qm_setqlim.tr_logcount = XFS_DEFAULT_LOG_COUNT;
925
926 resp->tr_qm_quotaoff.tr_logres = xfs_calc_qm_quotaoff_reservation(mp);
927 resp->tr_qm_quotaoff.tr_logcount = XFS_DEFAULT_LOG_COUNT;
928
929 resp->tr_qm_equotaoff.tr_logres =
930 xfs_calc_qm_quotaoff_end_reservation();
931 resp->tr_qm_equotaoff.tr_logcount = XFS_DEFAULT_LOG_COUNT;
932
933 resp->tr_sb.tr_logres = xfs_calc_sb_reservation(mp);
934 resp->tr_sb.tr_logcount = XFS_DEFAULT_LOG_COUNT;
935
936
937 resp->tr_growdata.tr_logres = xfs_calc_growdata_reservation(mp);
938 resp->tr_growdata.tr_logcount = XFS_DEFAULT_PERM_LOG_COUNT;
939 resp->tr_growdata.tr_logflags |= XFS_TRANS_PERM_LOG_RES;
940
941
942 resp->tr_ichange.tr_logres = xfs_calc_ichange_reservation(mp);
943 resp->tr_fsyncts.tr_logres = xfs_calc_swrite_reservation(mp);
944 resp->tr_writeid.tr_logres = xfs_calc_writeid_reservation(mp);
945 resp->tr_attrsetrt.tr_logres = xfs_calc_attrsetrt_reservation(mp);
946 resp->tr_clearagi.tr_logres = xfs_calc_clear_agi_bucket_reservation(mp);
947 resp->tr_growrtzero.tr_logres = xfs_calc_growrtzero_reservation(mp);
948 resp->tr_growrtfree.tr_logres = xfs_calc_growrtfree_reservation(mp);
949}
950