Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1335056
| From | green@linuxhacker.ru |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 11/45] staging/lustre/osc: Remove commented out osc_page_protected() |
| Date | 2016-02-16 07:10 +0100 |
| Message-ID | <r2GZI-3Pz-15@gated-at.bofh.it> (permalink) |
| References | <r2GGm-3pA-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Oleg Drokin <green@linuxhacker.ru>
The complicated version of osc_page_protected and osc_page_is_dlocked
are unsafe and were commented out for ages, so probably no point in
carrying them on.
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
---
drivers/staging/lustre/lustre/osc/osc_page.c | 99 ----------------------------
1 file changed, 99 deletions(-)
diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c b/drivers/staging/lustre/lustre/osc/osc_page.c
index 8943f0a..99d5b56 100644
--- a/drivers/staging/lustre/lustre/osc/osc_page.c
+++ b/drivers/staging/lustre/lustre/osc/osc_page.c
@@ -51,111 +51,12 @@ static int osc_lru_reserve(const struct lu_env *env, struct osc_object *obj,
* @{
*/
-/*
- * Comment out osc_page_protected because it may sleep inside the
- * the client_obd_list_lock.
- * client_obd_list_lock -> osc_ap_completion -> osc_completion ->
- * -> osc_page_protected -> osc_page_is_dlocked -> osc_match_base
- * -> ldlm_lock_match -> sptlrpc_import_check_ctx -> sleep.
- */
-#if 0
-static int osc_page_is_dlocked(const struct lu_env *env,
- const struct osc_page *opg,
- enum cl_lock_mode mode, int pending, int unref)
-{
- struct cl_page *page;
- struct osc_object *obj;
- struct osc_thread_info *info;
- struct ldlm_res_id *resname;
- struct lustre_handle *lockh;
- ldlm_policy_data_t *policy;
- ldlm_mode_t dlmmode;
- __u64 flags;
-
- might_sleep();
-
- info = osc_env_info(env);
- resname = &info->oti_resname;
- policy = &info->oti_policy;
- lockh = &info->oti_handle;
- page = opg->ops_cl.cpl_page;
- obj = cl2osc(opg->ops_cl.cpl_obj);
-
- flags = LDLM_FL_TEST_LOCK | LDLM_FL_BLOCK_GRANTED;
- if (pending)
- flags |= LDLM_FL_CBPENDING;
-
- dlmmode = osc_cl_lock2ldlm(mode) | LCK_PW;
- osc_lock_build_res(env, obj, resname);
- osc_index2policy(policy, page->cp_obj, page->cp_index, page->cp_index);
- return osc_match_base(osc_export(obj), resname, LDLM_EXTENT, policy,
- dlmmode, &flags, NULL, lockh, unref);
-}
-
-/**
- * Checks an invariant that a page in the cache is covered by a lock, as
- * needed.
- */
-static int osc_page_protected(const struct lu_env *env,
- const struct osc_page *opg,
- enum cl_lock_mode mode, int unref)
-{
- struct cl_object_header *hdr;
- struct cl_lock *scan;
- struct cl_page *page;
- struct cl_lock_descr *descr;
- int result;
-
- LINVRNT(!opg->ops_temp);
-
- page = opg->ops_cl.cpl_page;
- if (page->cp_owner != NULL &&
- cl_io_top(page->cp_owner)->ci_lockreq == CILR_NEVER)
- /*
- * If IO is done without locks (liblustre, or lloop), lock is
- * not required.
- */
- result = 1;
- else
- /* otherwise check for a DLM lock */
- result = osc_page_is_dlocked(env, opg, mode, 1, unref);
- if (result == 0) {
- /* maybe this page is a part of a lockless io? */
- hdr = cl_object_header(opg->ops_cl.cpl_obj);
- descr = &osc_env_info(env)->oti_descr;
- descr->cld_mode = mode;
- descr->cld_start = page->cp_index;
- descr->cld_end = page->cp_index;
- spin_lock(&hdr->coh_lock_guard);
- list_for_each_entry(scan, &hdr->coh_locks, cll_linkage) {
- /*
- * Lock-less sub-lock has to be either in HELD state
- * (when io is actively going on), or in CACHED state,
- * when top-lock is being unlocked:
- * cl_io_unlock()->cl_unuse()->...->lov_lock_unuse().
- */
- if ((scan->cll_state == CLS_HELD ||
- scan->cll_state == CLS_CACHED) &&
- cl_lock_ext_match(&scan->cll_descr, descr)) {
- struct osc_lock *olck;
-
- olck = osc_lock_at(scan);
- result = osc_lock_is_lockless(olck);
- break;
- }
- }
- spin_unlock(&hdr->coh_lock_guard);
- }
- return result;
-}
-#else
static int osc_page_protected(const struct lu_env *env,
const struct osc_page *opg,
enum cl_lock_mode mode, int unref)
{
return 1;
}
-#endif
/*****************************************************************************
*
--
2.1.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/45] Lustre cleanups green@linuxhacker.ru - 2016-02-16 06:50 +0100
[PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level> green@linuxhacker.ru - 2016-02-16 06:50 +0100
Re: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level> Joe Perches <joe@perches.com> - 2016-02-16 07:00 +0100
Re: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level> Oleg Drokin <green@linuxhacker.ru> - 2016-02-16 17:20 +0100
Re: [PATCH 43/45] staging/lustre/libcfs: Replace use of printk with pr_<level> Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-02-20 23:40 +0100
[PATCH 41/45] staging/lustre/libcfs: Get rid of multiple assignments green@linuxhacker.ru - 2016-02-16 06:50 +0100
[PATCH 45/45] staging/lustre: Convert cfs_str2num_check to use kstrtoul green@linuxhacker.ru - 2016-02-16 06:50 +0100
[PATCH 44/45] staging/lustre: Convert cfs_trace_daemon_command to use kstrtoul green@linuxhacker.ru - 2016-02-16 06:50 +0100
[PATCH 34/45] staging/lustre/libcfs: Remove unused cfs_tcd_owns_tage() function green@linuxhacker.ru - 2016-02-16 06:50 +0100
[PATCH 32/45] staging/lustre/libcfs: Remove stray spaces after function name green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 39/45] staging/lustre: Update cfs_cpu_notify switch statement with a comment green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 38/45] staging/lustre/libcfs: Remove empty lines after/before braces green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 40/45] staging/lustre: Get rid of cfs_trace_buf_type_t typedef green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 37/45] staging/lustre/libcfs: Remove useless returns in void functions green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 19/45] staging/lustre/lclient: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 31/45] staging/lustre/libcfs: reformat cfs_tcd_for_each_type_lock define green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 22/45] staging/lustre/mgc: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 27/45] staging/lustre: Remove the "write to FSF to get a copy of GPL" wording green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 20/45] staging/lustre/include: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 29/45] staging/lustre/libcfs: Move EXPORT_SYMBOLs under function/variable green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 15/45] staging/lustre/ldlm: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 33/45] staging/lustre/libcfs: Shortened too long lines green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 16/45] staging/lustre/lmv: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 18/45] staging/lustre/fld: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 21/45] staging/lustre/mdc: Adjust NULL comparison codestyle green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 30/45] staging/lustre/libcfs: style change to add missing spaces for operations green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 28/45] staging/lustre/libcfs: Cleanup: parenthesis alignment adjustments green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 42/45] staging/lustre: Remove space after cast in cfs_crypto_hash_final() green@linuxhacker.ru - 2016-02-16 07:00 +0100
[PATCH 07/45] staging/lustre: Remove unused osc_on_mdt function green@linuxhacker.ru - 2016-02-16 07:10 +0100
[PATCH 06/45] staging/lustre: Remove unused function oti_init green@linuxhacker.ru - 2016-02-16 07:10 +0100
[PATCH 10/45] staging/lustre: Remove commented out lock_lock_multi_match green@linuxhacker.ru - 2016-02-16 07:10 +0100
[PATCH 09/45] staging/lustre: Remove server code from class_get_type() green@linuxhacker.ru - 2016-02-16 07:10 +0100
[PATCH 11/45] staging/lustre/osc: Remove commented out osc_page_protected() green@linuxhacker.ru - 2016-02-16 07:10 +0100
[PATCH 04/45] staging/lustre/llite: Get rid of /proc references in comments green@linuxhacker.ru - 2016-02-16 07:10 +0100
[PATCH 05/45] staging/lustre/lov: Get rid of /proc references in comments green@linuxhacker.ru - 2016-02-16 07:10 +0100
[PATCH 02/45] staging/lustre/obdclass: Get rid of /proc references in comments. green@linuxhacker.ru - 2016-02-16 07:10 +0100
csiph-web