X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fllite%2Fllite_capa.c;h=a76dd8b52a8e086c646340ce151574ddebdc5236;hb=676cee300dd01691e2c492c3e8b829681f4bd553;hp=7fcd7040c96cd344b6d519516e2be7bcd54c3b88;hpb=cc2836737d5401ad48e2aaf64db035d11e795ae5;p=fs%2Flustre-release.git diff --git a/lustre/llite/llite_capa.c b/lustre/llite/llite_capa.c index 7fcd704..a76dd8b 100644 --- a/lustre/llite/llite_capa.c +++ b/lustre/llite/llite_capa.c @@ -28,6 +28,8 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2012, Whamcloud, Inc. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -119,11 +121,6 @@ static inline int have_expired_capa(void) return expired; } -static inline int ll_capa_check_stop(void) -{ - return (ll_capa_thread.t_flags & SVC_STOPPING) ? 1: 0; -} - static void sort_add_capa(struct obd_capa *ocapa, cfs_list_t *head) { struct obd_capa *tmp; @@ -180,15 +177,16 @@ static int capa_thread_main(void *unused) cfs_daemonize("ll_capa"); - ll_capa_thread.t_flags = SVC_RUNNING; + thread_set_flags(&ll_capa_thread, SVC_RUNNING); cfs_waitq_signal(&ll_capa_thread.t_ctl_waitq); while (1) { l_wait_event(ll_capa_thread.t_ctl_waitq, - (ll_capa_check_stop() || have_expired_capa()), + !thread_is_running(&ll_capa_thread) || + have_expired_capa(), &lwi); - if (ll_capa_check_stop()) + if (!thread_is_running(&ll_capa_thread)) break; next = NULL; @@ -285,7 +283,7 @@ static int capa_thread_main(void *unused) cfs_spin_unlock(&capa_lock); } - ll_capa_thread.t_flags = SVC_STOPPED; + thread_set_flags(&ll_capa_thread, SVC_STOPPED); cfs_waitq_signal(&ll_capa_thread.t_ctl_waitq); RETURN(0); } @@ -308,17 +306,17 @@ int ll_capa_thread_start(void) RETURN(rc); } cfs_wait_event(ll_capa_thread.t_ctl_waitq, - ll_capa_thread.t_flags & SVC_RUNNING); + thread_is_running(&ll_capa_thread)); RETURN(0); } void ll_capa_thread_stop(void) { - ll_capa_thread.t_flags = SVC_STOPPING; + thread_set_flags(&ll_capa_thread, SVC_STOPPING); cfs_waitq_signal(&ll_capa_thread.t_ctl_waitq); cfs_wait_event(ll_capa_thread.t_ctl_waitq, - ll_capa_thread.t_flags & SVC_STOPPED); + thread_is_stopped(&ll_capa_thread)); } struct obd_capa *ll_osscapa_get(struct inode *inode, __u64 opc)