Soft gamma repeaters (SGRs) and anomalous X-ray pulsars (AXPs) are thought to be magnetars: neutron stars powered by extreme magnetic fields. These rare objects are characterized by repeated and sometimes spectacular gamma-ray bursts. The burst mechanism might involve crustal fractures and excitation of non-radial modes which would emit gravitational waves (GWs). We present the results of a search for GW bursts from six galactic magnetars that is sensitive to neutron star f-modes, thought to be the most efficient GW emitting oscillatory modes in compact stars. One of them, SGR 0501+4516, is likely ~1 kpc from Earth, an order of magnitude closer than magnetars targeted in previous GW searches. A second, AXP 1E 1547.0-5408, gave a burst with an estimated isotropic energy >10^{44} erg which is comparable to the giant flares. We find no evidence of GWs associated with a sample of 1279 electromagnetic triggers from six magnetars occurring between November 2006 and June 2009, in GW data from the LIGO, Virgo, and GEO600 detectors. Our lowest model-dependent GW emission energy upper limits for band- and time-limited white noise bursts in the detector sensitive band, and for f-mode ringdowns (at 1090 Hz), are 3.0x10^{44} d_1^2 erg and 1.4x10^{47} d_1^2 erg respectively, where d_1 = d_{0501} / 1 kpc and d_{0501} is the distance to SGR 0501+4516. These limits on GW emission from f-modes are an order of magnitude lower than any previous, and approach the range of electromagnetic energies seen in SGR giant flares for the first time.