NFS: Clean up helper function nfs4_select_rw_stateid()
[deliverable/linux.git] / fs / nfs / write.c
index e3b55372726cb0d2a082c62ed86a35e8605c66b5..e1b5fe4d873abb50a5fb64febef2584d10d4b149 100644 (file)
@@ -846,6 +846,7 @@ static int nfs_writepage_setup(struct nfs_open_context *ctx, struct page *page,
 int nfs_flush_incompatible(struct file *file, struct page *page)
 {
        struct nfs_open_context *ctx = nfs_file_open_context(file);
+       struct nfs_lock_context *l_ctx;
        struct nfs_page *req;
        int do_flush, status;
        /*
@@ -860,9 +861,12 @@ int nfs_flush_incompatible(struct file *file, struct page *page)
                req = nfs_page_find_request(page);
                if (req == NULL)
                        return 0;
-               do_flush = req->wb_page != page || req->wb_context != ctx ||
-                       req->wb_lock_context->lockowner != current->files ||
-                       req->wb_lock_context->pid != current->tgid;
+               l_ctx = req->wb_lock_context;
+               do_flush = req->wb_page != page || req->wb_context != ctx;
+               if (l_ctx) {
+                       do_flush |= l_ctx->lockowner.l_owner != current->files
+                               || l_ctx->lockowner.l_pid != current->tgid;
+               }
                nfs_release_request(req);
                if (!do_flush)
                        return 0;
This page took 0.025987 seconds and 5 git commands to generate.