From: Hans Verkuil Date: Fri, 13 Dec 2013 16:13:38 +0000 (-0300) Subject: [media] vb2: push the mmap semaphore down to __buf_prepare() X-Git-Tag: v3.14-rc1~20^2~117 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b18a8ff29d80b132018d33479e86ab8ecaee6b46;p=pandora-kernel.git [media] vb2: push the mmap semaphore down to __buf_prepare() Rather than taking the mmap semaphore at a relatively high-level function, push it down to the place where it is really needed. It was placed in vb2_queue_or_prepare_buf() to prevent racing with other vb2 calls. The only way I can see that a race can happen is when two threads queue the same buffer. The solution for that it to introduce a PREPARING state. Moving it down offers opportunities to simplify the code. Signed-off-by: Hans Verkuil Acked-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- Reading git-diff-tree failed