On Wed, 2012-08-08 at 10:03 +0800, Peng Tao wrote: > From: Peng Tao <tao.peng@xxxxxxx> > > For bufferred write, scan dirty pages to find out longest continuous > dirty pages. In this case, also allow layout driver to specify a > maximum layoutget size which is useful to avoid busy scanning dirty pages > for block layout client. This is _really_ ugly, and is a source of potential deadlocks if multiple threads are scanning+locking pages at the same time. Why not simplify this by dropping the complicated tests for whether or not the pages are dirty? That gets rid of the deadlock-prone lock_page() calls, and would enable you to just use radix_tree_next_hole(). > For direct write, just use dreq->bytes_left. This makes sense. -- Trond Myklebust Linux NFS client maintainer NetApp Trond.Myklebust@xxxxxxxxxx www.netapp.com ��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥