  We study the extremal solution for the problem $(-\Delta)^s u=\lambda f(u)$
in $\Omega$, $u\equiv0$ in $\R^n\setminus\Omega$, where $\lambda>0$ is a
parameter and $s\in(0,1)$. We extend some well known results for the extremal
solution when the operator is the Laplacian to this nonlocal case. For general
convex nonlinearities we prove that the extremal solution is bounded in
dimensions $n<4s$. We also show that, for exponential and power-like
nonlinearities, the extremal solution is bounded whenever $n<10s$. In the limit
$s\uparrow1$, $n<10$ is optimal. In addition, we show that the extremal
solution is $H^s(\R^n)$ in any dimension whenever the domain is convex.
  To obtain some of these results we need $L^q$ estimates for solutions to the
linear Dirichlet problem for the fractional Laplacian with $L^p$ data. We prove
optimal $L^q$ and $C^\beta$ estimates, depending on the value of $p$. These
estimates follow from classical embedding results for the Riesz potential in
$\R^n$.
  Finally, to prove the $H^s$ regularity of the extremal solution we need an
$L^\infty$ estimate near the boundary of convex domains, which we obtain via
the moving planes method. For it, we use a maximum principle in small domains
for integro-differential operators with decreasing kernels.
