Building on AnnaAG's answer of 21 40 gallon barrels.
I think you can get 22 barrels in.
I'm making the case that you could get 4 barrels in 1 layer on their side.
There is some overlap in the image but I think that can be ignored because of
- the curvature of the barrels
- the barrels actually being 8.8 squares high not 9 like in the image
If you allow that then you can stack the barrels in the following way:
- 2 layers of 7 upright barrels which is 176 cm
- you would then have 128 cm left at the top which is enough for 2 sideways barrels on top of each other (120 cm)
- which means you can have 2 layers of 4 sideways barrels
- for a grand total of 27+24=222*7+2*4=22 barrels, an increase of 1 barrel!