UFC superstar Nick Diaz did NOT look happy in his mug shot -- taken moments ago -- but shoulda been smilin' ... 'cause he'll be free in no time thanks to a GREAT deal in his two DUI cases.
As we previously reported, Diaz was busted for DUI in 2013 and 2014 -- but cut a deal with prosecutors for both cases -- and he was only sentenced to a grand total of TWO days in jail.
And get this ... he already got credit for one day for the time he served when he was initially arrested.
Diaz turned himself into the San Joaquin County Jail at 10:11 AM PT -- and he'll definitely be out in a matter of minutes.
In addition to the jail time, Diaz also got 3 years of informal probation and must complete a DUI educational course.