Whamcloud - gitweb
LU-10894 dom: mdc_lock_flush() improvement 38/34738/2
authorMikhail Pershin <mpershin@whamcloud.com>
Mon, 22 Apr 2019 17:31:12 +0000 (20:31 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 1 Jun 2019 03:55:22 +0000 (03:55 +0000)
There is small improvement in osc_lock_flush() to don't
match other locks for write lock because there are none.

Do the same in mdc_lock_flush().

Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: Ie18ef63b2f969f762f0263f8b93aea726f89305f
Reviewed-on: https://review.whamcloud.com/34738
Tested-by: Jenkins
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andrew Perepechko <c17827@cray.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdc/mdc_dev.c

index a59b1a8..f148f46 100644 (file)
@@ -261,7 +261,9 @@ static int mdc_lock_flush(const struct lu_env *env, struct osc_object *obj,
                        result = 0;
        }
 
                        result = 0;
        }
 
-       rc = mdc_lock_discard_pages(env, obj, start, end, discard);
+       /* Avoid lock matching with CLM_WRITE, there can be no other locks */
+       rc = mdc_lock_discard_pages(env, obj, start, end,
+                                   mode == CLM_WRITE || discard);
        if (result == 0 && rc < 0)
                result = rc;
 
        if (result == 0 && rc < 0)
                result = rc;