Commit 3baae90
committed
bufmgr: fewer calls to BufferDescriptorGetContentLock
We're planning to merge buffer content locks into BufferDesc.state. To reduce
the size of that patch, centralize calls to BufferDescriptorGetContentLock().
The biggest part of the change is in assertions, by introducing
BufferIsLockedByMe[InMode]() (and removing BufferIsExclusiveLocked()). This
seems like an improvement even without aforementioned plans.
Additionally replace some direct calls to LWLockAcquire() with calls to
LockBuffer().
Reviewed-by: Matthias van de Meent <boekewurm+postgres@gmail.com>
Discussion: https://postgr.es/m/fvfmkr5kk4nyex56ejgxj3uzi63isfxovp2biecb4bspbjrze7@az2pljabhnff1 parent 2a2e1b4 commit 3baae90
File tree
4 files changed
+61
-18
lines changed- src
- backend
- access
- heap
- transam
- storage/buffer
- include/storage
4 files changed
+61
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
| 273 | + | |
| 274 | + | |
274 | 275 | | |
275 | 276 | | |
276 | 277 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
| 262 | + | |
262 | 263 | | |
263 | 264 | | |
264 | 265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1068 | 1068 | | |
1069 | 1069 | | |
1070 | 1070 | | |
1071 | | - | |
| 1071 | + | |
1072 | 1072 | | |
1073 | 1073 | | |
1074 | 1074 | | |
| |||
2825 | 2825 | | |
2826 | 2826 | | |
2827 | 2827 | | |
2828 | | - | |
| 2828 | + | |
2829 | 2829 | | |
2830 | 2830 | | |
2831 | 2831 | | |
| |||
2838 | 2838 | | |
2839 | 2839 | | |
2840 | 2840 | | |
2841 | | - | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
2842 | 2868 | | |
2843 | | - | |
| 2869 | + | |
2844 | 2870 | | |
2845 | 2871 | | |
2846 | 2872 | | |
2847 | 2873 | | |
2848 | | - | |
| 2874 | + | |
2849 | 2875 | | |
2850 | 2876 | | |
2851 | 2877 | | |
| |||
2858 | 2884 | | |
2859 | 2885 | | |
2860 | 2886 | | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
2861 | 2901 | | |
2862 | 2902 | | |
2863 | | - | |
| 2903 | + | |
2864 | 2904 | | |
2865 | 2905 | | |
2866 | 2906 | | |
| |||
2889 | 2929 | | |
2890 | 2930 | | |
2891 | 2931 | | |
2892 | | - | |
2893 | | - | |
| 2932 | + | |
2894 | 2933 | | |
2895 | 2934 | | |
2896 | 2935 | | |
| |||
2924 | 2963 | | |
2925 | 2964 | | |
2926 | 2965 | | |
2927 | | - | |
2928 | | - | |
| 2966 | + | |
2929 | 2967 | | |
2930 | 2968 | | |
2931 | 2969 | | |
| |||
3259 | 3297 | | |
3260 | 3298 | | |
3261 | 3299 | | |
3262 | | - | |
| 3300 | + | |
| 3301 | + | |
| 3302 | + | |
| 3303 | + | |
3263 | 3304 | | |
3264 | 3305 | | |
3265 | 3306 | | |
| |||
5324 | 5365 | | |
5325 | 5366 | | |
5326 | 5367 | | |
5327 | | - | |
| 5368 | + | |
5328 | 5369 | | |
5329 | 5370 | | |
5330 | 5371 | | |
| |||
5415 | 5456 | | |
5416 | 5457 | | |
5417 | 5458 | | |
5418 | | - | |
| 5459 | + | |
5419 | 5460 | | |
5420 | 5461 | | |
5421 | 5462 | | |
| |||
5898 | 5939 | | |
5899 | 5940 | | |
5900 | 5941 | | |
5901 | | - | |
5902 | | - | |
| 5942 | + | |
5903 | 5943 | | |
5904 | 5944 | | |
5905 | 5945 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
0 commit comments