Gastritis refers to inflammation of the inner lining of the stomach. The diagnosis is made by gastroscopy and biopsy, but can often be suspected based on symptoms. IBS is a condition affecting the intestines, and is thought to be due to problems with the muscles and nerves of the intestine, which in turn causes problems with gut movement and sensitivity. IBS diagnosed using symptoms, and endoscopy and biopsy would be normal.
Based on your predominant symptoms of bloating and excessive flatulence, your problem might be neither gastritis nor IBS. You may have what is classified as 'Functional Bloating'.
Hydrogen/ methane breath testing is a simple and accurate way to diagnose common causes of bloating like sugar intolerance and bacterial overgrowth.
A dietary approach is also useful to identify the exact foods that generate the gas, which is different for every patient. These strategies have been shown to help the majority of patients with bloating and flatulence. My experience also shows this to be true in Singapore.
I hope this helps.