Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LU-1346 libcfs: cleanup libcfs primitive (linux-prim.h)
[fs/lustre-release.git]
/
lustre
/
osc
/
osc_cache.c
diff --git
a/lustre/osc/osc_cache.c
b/lustre/osc/osc_cache.c
index
8d9888f
..
1096d03
100644
(file)
--- a/
lustre/osc/osc_cache.c
+++ b/
lustre/osc/osc_cache.c
@@
-120,7
+120,7
@@
static const char *oes_strings[] = {
/* ----- part 2 ----- */ \
__ext->oe_grants, __ext->oe_nr_pages, \
list_empty_marker(&__ext->oe_pages), \
/* ----- part 2 ----- */ \
__ext->oe_grants, __ext->oe_nr_pages, \
list_empty_marker(&__ext->oe_pages), \
-
cfs_waitq
_active(&__ext->oe_waitq) ? '+' : '-', \
+
waitqueue
_active(&__ext->oe_waitq) ? '+' : '-', \
__ext->oe_osclock, __ext->oe_mppr, __ext->oe_owner, \
/* ----- part 4 ----- */ \
## __VA_ARGS__); \
__ext->oe_osclock, __ext->oe_mppr, __ext->oe_owner, \
/* ----- part 4 ----- */ \
## __VA_ARGS__); \
@@
-302,7
+302,7
@@
static void osc_extent_state_set(struct osc_extent *ext, int state)
/* TODO: validate the state machine */
ext->oe_state = state;
/* TODO: validate the state machine */
ext->oe_state = state;
-
cfs_waitq_broadcast
(&ext->oe_waitq);
+
wake_up_all
(&ext->oe_waitq);
}
static struct osc_extent *osc_extent_alloc(struct osc_object *obj)
}
static struct osc_extent *osc_extent_alloc(struct osc_object *obj)
@@
-320,7
+320,7
@@
static struct osc_extent *osc_extent_alloc(struct osc_object *obj)
CFS_INIT_LIST_HEAD(&ext->oe_link);
ext->oe_state = OES_INV;
CFS_INIT_LIST_HEAD(&ext->oe_pages);
CFS_INIT_LIST_HEAD(&ext->oe_link);
ext->oe_state = OES_INV;
CFS_INIT_LIST_HEAD(&ext->oe_pages);
-
cfs_waitq_init
(&ext->oe_waitq);
+
init_waitqueue_head
(&ext->oe_waitq);
ext->oe_osclock = NULL;
return ext;
ext->oe_osclock = NULL;
return ext;
@@
-896,7
+896,7
@@
static int osc_extent_wait(const struct lu_env *env, struct osc_extent *ext,
"%s: wait ext to %d timedout, recovery in progress?\n",
osc_export(obj)->exp_obd->obd_name, state);
"%s: wait ext to %d timedout, recovery in progress?\n",
osc_export(obj)->exp_obd->obd_name, state);
- lwi = LWI_INTR(
LWI_ON_SIGNAL_NOOP
, NULL);
+ lwi = LWI_INTR(
NULL
, NULL);
rc = l_wait_event(ext->oe_waitq, extent_wait_cb(ext, state),
&lwi);
}
rc = l_wait_event(ext->oe_waitq, extent_wait_cb(ext, state),
&lwi);
}
@@
-964,7
+964,7
@@
static int osc_extent_truncate(struct osc_extent *ext, pgoff_t trunc_index,
cfs_list_del_init(&oap->oap_pending_item);
cl_page_get(page);
cfs_list_del_init(&oap->oap_pending_item);
cl_page_get(page);
- lu_ref_add(&page->cp_reference, "truncate", c
fs_current()
);
+ lu_ref_add(&page->cp_reference, "truncate", c
urrent
);
if (cl_page_own(env, io, page) == 0) {
cl_page_unmap(env, io, page);
if (cl_page_own(env, io, page) == 0) {
cl_page_unmap(env, io, page);
@@
-975,7
+975,7
@@
static int osc_extent_truncate(struct osc_extent *ext, pgoff_t trunc_index,
LASSERT(0);
}
LASSERT(0);
}
- lu_ref_del(&page->cp_reference, "truncate", c
fs_current()
);
+ lu_ref_del(&page->cp_reference, "truncate", c
urrent
);
cl_page_put(env, page);
--ext->oe_nr_pages;
cl_page_put(env, page);
--ext->oe_nr_pages;
@@
-1079,7
+1079,9
@@
static int osc_extent_make_ready(const struct lu_env *env,
last->oap_count = osc_refresh_count(env, last, OBD_BRW_WRITE);
LASSERT(last->oap_count > 0);
LASSERT(last->oap_page_off + last->oap_count <= PAGE_CACHE_SIZE);
last->oap_count = osc_refresh_count(env, last, OBD_BRW_WRITE);
LASSERT(last->oap_count > 0);
LASSERT(last->oap_page_off + last->oap_count <= PAGE_CACHE_SIZE);
+ spin_lock(&last->oap_lock);
last->oap_async_flags |= ASYNC_COUNT_STABLE;
last->oap_async_flags |= ASYNC_COUNT_STABLE;
+ spin_unlock(&last->oap_lock);
}
/* for the rest of pages, we don't need to call osf_refresh_count()
}
/* for the rest of pages, we don't need to call osf_refresh_count()
@@
-1087,7
+1089,9
@@
static int osc_extent_make_ready(const struct lu_env *env,
cfs_list_for_each_entry(oap, &ext->oe_pages, oap_pending_item) {
if (!(oap->oap_async_flags & ASYNC_COUNT_STABLE)) {
oap->oap_count = PAGE_CACHE_SIZE - oap->oap_page_off;
cfs_list_for_each_entry(oap, &ext->oe_pages, oap_pending_item) {
if (!(oap->oap_async_flags & ASYNC_COUNT_STABLE)) {
oap->oap_count = PAGE_CACHE_SIZE - oap->oap_page_off;
+ spin_lock(&oap->oap_lock);
oap->oap_async_flags |= ASYNC_COUNT_STABLE;
oap->oap_async_flags |= ASYNC_COUNT_STABLE;
+ spin_unlock(&oap->oap_lock);
}
}
}
}
@@
-1532,7
+1536,7
@@
static int osc_enter_cache(const struct lu_env *env, struct client_obd *cli,
* RPC size will be.
* The exiting condition is no avail grants and no dirty pages caching,
* that really means there is no space on the OST. */
* RPC size will be.
* The exiting condition is no avail grants and no dirty pages caching,
* that really means there is no space on the OST. */
-
cfs_waitq_init
(&ocw.ocw_waitq);
+
init_waitqueue_head
(&ocw.ocw_waitq);
ocw.ocw_oap = oap;
ocw.ocw_grant = bytes;
while (cli->cl_dirty > 0 || cli->cl_w_in_flight > 0) {
ocw.ocw_oap = oap;
ocw.ocw_grant = bytes;
while (cli->cl_dirty > 0 || cli->cl_w_in_flight > 0) {
@@
-1618,7
+1622,7
@@
wakeup:
CDEBUG(D_CACHE, "wake up %p for oap %p, avail grant %ld, %d\n",
ocw, ocw->ocw_oap, cli->cl_avail_grant, ocw->ocw_rc);
CDEBUG(D_CACHE, "wake up %p for oap %p, avail grant %ld, %d\n",
ocw, ocw->ocw_oap, cli->cl_avail_grant, ocw->ocw_rc);
-
cfs_waitq_signal
(&ocw->ocw_waitq);
+
wake_up
(&ocw->ocw_waitq);
}
EXIT;
}
EXIT;
@@
-1828,7
+1832,7
@@
static int try_to_add_extent_for_io(struct client_obd *cli,
RETURN(0);
cfs_list_for_each_entry(tmp, rpclist, oe_link) {
RETURN(0);
cfs_list_for_each_entry(tmp, rpclist, oe_link) {
- EASSERT(tmp->oe_owner == c
fs_current()
, tmp);
+ EASSERT(tmp->oe_owner == c
urrent
, tmp);
#if 0
if (overlapped(tmp, ext)) {
OSC_EXTENT_DUMP(D_ERROR, tmp, "overlapped %p.\n", ext);
#if 0
if (overlapped(tmp, ext)) {
OSC_EXTENT_DUMP(D_ERROR, tmp, "overlapped %p.\n", ext);
@@
-1846,7
+1850,7
@@
static int try_to_add_extent_for_io(struct client_obd *cli,
*pc += ext->oe_nr_pages;
cfs_list_move_tail(&ext->oe_link, rpclist);
*pc += ext->oe_nr_pages;
cfs_list_move_tail(&ext->oe_link, rpclist);
- ext->oe_owner = c
fs_current()
;
+ ext->oe_owner = c
urrent
;
RETURN(1);
}
RETURN(1);
}
@@
-2099,7
+2103,7
@@
static void osc_check_rpcs(const struct lu_env *env, struct client_obd *cli,
cl_object_get(obj);
client_obd_list_unlock(&cli->cl_loi_list_lock);
lu_object_ref_add_at(&obj->co_lu, &link, "check",
cl_object_get(obj);
client_obd_list_unlock(&cli->cl_loi_list_lock);
lu_object_ref_add_at(&obj->co_lu, &link, "check",
- c
fs_current()
);
+ c
urrent
);
/* attempt some read/write balancing by alternating between
* reads and writes in an object. The makes_rpc checks here
/* attempt some read/write balancing by alternating between
* reads and writes in an object. The makes_rpc checks here
@@
-2141,7
+2145,7
@@
static void osc_check_rpcs(const struct lu_env *env, struct client_obd *cli,
osc_list_maint(cli, osc);
lu_object_ref_del_at(&obj->co_lu, &link, "check",
osc_list_maint(cli, osc);
lu_object_ref_del_at(&obj->co_lu, &link, "check",
- c
fs_current()
);
+ c
urrent
);
cl_object_put(env, obj);
client_obd_list_lock(&cli->cl_loi_list_lock);
cl_object_put(env, obj);
client_obd_list_lock(&cli->cl_loi_list_lock);
@@
-2273,6
+2277,8
@@
int osc_queue_async_io(const struct lu_env *env, struct cl_io *io,
oap->oap_cmd = cmd;
oap->oap_page_off = ops->ops_from;
oap->oap_count = ops->ops_to - ops->ops_from;
oap->oap_cmd = cmd;
oap->oap_page_off = ops->ops_from;
oap->oap_count = ops->ops_to - ops->ops_from;
+ /* No need to hold a lock here,
+ * since this page is not in any list yet. */
oap->oap_async_flags = 0;
oap->oap_brw_flags = brw_flags;
oap->oap_async_flags = 0;
oap->oap_brw_flags = brw_flags;
@@
-2873,7
+2879,7
@@
int osc_cache_writeback_range(const struct lu_env *env, struct osc_object *obj,
EASSERT(ext->oe_start >= start &&
ext->oe_max_end <= end, ext);
osc_extent_state_set(ext, OES_LOCKING);
EASSERT(ext->oe_start >= start &&
ext->oe_max_end <= end, ext);
osc_extent_state_set(ext, OES_LOCKING);
- ext->oe_owner = c
fs_current()
;
+ ext->oe_owner = c
urrent
;
cfs_list_move_tail(&ext->oe_link,
&discard_list);
osc_update_pending(obj, OBD_BRW_WRITE,
cfs_list_move_tail(&ext->oe_link,
&discard_list);
osc_update_pending(obj, OBD_BRW_WRITE,