You cannot smash locked barrels in the game.
What you should do to open these barrels, is invest some points in the "lockpick skill" and get your character that has the lockpick skill to open them....
You use lockpick in the same way that you would cast a spell. Assign the skill you your secondary action (the bottom hand next to the character's portrait), and then right click on the barrel.
The levels of lockpick required to open specific barrels range from 1 - 10 depending on where you find the barrel (e.g. i could lockpick all act 1 barrels / chests with level 5, and most in other acts with level 7, very few required a higher level)
There are a few barrels /chests/doors that you cannot lockpick. These are either doors that open with levers, or with keys you find as a result of quests (special keys, like the one you get when you kill Samual's Deathknights in act 1 that opens the door to the weapons smith's room. That door will not open with anything but that specific key). There are a few barrels with quest items in that also cant be lock picked. Most of these will have a key hidden nearby, or you will get the key when you complete a relavant quest.
Hope this helps <img src="/ubbthreads/images/graemlins/smile.gif" alt="" />