J.R. Smith struggled in the playoffs. Well, he looked great the first couple games but he really struggled after returning from a one-game suspension for an elbow to the head of Boston’s Jason Terry in the first round.

Against the Pacers he averaged 14 points a game but on just 29 percent shooting. His play was part of the reason Indiana eliminated the Knicks in six games.

Not only did Carmelo Anthony play with what an MRI exam Wednesday revealed was a partial tear in his left shoulder, but The Post has learned J.R. Smith’s nightmarish playoff performance was partly because of a swollen left knee that contained fluid buildup.

According to a league source, Smith likely will have his knee drained of the fluid in the next two weeks — the same procedure Anthony underwent in March….

“[Smith’s] been playing hurt,” the league source said. “He probably should’ve sat out a couple of games. It’s what Melo had. That’s why he wasn’t driving the ball like he was. That’s why his jump shot wasn’t right, not having the lift.’’

I don’t doubt this is true. It’s also exactly the kind of thing you would want to make public before you became a free agent — Smith is expected to opt out of his $2.9 million contract with the Knicks for next season and seek a bigger payday (likely still with the Knicks). “See, it was my knee, but that’s all better now. So pay me.”

It will be interesting to see what other teams will come after Smith, and in what price range. He can light it up for a team off the bench, as we saw when a hot second half of the season won him the NBA’s Sixth Man of the Year award. But he takes a lot of bad shots (he just tends to make more than most) and his isolation-heavy game is not a fit in every system.

With family roots in the area, I expect he stays a Knick. But it will be interesting to watch unfold.