Searched refs:env (Results 1 - 200 of 278) sorted by relevance

12

/linux-4.1.27/tools/perf/arch/
H A Dcommon.h8 int perf_session_env__lookup_objdump(struct perf_session_env *env);
H A Dcommon.c66 char *env = getenv("PATH"); lookup_path() local
68 if (!env) lookup_path()
71 env = strdup(env); lookup_path()
72 if (!env) lookup_path()
75 path = strtok_r(env, ":", &tmp); lookup_path()
84 free(env); lookup_path()
131 static int perf_session_env__lookup_binutils_path(struct perf_session_env *env, perf_session_env__lookup_binutils_path() argument
141 arch = normalize_arch(env->arch); perf_session_env__lookup_binutils_path()
209 int perf_session_env__lookup_objdump(struct perf_session_env *env) perf_session_env__lookup_objdump() argument
212 * For live mode, env->arch will be NULL and we can use perf_session_env__lookup_objdump()
215 if (env->arch == NULL) perf_session_env__lookup_objdump()
218 return perf_session_env__lookup_binutils_path(env, "objdump", perf_session_env__lookup_objdump()
/linux-4.1.27/drivers/staging/lustre/lustre/obdclass/
H A Dcl_lock.c76 static int cl_lock_invariant_trusted(const struct lu_env *env, cl_lock_invariant_trusted() argument
92 static int cl_lock_invariant(const struct lu_env *env, cl_lock_invariant() argument
98 cl_lock_invariant_trusted(env, lock); cl_lock_invariant()
99 if (!result && env != NULL) cl_lock_invariant()
100 CL_LOCK_DEBUG(D_ERROR, env, lock, "invariant broken"); cl_lock_invariant()
115 static struct cl_thread_counters *cl_lock_counters(const struct lu_env *env, cl_lock_counters() argument
121 info = cl_env_info(env); cl_lock_counters()
127 static void cl_lock_trace0(int level, const struct lu_env *env, cl_lock_trace0() argument
137 env, h->coh_nesting, cl_lock_nr_mutexed(env), cl_lock_trace0()
140 #define cl_lock_trace(level, env, prefix, lock) \
141 cl_lock_trace0(level, env, prefix, lock, __func__, __LINE__)
153 static void cl_lock_lockdep_acquire(const struct lu_env *env, cl_lock_lockdep_acquire() argument
156 cl_lock_counters(env, lock)->ctc_nr_locks_acquired++; cl_lock_lockdep_acquire()
160 static void cl_lock_lockdep_release(const struct lu_env *env, cl_lock_lockdep_release() argument
163 cl_lock_counters(env, lock)->ctc_nr_locks_acquired--; cl_lock_lockdep_release()
171 static void cl_lock_lockdep_acquire(const struct lu_env *env, cl_lock_lockdep_acquire() argument
174 static void cl_lock_lockdep_release(const struct lu_env *env, cl_lock_lockdep_release() argument
248 static void cl_lock_free(const struct lu_env *env, struct cl_lock *lock) cl_lock_free() argument
254 cl_lock_trace(D_DLMTRACE, env, "free lock", lock); cl_lock_free()
262 slice->cls_ops->clo_fini(env, slice); cl_lock_free()
267 cl_object_put(env, obj); cl_lock_free()
283 void cl_lock_put(const struct lu_env *env, struct cl_lock *lock) cl_lock_put() argument
287 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_put()
297 cl_lock_free(env, lock); cl_lock_put()
345 static void cl_lock_finish(const struct lu_env *env, struct cl_lock *lock) cl_lock_finish() argument
347 cl_lock_mutex_get(env, lock); cl_lock_finish()
348 cl_lock_cancel(env, lock); cl_lock_finish()
349 cl_lock_delete(env, lock); cl_lock_finish()
350 cl_lock_mutex_put(env, lock); cl_lock_finish()
351 cl_lock_put(env, lock); cl_lock_finish()
354 static struct cl_lock *cl_lock_alloc(const struct lu_env *env, cl_lock_alloc() argument
387 err = obj->co_ops->coo_lock_init(env, obj, lock, io); cl_lock_alloc()
389 cl_lock_finish(env, lock); cl_lock_alloc()
406 enum cl_lock_state cl_lock_intransit(const struct lu_env *env, cl_lock_intransit() argument
416 cl_lock_state_set(env, lock, CLS_INTRANSIT); cl_lock_intransit()
418 cl_lock_hold_add(env, lock, "intransit", current); cl_lock_intransit()
426 void cl_lock_extransit(const struct lu_env *env, struct cl_lock *lock, cl_lock_extransit() argument
435 cl_lock_state_set(env, lock, state); cl_lock_extransit()
436 cl_lock_unhold(env, lock, "intransit", current); cl_lock_extransit()
455 static int cl_lock_fits_into(const struct lu_env *env, cl_lock_fits_into() argument
462 LINVRNT(cl_lock_invariant_trusted(env, lock)); cl_lock_fits_into()
465 !slice->cls_ops->clo_fits_into(env, slice, need, io)) cl_lock_fits_into()
471 static struct cl_lock *cl_lock_lookup(const struct lu_env *env, cl_lock_lookup() argument
489 cl_lock_fits_into(env, lock, need, io); cl_lock_lookup()
512 static struct cl_lock *cl_lock_find(const struct lu_env *env, cl_lock_find() argument
524 lock = cl_lock_lookup(env, obj, io, need); cl_lock_find()
528 lock = cl_lock_alloc(env, obj, io, need); cl_lock_find()
533 ghost = cl_lock_lookup(env, obj, io, need); cl_lock_find()
547 cl_lock_finish(env, lock); cl_lock_find()
560 struct cl_lock *cl_lock_peek(const struct lu_env *env, const struct cl_io *io, cl_lock_peek() argument
573 lock = cl_lock_lookup(env, obj, io, need); cl_lock_peek()
578 cl_lock_mutex_get(env, lock); cl_lock_peek()
581 cl_lock_state_wait(env, lock); cl_lock_peek()
583 cl_lock_mutex_put(env, lock); cl_lock_peek()
584 cl_lock_put(env, lock); cl_lock_peek()
589 cl_lock_hold_add(env, lock, scope, source); cl_lock_peek()
590 cl_lock_user_add(env, lock); cl_lock_peek()
592 cl_use_try(env, lock, 1); cl_lock_peek()
594 cl_lock_mutex_put(env, lock); cl_lock_peek()
595 cl_lock_lockdep_acquire(env, lock, 0); cl_lock_peek()
596 cl_lock_put(env, lock); cl_lock_peek()
598 cl_unuse_try(env, lock); cl_lock_peek()
599 cl_lock_unhold(env, lock, scope, source); cl_lock_peek()
600 cl_lock_mutex_put(env, lock); cl_lock_peek()
601 cl_lock_put(env, lock); cl_lock_peek()
630 static void cl_lock_mutex_tail(const struct lu_env *env, struct cl_lock *lock) cl_lock_mutex_tail() argument
634 counters = cl_lock_counters(env, lock); cl_lock_mutex_tail()
638 cl_lock_trace(D_TRACE, env, "got mutex", lock); cl_lock_mutex_tail()
651 void cl_lock_mutex_get(const struct lu_env *env, struct cl_lock *lock) cl_lock_mutex_get() argument
653 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_mutex_get()
668 info = cl_env_info(env); cl_lock_mutex_get()
675 cl_lock_mutex_tail(env, lock); cl_lock_mutex_get()
690 int cl_lock_mutex_try(const struct lu_env *env, struct cl_lock *lock) cl_lock_mutex_try() argument
694 LINVRNT(cl_lock_invariant_trusted(env, lock)); cl_lock_mutex_try()
699 cl_lock_mutex_tail(env, lock); cl_lock_mutex_try()
703 cl_lock_mutex_tail(env, lock); cl_lock_mutex_try()
717 void cl_lock_mutex_put(const struct lu_env *env, struct cl_lock *lock) cl_lock_mutex_put() argument
721 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_mutex_put()
726 counters = cl_lock_counters(env, lock); cl_lock_mutex_put()
729 cl_lock_trace(D_TRACE, env, "put mutex", lock); cl_lock_mutex_put()
751 int cl_lock_nr_mutexed(const struct lu_env *env) cl_lock_nr_mutexed() argument
762 info = cl_env_info(env); cl_lock_nr_mutexed()
769 static void cl_lock_cancel0(const struct lu_env *env, struct cl_lock *lock) cl_lock_cancel0() argument
772 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_cancel0()
780 slice->cls_ops->clo_cancel(env, slice); cl_lock_cancel0()
785 static void cl_lock_delete0(const struct lu_env *env, struct cl_lock *lock) cl_lock_delete0() argument
791 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_delete0()
797 cl_lock_state_set(env, lock, CLS_FREEING); cl_lock_delete0()
808 cl_lock_put(env, lock); cl_lock_delete0()
817 slice->cls_ops->clo_delete(env, slice); cl_lock_delete0()
837 static void cl_lock_hold_mod(const struct lu_env *env, struct cl_lock *lock, cl_lock_hold_mod() argument
846 counters = &cl_env_info(env)->clt_counters[CNL_TOP]; cl_lock_hold_mod()
856 static void cl_lock_used_mod(const struct lu_env *env, struct cl_lock *lock, cl_lock_used_mod() argument
865 counters = &cl_env_info(env)->clt_counters[CNL_TOP]; cl_lock_used_mod()
871 void cl_lock_hold_release(const struct lu_env *env, struct cl_lock *lock, cl_lock_hold_release() argument
875 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_hold_release()
878 cl_lock_trace(D_DLMTRACE, env, "hold release lock", lock); cl_lock_hold_release()
880 cl_lock_hold_mod(env, lock, -1); cl_lock_hold_release()
882 CL_LOCK_ASSERT(lock->cll_state != CLS_HELD, env, lock); cl_lock_hold_release()
893 cl_lock_cancel0(env, lock); cl_lock_hold_release()
898 cl_lock_delete0(env, lock); cl_lock_hold_release()
923 int cl_lock_state_wait(const struct lu_env *env, struct cl_lock *lock) cl_lock_state_wait() argument
930 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_state_wait()
934 cl_lock_trace(D_DLMTRACE, env, "state wait lock", lock); cl_lock_state_wait()
945 cl_lock_mutex_put(env, lock); cl_lock_state_wait()
947 LASSERT(cl_lock_nr_mutexed(env) == 0); cl_lock_state_wait()
958 cl_lock_mutex_get(env, lock); cl_lock_state_wait()
969 static void cl_lock_state_signal(const struct lu_env *env, struct cl_lock *lock, cl_lock_state_signal() argument
975 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_state_signal()
979 slice->cls_ops->clo_state(env, slice, state); cl_lock_state_signal()
990 void cl_lock_signal(const struct lu_env *env, struct cl_lock *lock) cl_lock_signal() argument
992 cl_lock_trace(D_DLMTRACE, env, "state signal lock", lock); cl_lock_signal()
993 cl_lock_state_signal(env, lock, lock->cll_state); cl_lock_signal()
1007 void cl_lock_state_set(const struct lu_env *env, struct cl_lock *lock, cl_lock_state_set() argument
1022 cl_lock_state_signal(env, lock, state); cl_lock_state_set()
1028 static int cl_unuse_try_internal(const struct lu_env *env, struct cl_lock *lock) cl_unuse_try_internal() argument
1037 LINVRNT(cl_lock_invariant(env, lock)); cl_unuse_try_internal()
1044 result = slice->cls_ops->clo_unuse(env, slice); cl_unuse_try_internal()
1061 int cl_use_try(const struct lu_env *env, struct cl_lock *lock, int atomic) cl_use_try() argument
1067 cl_lock_trace(D_DLMTRACE, env, "use lock", lock); cl_use_try()
1074 state = cl_lock_intransit(env, lock); cl_use_try()
1077 result = slice->cls_ops->clo_use(env, slice); cl_use_try()
1103 rc = cl_unuse_try_internal(env, lock); cl_use_try()
1110 cl_lock_extransit(env, lock, state); cl_use_try()
1119 static int cl_enqueue_kick(const struct lu_env *env, cl_enqueue_kick() argument
1129 result = slice->cls_ops->clo_enqueue(env, cl_enqueue_kick()
1152 int cl_enqueue_try(const struct lu_env *env, struct cl_lock *lock, cl_enqueue_try() argument
1157 cl_lock_trace(D_DLMTRACE, env, "enqueue lock", lock); cl_enqueue_try()
1167 cl_lock_state_set(env, lock, CLS_QUEUING); cl_enqueue_try()
1171 result = cl_enqueue_kick(env, lock, io, flags); cl_enqueue_try()
1175 cl_lock_state_set(env, lock, CLS_ENQUEUED); cl_enqueue_try()
1183 result = cl_use_try(env, lock, 0); cl_enqueue_try()
1209 int cl_lock_enqueue_wait(const struct lu_env *env, cl_lock_enqueue_wait() argument
1223 cl_lock_mutex_put(env, lock); cl_lock_enqueue_wait()
1224 LASSERT(cl_lock_nr_mutexed(env) == 0); cl_lock_enqueue_wait()
1226 cl_lock_mutex_get(env, conflict); cl_lock_enqueue_wait()
1227 cl_lock_trace(D_DLMTRACE, env, "enqueue wait", conflict); cl_lock_enqueue_wait()
1228 cl_lock_cancel(env, conflict); cl_lock_enqueue_wait()
1229 cl_lock_delete(env, conflict); cl_lock_enqueue_wait()
1232 rc = cl_lock_state_wait(env, conflict); cl_lock_enqueue_wait()
1236 cl_lock_mutex_put(env, conflict); cl_lock_enqueue_wait()
1238 cl_lock_put(env, conflict); cl_lock_enqueue_wait()
1241 cl_lock_mutex_get(env, lock); cl_lock_enqueue_wait()
1248 static int cl_enqueue_locked(const struct lu_env *env, struct cl_lock *lock, cl_enqueue_locked() argument
1254 LINVRNT(cl_lock_invariant(env, lock)); cl_enqueue_locked()
1257 cl_lock_user_add(env, lock); cl_enqueue_locked()
1259 result = cl_enqueue_try(env, lock, io, enqflags); cl_enqueue_locked()
1262 result = cl_lock_enqueue_wait(env, lock, 1); cl_enqueue_locked()
1264 result = cl_lock_state_wait(env, lock); cl_enqueue_locked()
1271 cl_unuse_try(env, lock); cl_enqueue_locked()
1287 int cl_enqueue(const struct lu_env *env, struct cl_lock *lock, cl_enqueue() argument
1292 cl_lock_lockdep_acquire(env, lock, enqflags); cl_enqueue()
1293 cl_lock_mutex_get(env, lock); cl_enqueue()
1294 result = cl_enqueue_locked(env, lock, io, enqflags); cl_enqueue()
1295 cl_lock_mutex_put(env, lock); cl_enqueue()
1297 cl_lock_lockdep_release(env, lock); cl_enqueue()
1316 int cl_unuse_try(const struct lu_env *env, struct cl_lock *lock) cl_unuse_try() argument
1321 cl_lock_trace(D_DLMTRACE, env, "unuse lock", lock); cl_unuse_try()
1324 cl_lock_user_del(env, lock); cl_unuse_try()
1331 cl_lock_user_del(env, lock); cl_unuse_try()
1341 state = cl_lock_intransit(env, lock); cl_unuse_try()
1343 result = cl_unuse_try_internal(env, lock); cl_unuse_try()
1346 cl_lock_user_del(env, lock); cl_unuse_try()
1361 cl_lock_extransit(env, lock, state); cl_unuse_try()
1376 cl_lock_extransit(env, lock, state); cl_unuse_try()
1382 static void cl_unuse_locked(const struct lu_env *env, struct cl_lock *lock) cl_unuse_locked() argument
1386 result = cl_unuse_try(env, lock); cl_unuse_locked()
1388 CL_LOCK_DEBUG(D_ERROR, env, lock, "unuse return %d\n", result); cl_unuse_locked()
1394 void cl_unuse(const struct lu_env *env, struct cl_lock *lock) cl_unuse() argument
1396 cl_lock_mutex_get(env, lock); cl_unuse()
1397 cl_unuse_locked(env, lock); cl_unuse()
1398 cl_lock_mutex_put(env, lock); cl_unuse()
1399 cl_lock_lockdep_release(env, lock); cl_unuse()
1413 int cl_wait_try(const struct lu_env *env, struct cl_lock *lock) cl_wait_try() argument
1418 cl_lock_trace(D_DLMTRACE, env, "wait lock try", lock); cl_wait_try()
1421 LINVRNT(cl_lock_invariant(env, lock)); cl_wait_try()
1446 result = slice->cls_ops->clo_wait(env, slice); cl_wait_try()
1454 cl_lock_state_set(env, lock, CLS_HELD); cl_wait_try()
1470 int cl_wait(const struct lu_env *env, struct cl_lock *lock) cl_wait() argument
1474 cl_lock_mutex_get(env, lock); cl_wait()
1476 LINVRNT(cl_lock_invariant(env, lock)); cl_wait()
1482 result = cl_wait_try(env, lock); cl_wait()
1484 result = cl_lock_state_wait(env, lock); cl_wait()
1491 cl_unuse_try(env, lock); cl_wait()
1492 cl_lock_lockdep_release(env, lock); cl_wait()
1494 cl_lock_trace(D_DLMTRACE, env, "wait lock", lock); cl_wait()
1495 cl_lock_mutex_put(env, lock); cl_wait()
1505 unsigned long cl_lock_weigh(const struct lu_env *env, struct cl_lock *lock) cl_lock_weigh() argument
1512 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_weigh()
1517 ounce = slice->cls_ops->clo_weigh(env, slice); cl_lock_weigh()
1537 int cl_lock_modify(const struct lu_env *env, struct cl_lock *lock, cl_lock_modify() argument
1545 cl_lock_trace(D_DLMTRACE, env, "modify lock", lock); cl_lock_modify()
1549 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_modify()
1553 result = slice->cls_ops->clo_modify(env, slice, desc); cl_lock_modify()
1558 CL_LOCK_DEBUG(D_DLMTRACE, env, lock, " -> "DDESCR"@"DFID"\n", cl_lock_modify()
1577 void cl_lock_closure_init(const struct lu_env *env, cl_lock_closure_init() argument
1582 LINVRNT(cl_lock_invariant(env, origin)); cl_lock_closure_init()
1601 int cl_lock_closure_build(const struct lu_env *env, struct cl_lock *lock, cl_lock_closure_build() argument
1608 LINVRNT(cl_lock_invariant(env, closure->clc_origin)); cl_lock_closure_build()
1610 result = cl_lock_enclosure(env, lock, closure); cl_lock_closure_build()
1614 result = slice->cls_ops->clo_closure(env, slice, cl_lock_closure_build()
1622 cl_lock_disclosure(env, closure); cl_lock_closure_build()
1634 int cl_lock_enclosure(const struct lu_env *env, struct cl_lock *lock, cl_lock_enclosure() argument
1639 cl_lock_trace(D_DLMTRACE, env, "enclosure lock", lock); cl_lock_enclosure()
1640 if (!cl_lock_mutex_try(env, lock)) { cl_lock_enclosure()
1651 cl_lock_mutex_put(env, lock); cl_lock_enclosure()
1654 cl_lock_disclosure(env, closure); cl_lock_enclosure()
1658 cl_lock_mutex_put(env, closure->clc_origin); cl_lock_enclosure()
1660 LASSERT(cl_lock_nr_mutexed(env) == 0); cl_lock_enclosure()
1661 cl_lock_mutex_get(env, lock); cl_lock_enclosure()
1662 cl_lock_mutex_put(env, lock); cl_lock_enclosure()
1664 cl_lock_mutex_get(env, closure->clc_origin); cl_lock_enclosure()
1666 cl_lock_put(env, lock); cl_lock_enclosure()
1675 void cl_lock_disclosure(const struct lu_env *env, cl_lock_disclosure() argument
1681 cl_lock_trace(D_DLMTRACE, env, "disclosure lock", closure->clc_origin); cl_lock_disclosure()
1685 cl_lock_mutex_put(env, scan); cl_lock_disclosure()
1687 cl_lock_put(env, scan); cl_lock_disclosure()
1715 * cl_lock_nr_mutexed(env) == 1)
1723 void cl_lock_delete(const struct lu_env *env, struct cl_lock *lock) cl_lock_delete() argument
1726 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_delete()
1728 cl_lock_nr_mutexed(env) == 1)); cl_lock_delete()
1730 cl_lock_trace(D_DLMTRACE, env, "delete lock", lock); cl_lock_delete()
1732 cl_lock_delete0(env, lock); cl_lock_delete()
1748 void cl_lock_error(const struct lu_env *env, struct cl_lock *lock, int error) cl_lock_error() argument
1751 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_error()
1754 cl_lock_trace(D_DLMTRACE, env, "set lock error", lock); cl_lock_error()
1756 cl_lock_signal(env, lock); cl_lock_error()
1757 cl_lock_cancel(env, lock); cl_lock_error()
1758 cl_lock_delete(env, lock); cl_lock_error()
1774 void cl_lock_cancel(const struct lu_env *env, struct cl_lock *lock) cl_lock_cancel() argument
1777 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_cancel()
1779 cl_lock_trace(D_DLMTRACE, env, "cancel lock", lock); cl_lock_cancel()
1781 cl_lock_cancel0(env, lock); cl_lock_cancel()
1791 struct cl_lock *cl_lock_at_pgoff(const struct lu_env *env, cl_lock_at_pgoff() argument
1802 need = &cl_env_info(env)->clt_descr; cl_lock_at_pgoff()
1856 static int check_and_discard_cb(const struct lu_env *env, struct cl_io *io, check_and_discard_cb() argument
1859 struct cl_thread_info *info = cl_env_info(env); check_and_discard_cb()
1867 tmp = cl_lock_at_pgoff(env, lock->cll_descr.cld_obj, index, check_and_discard_cb()
1877 cl_lock_put(env, tmp); check_and_discard_cb()
1878 } else if (cl_page_own(env, io, page) == 0) { check_and_discard_cb()
1880 cl_page_unmap(env, io, page); check_and_discard_cb()
1881 cl_page_discard(env, io, page); check_and_discard_cb()
1882 cl_page_disown(env, io, page); check_and_discard_cb()
1892 static int discard_cb(const struct lu_env *env, struct cl_io *io, discard_cb() argument
1895 struct cl_thread_info *info = cl_env_info(env); discard_cb()
1900 !PageWriteback(cl_page_vmpage(env, page)))); discard_cb()
1902 !PageDirty(cl_page_vmpage(env, page)))); discard_cb()
1905 if (cl_page_own(env, io, page) == 0) { discard_cb()
1907 cl_page_unmap(env, io, page); discard_cb()
1908 cl_page_discard(env, io, page); discard_cb()
1909 cl_page_disown(env, io, page); discard_cb()
1925 int cl_lock_discard_pages(const struct lu_env *env, struct cl_lock *lock) cl_lock_discard_pages() argument
1927 struct cl_thread_info *info = cl_env_info(env); cl_lock_discard_pages()
1934 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_discard_pages()
1938 result = cl_io_init(env, io, CIT_MISC, io->ci_obj); cl_lock_discard_pages()
1945 res = cl_page_gang_lookup(env, descr->cld_obj, io, cl_lock_discard_pages()
1955 cl_io_fini(env, io); cl_lock_discard_pages()
1968 void cl_locks_prune(const struct lu_env *env, struct cl_object *obj, int cancel) cl_locks_prune() argument
1990 cl_lock_mutex_get(env, lock); cl_locks_prune()
1996 cl_lock_mutex_put(env, lock); cl_locks_prune()
2004 cl_lock_cancel(env, lock); cl_locks_prune()
2005 cl_lock_delete(env, lock); cl_locks_prune()
2007 cl_lock_mutex_put(env, lock); cl_locks_prune()
2009 cl_lock_put(env, lock); cl_locks_prune()
2016 static struct cl_lock *cl_lock_hold_mutex(const struct lu_env *env, cl_lock_hold_mutex() argument
2024 lock = cl_lock_find(env, io, need); cl_lock_hold_mutex()
2027 cl_lock_mutex_get(env, lock); cl_lock_hold_mutex()
2030 cl_lock_hold_mod(env, lock, +1); cl_lock_hold_mutex()
2035 cl_lock_mutex_put(env, lock); cl_lock_hold_mutex()
2036 cl_lock_put(env, lock); cl_lock_hold_mutex()
2048 struct cl_lock *cl_lock_hold(const struct lu_env *env, const struct cl_io *io, cl_lock_hold() argument
2054 lock = cl_lock_hold_mutex(env, io, need, scope, source); cl_lock_hold()
2056 cl_lock_mutex_put(env, lock); cl_lock_hold()
2065 struct cl_lock *cl_lock_request(const struct lu_env *env, struct cl_io *io, cl_lock_request() argument
2074 lock = cl_lock_hold_mutex(env, io, need, scope, source); cl_lock_request()
2078 rc = cl_enqueue_locked(env, lock, io, enqflags); cl_lock_request()
2080 if (cl_lock_fits_into(env, lock, need, io)) { cl_lock_request()
2082 cl_lock_mutex_put(env, lock); cl_lock_request()
2083 cl_lock_lockdep_acquire(env, lock, cl_lock_request()
2089 cl_unuse_locked(env, lock); cl_lock_request()
2091 cl_lock_trace(D_DLMTRACE, env, cl_lock_request()
2093 cl_lock_hold_release(env, lock, scope, source); cl_lock_request()
2094 cl_lock_mutex_put(env, lock); cl_lock_request()
2096 cl_lock_put(env, lock); cl_lock_request()
2111 void cl_lock_hold_add(const struct lu_env *env, struct cl_lock *lock, cl_lock_hold_add() argument
2115 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_hold_add()
2118 cl_lock_hold_mod(env, lock, +1); cl_lock_hold_add()
2129 void cl_lock_unhold(const struct lu_env *env, struct cl_lock *lock, cl_lock_unhold() argument
2132 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_unhold()
2133 cl_lock_hold_release(env, lock, scope, source); cl_lock_unhold()
2135 cl_lock_put(env, lock); cl_lock_unhold()
2142 void cl_lock_release(const struct lu_env *env, struct cl_lock *lock, cl_lock_release() argument
2145 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_release()
2146 cl_lock_trace(D_DLMTRACE, env, "release lock", lock); cl_lock_release()
2147 cl_lock_mutex_get(env, lock); cl_lock_release()
2148 cl_lock_hold_release(env, lock, scope, source); cl_lock_release()
2149 cl_lock_mutex_put(env, lock); cl_lock_release()
2151 cl_lock_put(env, lock); cl_lock_release()
2155 void cl_lock_user_add(const struct lu_env *env, struct cl_lock *lock) cl_lock_user_add() argument
2158 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_user_add()
2160 cl_lock_used_mod(env, lock, +1); cl_lock_user_add()
2164 void cl_lock_user_del(const struct lu_env *env, struct cl_lock *lock) cl_lock_user_del() argument
2167 LINVRNT(cl_lock_invariant(env, lock)); cl_lock_user_del()
2170 cl_lock_used_mod(env, lock, -1); cl_lock_user_del()
2194 void cl_lock_descr_print(const struct lu_env *env, void *cookie, cl_lock_descr_print() argument
2201 (*printer)(env, cookie, DDESCR"@"DFID, PDESCR(descr), PFID(fid)); cl_lock_descr_print()
2208 void cl_lock_print(const struct lu_env *env, void *cookie, cl_lock_print() argument
2212 (*printer)(env, cookie, "lock@%p[%d %d %d %d %d %08lx] ", cl_lock_print()
2216 cl_lock_descr_print(env, cookie, printer, &lock->cll_descr); cl_lock_print()
2217 (*printer)(env, cookie, " {\n"); cl_lock_print()
2220 (*printer)(env, cookie, " %s@%p: ", cl_lock_print()
2224 slice->cls_ops->clo_print(env, cookie, printer, slice); cl_lock_print()
2225 (*printer)(env, cookie, "\n"); cl_lock_print()
2227 (*printer)(env, cookie, "} lock@%p\n", lock); cl_lock_print()
H A Dcl_page.c51 static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg,
54 # define PASSERT(env, page, expr) \
57 CL_PAGE_DEBUG(D_ERROR, (env), (page), #expr "\n"); \
62 # define PINVRNT(env, page, exp) \
63 ((void)sizeof(env), (void)sizeof(page), (void)sizeof !!(exp))
154 int cl_page_gang_lookup(const struct lu_env *env, struct cl_object *obj, cl_page_gang_lookup() argument
172 pvec = cl_env_info(env)->clt_pvec; cl_page_gang_lookup()
196 PASSERT(env, page, slice != NULL); cl_page_gang_lookup()
226 res = (*cb)(env, io, page, cbdata); cl_page_gang_lookup()
229 cl_page_put(env, page); cl_page_gang_lookup()
248 static void cl_page_free(const struct lu_env *env, struct cl_page *page) cl_page_free() argument
253 PASSERT(env, page, list_empty(&page->cp_batch)); cl_page_free()
254 PASSERT(env, page, page->cp_owner == NULL); cl_page_free()
255 PASSERT(env, page, page->cp_req == NULL); cl_page_free()
256 PASSERT(env, page, page->cp_parent == NULL); cl_page_free()
257 PASSERT(env, page, page->cp_state == CPS_FREEING); cl_page_free()
266 slice->cpl_ops->cpo_fini(env, slice); cl_page_free()
271 cl_object_put(env, obj); cl_page_free()
287 static struct cl_page *cl_page_alloc(const struct lu_env *env, cl_page_alloc() argument
317 result = o->co_ops->coo_page_init(env, o, cl_page_alloc()
320 cl_page_delete0(env, page, 0); cl_page_alloc()
321 cl_page_free(env, page); cl_page_alloc()
349 static struct cl_page *cl_page_find0(const struct lu_env *env, cl_page_find0() argument
383 PINVRNT(env, page, cl_page_find0()
385 cl_page_vmpage(env, page) == vmpage && cl_page_find0()
396 page = cl_page_alloc(env, o, idx, vmpage, type); cl_page_find0()
431 CL_PAGE_DEBUG(D_ERROR, env, ghost, cl_page_find0()
444 cl_page_delete0(env, ghost, 0); cl_page_find0()
445 cl_page_free(env, ghost); cl_page_find0()
450 struct cl_page *cl_page_find(const struct lu_env *env, struct cl_object *o, cl_page_find() argument
454 return cl_page_find0(env, o, idx, vmpage, type, NULL); cl_page_find()
459 struct cl_page *cl_page_find_sub(const struct lu_env *env, struct cl_object *o, cl_page_find_sub() argument
463 return cl_page_find0(env, o, idx, vmpage, parent->cp_type, parent); cl_page_find_sub()
503 static void cl_page_state_set0(const struct lu_env *env, cl_page_state_set0() argument
551 PASSERT(env, page, allowed_transitions[old][state]); cl_page_state_set0()
552 CL_PAGE_HEADER(D_TRACE, env, page, "%d -> %d\n", old, state); cl_page_state_set0()
554 PASSERT(env, page, page->cp_state == old); cl_page_state_set0()
555 PASSERT(env, page, cl_page_state_set0()
564 static void cl_page_state_set(const struct lu_env *env, cl_page_state_set() argument
567 cl_page_state_set0(env, page, state); cl_page_state_set()
593 void cl_page_put(const struct lu_env *env, struct cl_page *page) cl_page_put() argument
595 PASSERT(env, page, atomic_read(&page->cp_ref) > !!page->cp_parent); cl_page_put()
597 CL_PAGE_HEADER(D_TRACE, env, page, "%d\n", cl_page_put()
604 PASSERT(env, page, page->cp_owner == NULL); cl_page_put()
605 PASSERT(env, page, list_empty(&page->cp_batch)); cl_page_put()
610 cl_page_free(env, page); cl_page_put()
618 struct page *cl_page_vmpage(const struct lu_env *env, struct cl_page *page) cl_page_vmpage() argument
630 return slice->cpl_ops->cpo_vmpage(env, slice); cl_page_vmpage()
769 static int cl_page_invoke(const struct lu_env *env, cl_page_invoke() argument
773 PINVRNT(env, page, cl_object_same(page->cp_obj, io->ci_obj)); cl_page_invoke()
774 return CL_PAGE_INVOKE(env, page, op, cl_page_invoke()
780 static void cl_page_invoid(const struct lu_env *env, cl_page_invoid() argument
784 PINVRNT(env, page, cl_object_same(page->cp_obj, io->ci_obj)); cl_page_invoid()
785 CL_PAGE_INVOID(env, page, op, cl_page_invoid()
810 void cl_page_disown0(const struct lu_env *env, cl_page_disown0() argument
816 PINVRNT(env, pg, state == CPS_OWNED || state == CPS_FREEING); cl_page_disown0()
817 PINVRNT(env, pg, cl_page_invariant(pg)); cl_page_disown0()
821 cl_page_state_set(env, pg, CPS_CACHED); cl_page_disown0()
827 CL_PAGE_INVOID_REVERSE(env, pg, CL_PAGE_OP(cpo_disown), cl_page_disown0()
863 static int cl_page_own0(const struct lu_env *env, struct cl_io *io, cl_page_own0() argument
868 PINVRNT(env, pg, !cl_page_is_owned(pg, io)); cl_page_own0()
876 result = CL_PAGE_INVOKE(env, pg, CL_PAGE_OP(cpo_own), cl_page_own0()
882 PASSERT(env, pg, pg->cp_owner == NULL); cl_page_own0()
883 PASSERT(env, pg, pg->cp_req == NULL); cl_page_own0()
888 cl_page_state_set(env, pg, CPS_OWNED); cl_page_own0()
890 cl_page_disown0(env, io, pg); cl_page_own0()
895 PINVRNT(env, pg, ergo(result == 0, cl_page_invariant(pg))); cl_page_own0()
904 int cl_page_own(const struct lu_env *env, struct cl_io *io, struct cl_page *pg) cl_page_own() argument
906 return cl_page_own0(env, io, pg, 0); cl_page_own()
915 int cl_page_own_try(const struct lu_env *env, struct cl_io *io, cl_page_own_try() argument
918 return cl_page_own0(env, io, pg, 1); cl_page_own_try()
933 void cl_page_assume(const struct lu_env *env, cl_page_assume() argument
936 PINVRNT(env, pg, cl_object_same(pg->cp_obj, io->ci_obj)); cl_page_assume()
941 cl_page_invoid(env, io, pg, CL_PAGE_OP(cpo_assume)); cl_page_assume()
942 PASSERT(env, pg, pg->cp_owner == NULL); cl_page_assume()
946 cl_page_state_set(env, pg, CPS_OWNED); cl_page_assume()
961 void cl_page_unassume(const struct lu_env *env, cl_page_unassume() argument
964 PINVRNT(env, pg, cl_page_is_owned(pg, io)); cl_page_unassume()
965 PINVRNT(env, pg, cl_page_invariant(pg)); cl_page_unassume()
970 cl_page_state_set(env, pg, CPS_CACHED); cl_page_unassume()
971 CL_PAGE_INVOID_REVERSE(env, pg, CL_PAGE_OP(cpo_unassume), cl_page_unassume()
989 void cl_page_disown(const struct lu_env *env, cl_page_disown() argument
992 PINVRNT(env, pg, cl_page_is_owned(pg, io)); cl_page_disown()
996 cl_page_disown0(env, io, pg); cl_page_disown()
1010 void cl_page_discard(const struct lu_env *env, cl_page_discard() argument
1013 PINVRNT(env, pg, cl_page_is_owned(pg, io)); cl_page_discard()
1014 PINVRNT(env, pg, cl_page_invariant(pg)); cl_page_discard()
1016 cl_page_invoid(env, io, pg, CL_PAGE_OP(cpo_discard)); cl_page_discard()
1025 static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg, cl_page_delete0() argument
1030 PASSERT(env, pg, pg == cl_page_top(pg)); cl_page_delete0()
1031 PASSERT(env, pg, pg->cp_state != CPS_FREEING); cl_page_delete0()
1046 cl_page_export(env, pg, 0); cl_page_delete0()
1047 cl_page_state_set0(env, pg, CPS_FREEING); cl_page_delete0()
1049 CL_PAGE_INVOID(env, pg, CL_PAGE_OP(cpo_delete), cl_page_delete0()
1066 PASSERT(env, tmp, value == tmp); cl_page_delete0()
1067 PASSERT(env, tmp, hdr->coh_pages > 0); cl_page_delete0()
1070 cl_page_put(env, tmp); cl_page_delete0()
1100 void cl_page_delete(const struct lu_env *env, struct cl_page *pg) cl_page_delete() argument
1102 PINVRNT(env, pg, cl_page_invariant(pg)); cl_page_delete()
1103 cl_page_delete0(env, pg, 1); cl_page_delete()
1116 int cl_page_unmap(const struct lu_env *env, cl_page_unmap() argument
1119 PINVRNT(env, pg, cl_page_is_owned(pg, io)); cl_page_unmap()
1120 PINVRNT(env, pg, cl_page_invariant(pg)); cl_page_unmap()
1122 return cl_page_invoke(env, io, pg, CL_PAGE_OP(cpo_unmap)); cl_page_unmap()
1135 void cl_page_export(const struct lu_env *env, struct cl_page *pg, int uptodate) cl_page_export() argument
1137 PINVRNT(env, pg, cl_page_invariant(pg)); cl_page_export()
1138 CL_PAGE_INVOID(env, pg, CL_PAGE_OP(cpo_export), cl_page_export()
1148 int cl_page_is_vmlocked(const struct lu_env *env, const struct cl_page *pg) cl_page_is_vmlocked() argument
1156 PASSERT(env, pg, slice->cpl_ops->cpo_is_vmlocked != NULL); cl_page_is_vmlocked()
1162 result = slice->cpl_ops->cpo_is_vmlocked(env, slice); cl_page_is_vmlocked()
1163 PASSERT(env, pg, result == -EBUSY || result == -ENODATA); cl_page_is_vmlocked()
1173 static void cl_page_io_start(const struct lu_env *env, cl_page_io_start() argument
1180 cl_page_state_set(env, pg, cl_req_type_state(crt)); cl_page_io_start()
1190 int cl_page_prep(const struct lu_env *env, struct cl_io *io, cl_page_prep() argument
1195 PINVRNT(env, pg, cl_page_is_owned(pg, io)); cl_page_prep()
1196 PINVRNT(env, pg, cl_page_invariant(pg)); cl_page_prep()
1197 PINVRNT(env, pg, crt < CRT_NR); cl_page_prep()
1206 result = cl_page_invoke(env, io, pg, CL_PAGE_OP(io[crt].cpo_prep)); cl_page_prep()
1208 cl_page_io_start(env, pg, crt); cl_page_prep()
1212 PageWriteback(cl_page_vmpage(env, pg))))); cl_page_prep()
1213 CL_PAGE_HEADER(D_TRACE, env, pg, "%d %d\n", crt, result); cl_page_prep()
1233 void cl_page_completion(const struct lu_env *env, cl_page_completion() argument
1238 PASSERT(env, pg, crt < CRT_NR); cl_page_completion()
1240 PASSERT(env, pg, pg->cp_req == NULL); cl_page_completion()
1241 PASSERT(env, pg, pg->cp_state == cl_req_type_state(crt)); cl_page_completion()
1243 CL_PAGE_HEADER(D_TRACE, env, pg, "%d %d\n", crt, ioret); cl_page_completion()
1245 PASSERT(env, pg, !(pg->cp_flags & CPF_READ_COMPLETED)); cl_page_completion()
1249 cl_page_state_set(env, pg, CPS_CACHED); cl_page_completion()
1252 CL_PAGE_INVOID_REVERSE(env, pg, CL_PAGE_OP(io[crt].cpo_completion), cl_page_completion()
1256 LASSERT(cl_page_is_vmlocked(env, pg)); cl_page_completion()
1265 cl_page_put(env, pg); cl_page_completion()
1281 int cl_page_make_ready(const struct lu_env *env, struct cl_page *pg, cl_page_make_ready() argument
1286 PINVRNT(env, pg, crt < CRT_NR); cl_page_make_ready()
1290 result = CL_PAGE_INVOKE(env, pg, CL_PAGE_OP(io[crt].cpo_make_ready), cl_page_make_ready()
1294 PASSERT(env, pg, pg->cp_state == CPS_CACHED); cl_page_make_ready()
1295 cl_page_io_start(env, pg, crt); cl_page_make_ready()
1297 CL_PAGE_HEADER(D_TRACE, env, pg, "%d %d\n", crt, result); cl_page_make_ready()
1314 int cl_page_cache_add(const struct lu_env *env, struct cl_io *io, cl_page_cache_add() argument
1320 PINVRNT(env, pg, crt < CRT_NR); cl_page_cache_add()
1321 PINVRNT(env, pg, cl_page_is_owned(pg, io)); cl_page_cache_add()
1322 PINVRNT(env, pg, cl_page_invariant(pg)); cl_page_cache_add()
1331 result = scan->cpl_ops->io[crt].cpo_cache_add(env, scan, io); cl_page_cache_add()
1335 CL_PAGE_HEADER(D_TRACE, env, pg, "%d %d\n", crt, result); cl_page_cache_add()
1348 int cl_page_flush(const struct lu_env *env, struct cl_io *io, cl_page_flush() argument
1353 PINVRNT(env, pg, cl_page_is_owned(pg, io)); cl_page_flush()
1354 PINVRNT(env, pg, cl_page_invariant(pg)); cl_page_flush()
1356 result = cl_page_invoke(env, io, pg, CL_PAGE_OP(cpo_flush)); cl_page_flush()
1358 CL_PAGE_HEADER(D_TRACE, env, pg, "%d\n", result); cl_page_flush()
1370 int cl_page_is_under_lock(const struct lu_env *env, struct cl_io *io, cl_page_is_under_lock() argument
1375 PINVRNT(env, page, cl_page_invariant(page)); cl_page_is_under_lock()
1377 rc = CL_PAGE_INVOKE(env, page, CL_PAGE_OP(cpo_is_under_lock), cl_page_is_under_lock()
1381 PASSERT(env, page, rc != 0); cl_page_is_under_lock()
1386 static int page_prune_cb(const struct lu_env *env, struct cl_io *io, page_prune_cb() argument
1389 cl_page_own(env, io, page); page_prune_cb()
1390 cl_page_unmap(env, io, page); page_prune_cb()
1391 cl_page_discard(env, io, page); page_prune_cb()
1392 cl_page_disown(env, io, page); page_prune_cb()
1399 int cl_pages_prune(const struct lu_env *env, struct cl_object *clobj) cl_pages_prune() argument
1406 info = cl_env_info(env); cl_pages_prune()
1415 result = cl_io_init(env, io, CIT_MISC, obj); cl_pages_prune()
1417 cl_io_fini(env, io); cl_pages_prune()
1422 result = cl_page_gang_lookup(env, obj, io, 0, CL_PAGE_EOF, cl_pages_prune()
1428 cl_io_fini(env, io); cl_pages_prune()
1438 void cl_page_clip(const struct lu_env *env, struct cl_page *pg, cl_page_clip() argument
1441 PINVRNT(env, pg, cl_page_invariant(pg)); cl_page_clip()
1443 CL_PAGE_HEADER(D_TRACE, env, pg, "%d %d\n", from, to); cl_page_clip()
1444 CL_PAGE_INVOID(env, pg, CL_PAGE_OP(cpo_clip), cl_page_clip()
1454 void cl_page_header_print(const struct lu_env *env, void *cookie, cl_page_header_print() argument
1457 (*printer)(env, cookie, cl_page_header_print()
1469 void cl_page_print(const struct lu_env *env, void *cookie, cl_page_print() argument
1476 cl_page_header_print(env, cookie, printer, scan); cl_page_print()
1477 CL_PAGE_INVOKE(env, (struct cl_page *)pg, CL_PAGE_OP(cpo_print), cl_page_print()
1478 (const struct lu_env *env, cl_page_print()
1481 (*printer)(env, cookie, "end page@%p\n", pg); cl_page_print()
1488 int cl_page_cancel(const struct lu_env *env, struct cl_page *page) cl_page_cancel() argument
1490 return CL_PAGE_INVOKE(env, page, CL_PAGE_OP(cpo_cancel), cl_page_cancel()
H A Dllog_cat.c61 static int llog_cat_new_log(const struct lu_env *env, llog_cat_new_log() argument
85 rc = llog_create(env, loghandle, th); llog_cat_new_log()
95 rc = llog_init_handle(env, loghandle, llog_cat_new_log()
131 rc = llog_write_rec(env, cathandle, &rec.lid_hdr, llog_cat_new_log()
139 llog_destroy(env, loghandle); llog_cat_new_log()
152 int llog_cat_id2handle(const struct lu_env *env, struct llog_handle *cathandle, llog_cat_id2handle() argument
183 rc = llog_open(env, cathandle->lgh_ctxt, &loghandle, logid, NULL, llog_cat_id2handle()
192 rc = llog_init_handle(env, loghandle, LLOG_F_IS_PLAIN, NULL); llog_cat_id2handle()
194 llog_close(env, loghandle); llog_cat_id2handle()
213 int llog_cat_close(const struct lu_env *env, struct llog_handle *cathandle) llog_cat_close() argument
229 rc = llog_destroy(env, loghandle); llog_cat_close()
236 llog_cat_cleanup(env, cathandle, NULL, index); llog_cat_close()
238 llog_close(env, loghandle); llog_cat_close()
243 rc = llog_close(env, cathandle); llog_cat_close()
323 int llog_cat_add_rec(const struct lu_env *env, struct llog_handle *cathandle, llog_cat_add_rec() argument
336 rc = llog_cat_new_log(env, cathandle, loghandle, th); llog_cat_add_rec()
343 rc = llog_write_rec(env, loghandle, rec, reccookie, 1, buf, -1, th); llog_cat_add_rec()
354 rc = llog_cat_new_log(env, cathandle, loghandle, th); llog_cat_add_rec()
361 rc = llog_write_rec(env, loghandle, rec, reccookie, 1, buf, llog_cat_add_rec()
372 int llog_cat_declare_add_rec(const struct lu_env *env, llog_cat_declare_add_rec() argument
383 rc = llog_open(env, cathandle->lgh_ctxt, &loghandle, llog_cat_declare_add_rec()
396 rc = llog_open(env, cathandle->lgh_ctxt, &loghandle, llog_cat_declare_add_rec()
410 rc = llog_declare_create(env, cathandle->u.chd.chd_current_log, llog_cat_declare_add_rec()
414 llog_declare_write_rec(env, cathandle, NULL, -1, th); llog_cat_declare_add_rec()
417 rc = llog_declare_write_rec(env, cathandle->u.chd.chd_current_log, llog_cat_declare_add_rec()
425 rc = llog_declare_create(env, next, th); llog_cat_declare_add_rec()
426 llog_declare_write_rec(env, cathandle, NULL, -1, th); llog_cat_declare_add_rec()
428 llog_declare_write_rec(env, next, rec, -1, th); llog_cat_declare_add_rec()
435 int llog_cat_add(const struct lu_env *env, struct llog_handle *cathandle, llog_cat_add() argument
452 th = dt_trans_create(env, dt); llog_cat_add()
456 rc = llog_cat_declare_add_rec(env, cathandle, rec, th); llog_cat_add()
460 rc = dt_trans_start_local(env, dt, th); llog_cat_add()
463 rc = llog_cat_add_rec(env, cathandle, rec, reccookie, buf, th); llog_cat_add()
465 dt_trans_stop(env, dt, th); llog_cat_add()
468 rc = llog_cat_declare_add_rec(env, cathandle, rec, th); llog_cat_add()
470 rc = llog_cat_add_rec(env, cathandle, rec, reccookie, llog_cat_add()
486 int llog_cat_cancel_records(const struct lu_env *env, llog_cat_cancel_records() argument
497 rc = llog_cat_id2handle(env, cathandle, &loghandle, lgl); llog_cat_cancel_records()
506 lrc = llog_cancel_rec(env, loghandle, cookies->lgc_index); llog_cat_cancel_records()
509 rc = llog_cat_cleanup(env, cathandle, loghandle, llog_cat_cancel_records()
529 static int llog_cat_process_cb(const struct lu_env *env, llog_cat_process_cb() argument
546 rc = llog_cat_id2handle(env, cat_llh, &llh, &lir->lid_id); llog_cat_process_cb()
562 rc = llog_process_or_fork(env, llh, d->lpd_cb, d->lpd_data, llog_cat_process_cb()
567 rc = llog_process_or_fork(env, llh, d->lpd_cb, d->lpd_data, llog_cat_process_cb()
576 int llog_cat_process_or_fork(const struct lu_env *env, llog_cat_process_or_fork() argument
599 rc = llog_process_or_fork(env, cat_llh, llog_cat_process_cb, llog_cat_process_or_fork()
606 rc = llog_process_or_fork(env, cat_llh, llog_cat_process_cb, llog_cat_process_or_fork()
609 rc = llog_process_or_fork(env, cat_llh, llog_cat_process_cb, llog_cat_process_or_fork()
617 int llog_cat_process(const struct lu_env *env, struct llog_handle *cat_llh, llog_cat_process() argument
620 return llog_cat_process_or_fork(env, cat_llh, cb, data, startcat, llog_cat_process()
625 static int llog_cat_reverse_process_cb(const struct lu_env *env, llog_cat_reverse_process_cb() argument
642 rc = llog_cat_id2handle(env, cat_llh, &llh, &lir->lid_id); llog_cat_reverse_process_cb()
650 rc = llog_reverse_process(env, llh, d->lpd_cb, d->lpd_data, NULL); llog_cat_reverse_process_cb()
655 int llog_cat_reverse_process(const struct lu_env *env, llog_cat_reverse_process() argument
674 rc = llog_reverse_process(env, cat_llh, llog_cat_reverse_process()
682 rc = llog_reverse_process(env, cat_llh, llog_cat_reverse_process()
686 rc = llog_reverse_process(env, cat_llh, llog_cat_reverse_process()
727 int llog_cat_cleanup(const struct lu_env *env, struct llog_handle *cathandle, llog_cat_cleanup() argument
743 llog_close(env, loghandle); llog_cat_cleanup()
747 rc = llog_cancel_rec(env, cathandle, index); llog_cat_cleanup()
754 static int cat_cancel_cb(const struct lu_env *env, struct llog_handle *cathandle, cat_cancel_cb() argument
771 rc = llog_cat_id2handle(env, cathandle, &loghandle, &lir->lid_id); cat_cancel_cb()
778 llog_cat_cleanup(env, cathandle, NULL, rec->lrh_index); cat_cancel_cb()
786 rc = llog_destroy(env, loghandle); cat_cancel_cb()
791 llog_cat_cleanup(env, cathandle, loghandle, cat_cancel_cb()
800 int llog_cat_init_and_process(const struct lu_env *env, llog_cat_init_and_process() argument
805 rc = llog_init_handle(env, llh, LLOG_F_IS_CAT, NULL); llog_cat_init_and_process()
809 rc = llog_process_or_fork(env, llh, cat_cancel_cb, NULL, NULL, false); llog_cat_init_and_process()
H A Dcl_io.c74 int cl_io_is_going(const struct lu_env *env) cl_io_is_going() argument
76 return cl_env_info(env)->clt_current_io != NULL; cl_io_is_going()
102 void cl_io_fini(const struct lu_env *env, struct cl_io *io) cl_io_fini() argument
115 slice->cis_iop->op[io->ci_type].cio_fini(env, slice); cl_io_fini()
124 info = cl_env_info(env); cl_io_fini()
149 static int cl_io_init0(const struct lu_env *env, struct cl_io *io, cl_io_init0() argument
168 result = scan->co_ops->coo_io_init(env, scan, io); cl_object_for_each()
183 int cl_io_sub_init(const struct lu_env *env, struct cl_io *io, cl_io_sub_init() argument
186 struct cl_thread_info *info = cl_env_info(env); cl_io_sub_init()
191 return cl_io_init0(env, io, iot, obj); cl_io_sub_init()
205 int cl_io_init(const struct lu_env *env, struct cl_io *io, cl_io_init() argument
208 struct cl_thread_info *info = cl_env_info(env); cl_io_init()
214 return cl_io_init0(env, io, iot, obj); cl_io_init()
223 int cl_io_rw_init(const struct lu_env *env, struct cl_io *io, cl_io_rw_init() argument
229 LU_OBJECT_HEADER(D_VFSTRACE, env, &io->ci_obj->co_lu, cl_io_rw_init()
235 return cl_io_init(env, io, iot, io->ci_obj); cl_io_rw_init()
376 static int cl_lockset_lock_one(const struct lu_env *env, cl_lockset_lock_one() argument
383 lock = cl_lock_request(env, io, &link->cill_descr, "io", io); cl_lockset_lock_one()
389 result = cl_wait(env, lock); cl_lockset_lock_one()
400 static void cl_lock_link_fini(const struct lu_env *env, struct cl_io *io, cl_lock_link_fini() argument
407 cl_lock_release(env, lock, "io", io); cl_lock_link_fini()
411 link->cill_fini(env, link); cl_lock_link_fini()
414 static int cl_lockset_lock(const struct lu_env *env, struct cl_io *io, cl_lockset_lock() argument
427 result = cl_lockset_lock_one(env, io, set, link); cl_lockset_lock()
431 cl_lock_link_fini(env, io, link); cl_lockset_lock()
437 result = cl_wait(env, lock); cl_lockset_lock()
455 int cl_io_lock(const struct lu_env *env, struct cl_io *io) cl_io_lock() argument
467 result = scan->cis_iop->op[io->ci_type].cio_lock(env, scan); cl_io_for_each()
473 result = cl_lockset_lock(env, io, &io->ci_lockset);
476 cl_io_unlock(env, io);
486 void cl_io_unlock(const struct lu_env *env, struct cl_io *io) cl_io_unlock() argument
500 cl_lock_link_fini(env, io, link); cl_io_unlock()
503 cl_lock_link_fini(env, io, link); cl_io_unlock()
506 cl_unuse(env, link->cill_lock); cl_io_unlock()
507 cl_lock_link_fini(env, io, link); cl_io_unlock()
511 scan->cis_iop->op[io->ci_type].cio_unlock(env, scan); cl_io_for_each_reverse()
514 LASSERT(!cl_env_info(env)->clt_counters[CNL_TOP].ctc_nr_locks_acquired);
525 int cl_io_iter_init(const struct lu_env *env, struct cl_io *io) cl_io_iter_init() argument
538 result = scan->cis_iop->op[io->ci_type].cio_iter_init(env, cl_io_for_each()
554 void cl_io_iter_fini(const struct lu_env *env, struct cl_io *io) cl_io_iter_fini() argument
564 scan->cis_iop->op[io->ci_type].cio_iter_fini(env, scan); cl_io_for_each_reverse()
573 void cl_io_rw_advance(const struct lu_env *env, struct cl_io *io, size_t nob) cl_io_rw_advance() argument
588 scan->cis_iop->op[io->ci_type].cio_advance(env, scan, cl_io_for_each_reverse()
597 int cl_io_lock_add(const struct lu_env *env, struct cl_io *io, cl_io_lock_add() argument
612 static void cl_free_io_lock_link(const struct lu_env *env, cl_free_io_lock_link() argument
621 int cl_io_lock_alloc_add(const struct lu_env *env, struct cl_io *io, cl_io_lock_alloc_add() argument
631 result = cl_io_lock_add(env, io, link); cl_io_lock_alloc_add()
633 link->cill_fini(env, link); cl_io_lock_alloc_add()
644 int cl_io_start(const struct lu_env *env, struct cl_io *io) cl_io_start() argument
657 result = scan->cis_iop->op[io->ci_type].cio_start(env, scan); cl_io_for_each()
671 void cl_io_end(const struct lu_env *env, struct cl_io *io) cl_io_end() argument
681 scan->cis_iop->op[io->ci_type].cio_end(env, scan); cl_io_for_each_reverse()
738 int cl_io_read_page(const struct lu_env *env, struct cl_io *io, cl_io_read_page() argument
770 result = scan->cis_iop->cio_read_page(env, scan, slice); cl_io_for_each()
776 result = cl_io_submit_rw(env, io, CRT_READ, queue);
780 cl_page_list_disown(env, io, &queue->c2_qin);
781 cl_2queue_fini(env, queue);
791 int cl_io_prepare_write(const struct lu_env *env, struct cl_io *io, cl_io_prepare_write() argument
808 result = scan->cis_iop->cio_prepare_write(env, scan, cl_io_for_each_reverse()
824 int cl_io_commit_write(const struct lu_env *env, struct cl_io *io, cl_io_commit_write() argument
847 result = scan->cis_iop->cio_commit_write(env, scan, cl_io_for_each()
869 int cl_io_submit_rw(const struct lu_env *env, struct cl_io *io, cl_io_submit_rw() argument
880 result = scan->cis_iop->req_op[crt].cio_submit(env, scan, crt, cl_io_for_each()
897 int cl_io_submit_sync(const struct lu_env *env, struct cl_io *io, cl_io_submit_sync() argument
901 struct cl_sync_io *anchor = &cl_env_info(env)->clt_anchor; cl_io_submit_sync()
911 rc = cl_io_submit_rw(env, io, iot, queue); cl_io_submit_sync()
925 rc = cl_sync_io_wait(env, io, &queue->c2_qout, cl_io_submit_sync()
939 int cl_io_cancel(const struct lu_env *env, struct cl_io *io, cl_io_cancel() argument
950 rc = cl_page_cancel(env, page); cl_page_list_for_each()
976 int cl_io_loop(const struct lu_env *env, struct cl_io *io) cl_io_loop() argument
986 result = cl_io_iter_init(env, io); cl_io_loop()
989 result = cl_io_lock(env, io); cl_io_loop()
998 result = cl_io_start(env, io); cl_io_loop()
1005 cl_io_end(env, io); cl_io_loop()
1006 cl_io_unlock(env, io); cl_io_loop()
1007 cl_io_rw_advance(env, io, io->ci_nob - nob); cl_io_loop()
1010 cl_io_iter_fini(env, io); cl_io_loop()
1079 void cl_page_list_del(const struct lu_env *env, cl_page_list_del() argument
1091 cl_page_put(env, page); cl_page_list_del()
1129 void cl_page_disown0(const struct lu_env *env,
1135 void cl_page_list_disown(const struct lu_env *env, cl_page_list_disown() argument
1159 cl_page_disown0(env, io, page); cl_page_list_for_each_safe()
1162 cl_page_put(env, page); cl_page_list_for_each_safe()
1170 void cl_page_list_fini(const struct lu_env *env, struct cl_page_list *plist) cl_page_list_fini() argument
1178 cl_page_list_del(env, plist, page); cl_page_list_fini()
1186 int cl_page_list_own(const struct lu_env *env, cl_page_list_own() argument
1200 if (cl_page_own(env, io, page) == 0) cl_page_list_for_each_safe()
1203 cl_page_list_del(env, plist, page); cl_page_list_for_each_safe()
1212 void cl_page_list_assume(const struct lu_env *env, cl_page_list_assume() argument
1220 cl_page_assume(env, io, page); cl_page_list_assume()
1227 void cl_page_list_discard(const struct lu_env *env, struct cl_io *io, cl_page_list_discard() argument
1234 cl_page_discard(env, io, page); cl_page_list_discard()
1241 int cl_page_list_unmap(const struct lu_env *env, struct cl_io *io, cl_page_list_unmap() argument
1250 result = cl_page_unmap(env, io, page); cl_page_list_for_each()
1280 void cl_2queue_disown(const struct lu_env *env, cl_2queue_disown() argument
1283 cl_page_list_disown(env, io, &queue->c2_qin); cl_2queue_disown()
1284 cl_page_list_disown(env, io, &queue->c2_qout); cl_2queue_disown()
1291 void cl_2queue_discard(const struct lu_env *env, cl_2queue_discard() argument
1294 cl_page_list_discard(env, io, &queue->c2_qin); cl_2queue_discard()
1295 cl_page_list_discard(env, io, &queue->c2_qout); cl_2queue_discard()
1302 void cl_2queue_assume(const struct lu_env *env, cl_2queue_assume() argument
1305 cl_page_list_assume(env, io, &queue->c2_qin); cl_2queue_assume()
1306 cl_page_list_assume(env, io, &queue->c2_qout); cl_2queue_assume()
1313 void cl_2queue_fini(const struct lu_env *env, struct cl_2queue *queue) cl_2queue_fini() argument
1315 cl_page_list_fini(env, &queue->c2_qout); cl_2queue_fini()
1316 cl_page_list_fini(env, &queue->c2_qin); cl_2queue_fini()
1346 void cl_io_print(const struct lu_env *env, void *cookie, cl_io_print() argument
1371 static void cl_req_free(const struct lu_env *env, struct cl_req *req) cl_req_free() argument
1387 cl_object_put(env, obj); cl_req_free()
1395 static int cl_req_init(const struct lu_env *env, struct cl_req *req, cl_req_init() argument
1408 result = dev->cd_ops->cdo_req_init(env, cl_req_init()
1423 void cl_req_completion(const struct lu_env *env, struct cl_req *req, int rc) cl_req_completion() argument
1435 slice->crs_ops->cro_completion(env, slice, rc); cl_req_completion()
1437 cl_req_free(env, req); cl_req_completion()
1444 struct cl_req *cl_req_alloc(const struct lu_env *env, struct cl_page *page, cl_req_alloc() argument
1462 result = cl_req_init(env, req, page); cl_req_alloc()
1466 cl_req_completion(env, req, result); cl_req_alloc()
1478 void cl_req_page_add(const struct lu_env *env, cl_req_page_add() argument
1490 CL_PAGE_DEBUG(D_PAGE, env, page, "req %p, %d, %u\n", cl_req_page_add()
1513 void cl_req_page_done(const struct lu_env *env, struct cl_page *page) cl_req_page_done() argument
1532 int cl_req_prep(const struct lu_env *env, struct cl_req *req) cl_req_prep() argument
1548 result = slice->crs_ops->cro_prep(env, slice); cl_req_prep()
1562 void cl_req_attr_set(const struct lu_env *env, struct cl_req *req, cl_req_attr_set() argument
1584 slice->crs_ops->cro_attr_set(env, slice, obj, cl_req_attr_set()
1611 int cl_sync_io_wait(const struct lu_env *env, struct cl_io *io, cl_sync_io_wait() argument
1628 (void)cl_io_cancel(env, io, queue); cl_sync_io_wait()
1638 cl_page_list_assume(env, io, queue); cl_sync_io_wait()
H A Ddt_object.c80 int dt_txn_hook_start(const struct lu_env *env, dt_txn_hook_start() argument
91 !(cb->dtc_tag & env->le_ctx.lc_tags)) dt_txn_hook_start()
93 rc = cb->dtc_txn_start(env, th, cb->dtc_cookie); dt_txn_hook_start()
101 int dt_txn_hook_stop(const struct lu_env *env, struct thandle *txn) dt_txn_hook_stop() argument
112 !(cb->dtc_tag & env->le_ctx.lc_tags)) dt_txn_hook_stop()
114 rc = cb->dtc_txn_stop(env, txn, cb->dtc_cookie); dt_txn_hook_stop()
165 int dt_try_as_dir(const struct lu_env *env, struct dt_object *obj) dt_try_as_dir() argument
168 obj->do_ops->do_index_try(env, obj, &dt_directory_features); dt_try_as_dir()
205 int dt_lookup_dir(const struct lu_env *env, struct dt_object *dir, dt_lookup_dir() argument
208 if (dt_try_as_dir(env, dir)) dt_lookup_dir()
209 return dt_lookup(env, dir, (struct dt_rec *)fid, dt_lookup_dir()
217 struct dt_object *dt_locate_at(const struct lu_env *env, dt_locate_at() argument
223 lo = lu_object_find_at(env, top_dev, fid, NULL); dt_locate_at()
240 static int dt_find_entry(const struct lu_env *env, const char *entry, void *data) dt_find_entry() argument
248 result = dt_lookup_dir(env, obj, entry, fid); dt_find_entry()
249 lu_object_put(env, &obj->do_lu); dt_find_entry()
251 obj = dt_locate(env, dt, fid); dt_find_entry()
263 int dt_path_parser(const struct lu_env *env, dt_path_parser() argument
280 rc = entry_func(env, e, data); dt_path_parser()
289 dt_store_resolve(const struct lu_env *env, struct dt_device *dt, dt_store_resolve() argument
292 struct dt_thread_info *info = dt_info(env); dt_store_resolve()
305 result = dt->dd_ops->dt_root_get(env, dt, fid); dt_store_resolve()
307 obj = dt_locate(env, dt, fid); dt_store_resolve()
310 result = dt_path_parser(env, local, dt_find_entry, dfh); dt_store_resolve()
323 static struct dt_object *dt_reg_open(const struct lu_env *env, dt_reg_open() argument
332 result = dt_lookup_dir(env, p, name, fid); dt_reg_open()
334 o = dt_locate(env, dt, fid); dt_reg_open()
346 struct dt_object *dt_store_open(const struct lu_env *env, dt_store_open() argument
355 dir = dt_store_resolve(env, dt, dirname, fid); dt_store_open()
357 file = dt_reg_open(env, dt, dir, dt_store_open()
359 lu_object_put(env, &dir->do_lu); dt_store_open()
367 struct dt_object *dt_find_or_create(const struct lu_env *env, dt_find_or_create() argument
377 dto = dt_locate(env, dt, fid); dt_find_or_create()
385 th = dt_trans_create(env, dt); dt_find_or_create()
391 rc = dt_declare_create(env, dto, at, NULL, dof, th); dt_find_or_create()
395 rc = dt_trans_start_local(env, dt, th); dt_find_or_create()
399 dt_write_lock(env, dto, 0); dt_find_or_create()
407 rc = dt_create(env, dto, at, NULL, dof, th); dt_find_or_create()
412 dt_write_unlock(env, dto); dt_find_or_create()
414 dt_trans_stop(env, dt, th); dt_find_or_create()
417 lu_object_put(env, &dto->do_lu); dt_find_or_create()
439 * \param env lustre environment
447 int dt_read(const struct lu_env *env, struct dt_object *dt, dt_read() argument
451 return dt->do_body_ops->dbo_read(env, dt, buf, pos, BYPASS_CAPA); dt_read()
459 * \param env lustre environment
468 int dt_record_read(const struct lu_env *env, struct dt_object *dt, dt_record_read() argument
475 rc = dt->do_body_ops->dbo_read(env, dt, buf, pos, BYPASS_CAPA); dt_record_read()
485 int dt_record_write(const struct lu_env *env, struct dt_object *dt, dt_record_write() argument
494 rc = dt->do_body_ops->dbo_write(env, dt, buf, pos, th, BYPASS_CAPA, 1); dt_record_write()
503 int dt_declare_version_set(const struct lu_env *env, struct dt_object *o, dt_declare_version_set() argument
512 return dt_declare_xattr_set(env, o, &vbuf, xname, 0, th); dt_declare_version_set()
517 void dt_version_set(const struct lu_env *env, struct dt_object *o, dt_version_set() argument
528 rc = dt_xattr_set(env, o, &vbuf, xname, 0, th, BYPASS_CAPA); dt_version_set()
535 dt_obj_version_t dt_version_get(const struct lu_env *env, struct dt_object *o) dt_version_get() argument
545 rc = dt_xattr_get(env, o, &vbuf, xname, BYPASS_CAPA); dt_version_get()
643 * \param env - is the environment passed by the caller
651 static int dt_index_page_build(const struct lu_env *env, union lu_page *lp, dt_index_page_build() argument
682 hash = iops->store(env, it); dt_index_page_build()
708 LASSERT(iops->key_size(env, it) == ii->ii_keysize); dt_index_page_build()
709 key = iops->key(env, it); dt_index_page_build()
714 rc = iops->rec(env, it, (struct dt_rec *)tmp_entry, attr); dt_index_page_build()
729 rc = iops->next(env, it); dt_index_page_build()
748 * \param env - is the environment passed by the caller
758 int dt_index_walk(const struct lu_env *env, struct dt_object *obj, dt_index_walk() argument
777 it = iops->init(env, obj, rdpg->rp_attrs, BYPASS_CAPA); dt_index_walk()
781 rc = iops->load(env, it, rdpg->rp_hash); dt_index_walk()
793 rc = iops->next(env, it); dt_index_walk()
814 rc = filler(env, lp, min_t(int, nob, LU_PAGE_SIZE), dt_index_walk()
827 iops->put(env, it); dt_index_walk()
828 iops->fini(env, it); dt_index_walk()
842 * \param env - is the environment passed by the caller
851 int dt_index_read(const struct lu_env *env, struct dt_device *dev, dt_index_read() argument
873 obj = dt_locate(env, dev, &ii->ii_fid); dt_index_read()
891 rc = obj->do_ops->do_index_try(env, obj, feat); dt_index_read()
921 dt_read_lock(env, obj, 0); dt_index_read()
923 ii->ii_version = dt_version_get(env, obj); dt_index_read()
926 rc = dt_index_walk(env, obj, rdpg, dt_index_page_build ,ii); dt_index_read()
927 dt_read_unlock(env, obj); dt_index_read()
937 lu_object_put(env, &obj->do_lu); dt_index_read()
H A Dcl_object.c118 struct cl_object *cl_object_find(const struct lu_env *env, cl_object_find() argument
123 return lu2cl(lu_object_find_slice(env, cl2lu_dev(cd), fid, &c->coc_lu)); cl_object_find()
135 void cl_object_put(const struct lu_env *env, struct cl_object *o) cl_object_put() argument
137 lu_object_put(env, &o->co_lu); cl_object_put()
219 int cl_object_attr_get(const struct lu_env *env, struct cl_object *obj, cl_object_attr_get() argument
231 result = obj->co_ops->coo_attr_get(env, obj, attr); cl_object_attr_get()
250 int cl_object_attr_set(const struct lu_env *env, struct cl_object *obj, cl_object_attr_set() argument
263 result = obj->co_ops->coo_attr_set(env, obj, attr, v); cl_object_attr_set()
283 int cl_object_glimpse(const struct lu_env *env, struct cl_object *obj, cl_object_glimpse() argument
294 result = obj->co_ops->coo_glimpse(env, obj, lvb); cl_object_glimpse()
299 LU_OBJECT_HEADER(D_DLMTRACE, env, lu_object_top(top), cl_object_glimpse()
310 int cl_conf_set(const struct lu_env *env, struct cl_object *obj, cl_conf_set() argument
320 result = obj->co_ops->coo_conf_set(env, obj, conf); cl_conf_set()
336 void cl_object_kill(const struct lu_env *env, struct cl_object *obj) cl_object_kill() argument
352 cl_locks_prune(env, obj, 0); cl_object_kill()
359 void cl_object_prune(const struct lu_env *env, struct cl_object *obj) cl_object_prune() argument
361 cl_pages_prune(env, obj); cl_object_prune()
362 cl_locks_prune(env, obj, 1); cl_object_prune()
396 * env: ...... ...... ...... ...... ...... cache_stats_print()
478 env: ...... ...... ...... ...... ...... cl_site_stats_print()
686 struct lu_env *env; cl_env_new() local
695 env = &cle->ce_lu; cl_env_new()
696 rc = lu_env_init(env, LCT_CL_THREAD|ctx_tags); cl_env_new()
702 env->le_ses = &cle->ce_ses; cl_env_new()
705 lu_env_fini(env); cl_env_new()
709 env = ERR_PTR(rc); cl_env_new()
715 env = ERR_PTR(-ENOMEM); cl_env_new()
716 return env; cl_env_new()
727 static inline struct cl_env *cl_env_container(struct lu_env *env) cl_env_container() argument
729 return container_of(env, struct cl_env, ce_lu); cl_env_container()
734 struct lu_env *env; cl_env_peek() local
742 env = NULL; cl_env_peek()
746 env = &cle->ce_lu; cl_env_peek()
750 return env; cl_env_peek()
767 struct lu_env *env; cl_env_get() local
769 env = cl_env_peek(refcheck); cl_env_get()
770 if (env == NULL) { cl_env_get()
771 env = cl_env_new(lu_context_tags_default, cl_env_get()
775 if (!IS_ERR(env)) { cl_env_get()
778 cle = cl_env_container(env); cl_env_get()
784 return env; cl_env_get()
795 struct lu_env *env; cl_env_alloc() local
798 env = cl_env_new(tags, tags, __builtin_return_address(0)); cl_env_alloc()
799 if (!IS_ERR(env)) { cl_env_alloc()
802 cle = cl_env_container(env); cl_env_alloc()
806 return env; cl_env_alloc()
820 * Decrement \a env reference counter. When counter drops to 0, nothing in
824 void cl_env_put(struct lu_env *env, int *refcheck) cl_env_put() argument
828 cle = cl_env_container(env); cl_env_put()
866 * Setup user-supplied \a env as a current environment. This is to be used to
872 void cl_env_implant(struct lu_env *env, int *refcheck) cl_env_implant() argument
874 struct cl_env *cle = cl_env_container(env); cl_env_implant()
887 void cl_env_unplant(struct lu_env *env, int *refcheck) cl_env_unplant() argument
889 struct cl_env *cle = cl_env_container(env); cl_env_unplant()
896 cl_env_put(env, refcheck); cl_env_unplant()
902 struct lu_env *env; cl_env_nested_get() local
905 env = cl_env_peek(&nest->cen_refcheck); cl_env_nested_get()
906 if (env != NULL) { cl_env_nested_get()
907 if (!cl_io_is_going(env)) cl_env_nested_get()
908 return env; cl_env_nested_get()
910 cl_env_put(env, &nest->cen_refcheck); cl_env_nested_get()
914 env = cl_env_get(&nest->cen_refcheck); cl_env_nested_get()
915 if (IS_ERR(env)) { cl_env_nested_get()
917 return env; cl_env_nested_get()
920 LASSERT(!cl_io_is_going(env)); cl_env_nested_get()
921 return env; cl_env_nested_get()
925 void cl_env_nested_put(struct cl_env_nest *nest, struct lu_env *env) cl_env_nested_put() argument
927 cl_env_put(env, &nest->cen_refcheck); cl_env_nested_put()
968 struct cl_device *cl_type_setup(const struct lu_env *env, struct lu_site *site, cl_type_setup() argument
978 d = ldt->ldt_ops->ldto_device_alloc(env, ldt, NULL); cl_type_setup()
984 rc = ldt->ldt_ops->ldto_device_init(env, d, typename, next); cl_type_setup()
990 ldt->ldt_ops->ldto_device_free(env, d); cl_type_setup()
1003 void cl_stack_fini(const struct lu_env *env, struct cl_device *cl) cl_stack_fini() argument
1005 lu_stack_fini(env, cl2lu_dev(cl)); cl_stack_fini()
1017 struct cl_thread_info *cl_env_info(const struct lu_env *env) cl_env_info() argument
1019 return lu_context_key_get(&env->le_ctx, &cl_key); cl_env_info()
H A Dllog.c109 int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle, llog_cancel_rec() argument
136 rc = llog_destroy(env, loghandle); llog_cancel_rec()
149 rc = llog_write(env, loghandle, &llh->llh_hdr, NULL, 0, NULL, 0); llog_cancel_rec()
168 static int llog_read_header(const struct lu_env *env, llog_read_header() argument
182 rc = lop->lop_read_header(env, handle); llog_read_header()
202 int llog_init_handle(const struct lu_env *env, struct llog_handle *handle, llog_init_handle() argument
216 rc = llog_read_header(env, handle, uuid); llog_init_handle()
411 struct lu_env env; llog_process_thread_daemonize() local
416 /* client env has no keys, tags is just 0 */ llog_process_thread_daemonize()
417 rc = lu_env_init(&env, LCT_LOCAL | LCT_MG_THREAD); llog_process_thread_daemonize()
420 lpi->lpi_env = &env; llog_process_thread_daemonize()
424 lu_env_fini(&env); llog_process_thread_daemonize()
430 int llog_process_or_fork(const struct lu_env *env, llog_process_or_fork() argument
448 /* The new thread can't use parent env, llog_process_or_fork()
462 lpi->lpi_env = env; llog_process_or_fork()
471 int llog_process(const struct lu_env *env, struct llog_handle *loghandle, llog_process() argument
474 return llog_process_or_fork(env, loghandle, cb, data, catdata, true); llog_process()
478 int llog_reverse_process(const struct lu_env *env, llog_reverse_process() argument
513 rc = llog_prev_block(env, loghandle, index, buf, llog_reverse_process()
543 rc = cb(env, loghandle, rec, data); llog_reverse_process()
547 llog_cancel_rec(env, loghandle, llog_reverse_process()
602 int llog_declare_create(const struct lu_env *env, llog_declare_create() argument
617 rc = lop->lop_declare_create(env, loghandle, th); llog_declare_create()
624 int llog_create(const struct lu_env *env, struct llog_handle *handle, llog_create() argument
639 rc = lop->lop_create(env, handle, th); llog_create()
646 int llog_declare_write_rec(const struct lu_env *env, llog_declare_write_rec() argument
664 rc = lop->lop_declare_write_rec(env, handle, rec, idx, th); llog_declare_write_rec()
671 int llog_write_rec(const struct lu_env *env, struct llog_handle *handle, llog_write_rec() argument
696 rc = lop->lop_write_rec(env, handle, rec, logcookies, numcookies, llog_write_rec()
704 int llog_add(const struct lu_env *env, struct llog_handle *lgh, llog_add() argument
716 rc = lgh->lgh_logops->lop_add(env, lgh, rec, logcookies, buf, th); llog_add()
723 int llog_declare_add(const struct lu_env *env, struct llog_handle *lgh, llog_declare_add() argument
734 rc = lgh->lgh_logops->lop_declare_add(env, lgh, rec, th); llog_declare_add()
745 int llog_open_create(const struct lu_env *env, struct llog_ctxt *ctxt, llog_open_create() argument
753 rc = llog_open(env, ctxt, res, logid, name, LLOG_OPEN_NEW); llog_open_create()
764 th = dt_trans_create(env, d); llog_open_create()
770 rc = llog_declare_create(env, *res, th); llog_open_create()
772 rc = dt_trans_start_local(env, d, th); llog_open_create()
774 rc = llog_create(env, *res, th); llog_open_create()
776 dt_trans_stop(env, d, th); llog_open_create()
779 llog_close(env, *res); llog_open_create()
787 int llog_erase(const struct lu_env *env, struct llog_ctxt *ctxt, llog_erase() argument
797 rc = llog_open(env, ctxt, &handle, logid, name, LLOG_OPEN_EXISTS); llog_erase()
801 rc = llog_init_handle(env, handle, LLOG_F_IS_PLAIN, NULL); llog_erase()
803 rc = llog_destroy(env, handle); llog_erase()
805 rc2 = llog_close(env, handle); llog_erase()
817 int llog_write(const struct lu_env *env, struct llog_handle *loghandle, llog_write() argument
831 th = dt_trans_create(env, dt); llog_write()
835 rc = llog_declare_write_rec(env, loghandle, rec, idx, th); llog_write()
839 rc = dt_trans_start_local(env, dt, th); llog_write()
844 rc = llog_write_rec(env, loghandle, rec, reccookie, llog_write()
848 dt_trans_stop(env, dt, th); llog_write()
853 int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt, llog_open() argument
877 rc = ctxt->loc_logops->lop_open(env, *lgh, logid, name, open_param); llog_open()
888 int llog_close(const struct lu_env *env, struct llog_handle *loghandle) llog_close() argument
900 rc = lop->lop_close(env, loghandle); llog_close()
907 int llog_is_empty(const struct lu_env *env, struct llog_ctxt *ctxt, llog_is_empty() argument
913 rc = llog_open(env, ctxt, &llh, NULL, name, LLOG_OPEN_EXISTS); llog_is_empty()
920 rc = llog_init_handle(env, llh, LLOG_F_IS_PLAIN, NULL); llog_is_empty()
926 llog_close(env, llh); llog_is_empty()
933 int llog_copy_handler(const struct lu_env *env, struct llog_handle *llh, llog_copy_handler() argument
939 return llog_write(env, copy_llh, rec, NULL, 0, NULL, -1); llog_copy_handler()
944 int llog_backup(const struct lu_env *env, struct obd_device *obd, llog_backup() argument
954 rc = llog_open(env, ctxt, &llh, NULL, name, LLOG_OPEN_EXISTS); llog_backup()
965 rc = llog_init_handle(env, llh, LLOG_F_IS_PLAIN, NULL); llog_backup()
970 rc = llog_erase(env, bctxt, NULL, backup); llog_backup()
975 rc = llog_open_create(env, bctxt, &bllh, NULL, backup); llog_backup()
991 rc = llog_init_handle(env, bllh, LLOG_F_IS_PLAIN, NULL); llog_backup()
996 rc = llog_process_or_fork(env, llh, llog_copy_handler, (void *)bllh, llog_backup()
1002 llog_close(env, bllh); llog_backup()
1004 llog_close(env, llh); llog_backup()
H A Dllog_internal.h65 static inline struct llog_thread_info *llog_info(const struct lu_env *env) llog_info() argument
69 lgi = lu_context_key_get(&env->le_ctx, &llog_thread_key); llog_info()
87 int llog_cat_id2handle(const struct lu_env *env, struct llog_handle *cathandle,
89 int class_config_dump_handler(const struct lu_env *env,
93 int llog_process_or_fork(const struct lu_env *env,
96 int llog_cat_cleanup(const struct lu_env *env, struct llog_handle *cathandle,
H A Dlu_object.c61 static void lu_object_free(const struct lu_env *env, struct lu_object *o);
68 void lu_object_put(const struct lu_env *env, struct lu_object *o) lu_object_put() argument
95 o->lo_ops->loo_object_release(env, o); lu_object_put()
97 lu_object_free(env, orig); lu_object_put()
124 o->lo_ops->loo_object_release(env, o); lu_object_put()
152 lu_object_free(env, orig); lu_object_put()
160 void lu_object_put_nocache(const struct lu_env *env, struct lu_object *o) lu_object_put_nocache() argument
163 return lu_object_put(env, o); lu_object_put_nocache()
171 void lu_object_unhash(const struct lu_env *env, struct lu_object *o) lu_object_unhash() argument
195 static struct lu_object *lu_object_alloc(const struct lu_env *env, lu_object_alloc() argument
212 top = dev->ld_ops->ldo_object_alloc(env, NULL, dev); lu_object_alloc()
236 result = scan->lo_ops->loo_object_init(env, scan, conf); list_for_each_entry()
238 lu_object_free(env, top); list_for_each_entry()
249 result = scan->lo_ops->loo_object_start(env, scan); list_for_each_entry_reverse()
251 lu_object_free(env, top); list_for_each_entry_reverse()
264 static void lu_object_free(const struct lu_env *env, struct lu_object *o) lu_object_free() argument
280 scan->lo_ops->loo_object_delete(env, scan); list_for_each_entry_reverse()
300 o->lo_ops->loo_object_free(env, o);
310 int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr) lu_site_purge() argument
372 lu_object_free(env, lu_object_top(h)); lu_site_purge()
440 int lu_cdebug_printer(const struct lu_env *env, lu_cdebug_printer() argument
451 key = lu_context_key_get(&env->le_ctx, &lu_global_key); lu_cdebug_printer()
474 void lu_object_header_print(const struct lu_env *env, void *cookie, lu_object_header_print() argument
478 (*printer)(env, cookie, "header@%p[%#lx, %d, "DFID"%s%s%s]", lu_object_header_print()
491 void lu_object_print(const struct lu_env *env, void *cookie, lu_object_print() argument
499 lu_object_header_print(env, cookie, printer, top); lu_object_print()
500 (*printer)(env, cookie, "{\n"); lu_object_print()
506 (*printer)(env, cookie, "%*.*s%s@%p", depth, depth, ruler, lu_object_print()
510 (*o->lo_ops->loo_object_print)(env, cookie, printer, o); lu_object_print()
512 (*printer)(env, cookie, "\n"); lu_object_print()
515 (*printer)(env, cookie, "} header@%p\n", top); lu_object_print()
586 struct lu_object *lu_object_find(const struct lu_env *env, lu_object_find() argument
590 return lu_object_find_at(env, dev->ld_site->ls_top_dev, f, conf); lu_object_find()
594 static struct lu_object *lu_object_new(const struct lu_env *env, lu_object_new() argument
604 o = lu_object_alloc(env, dev, f, conf); lu_object_new()
620 static struct lu_object *lu_object_find_try(const struct lu_env *env, lu_object_find_try() argument
654 return lu_object_new(env, dev, f, conf); lu_object_find_try()
668 o = lu_object_alloc(env, dev, f, conf); lu_object_find_try()
689 lu_object_free(env, o); lu_object_find_try()
698 struct lu_object *lu_object_find_at(const struct lu_env *env, lu_object_find_at() argument
708 obj = lu_object_find_try(env, dev, f, conf, &wait); lu_object_find_at()
725 struct lu_object *lu_object_find_slice(const struct lu_env *env, lu_object_find_slice() argument
733 top = lu_object_find(env, dev, f, conf); lu_object_find_slice()
737 lu_object_put(env, top); lu_object_find_slice()
822 void lu_site_print(const struct lu_env *env, struct lu_site *s, void *cookie, lu_site_print() argument
826 .lsp_env = (struct lu_env *)env, lu_site_print()
1264 void lu_stack_fini(const struct lu_env *env, struct lu_device *top) lu_stack_fini() argument
1270 lu_site_purge(env, site, ~0); lu_stack_fini()
1272 next = scan->ld_type->ldt_ops->ldto_device_fini(env, scan); lu_stack_fini()
1278 lu_site_purge(env, site, ~0); lu_stack_fini()
1284 next = ldt->ldt_ops->ldto_device_free(env, scan); lu_stack_fini()
1731 int lu_env_init(struct lu_env *env, __u32 tags) lu_env_init() argument
1735 env->le_ses = NULL; lu_env_init()
1736 result = lu_context_init(&env->le_ctx, tags); lu_env_init()
1738 lu_context_enter(&env->le_ctx); lu_env_init()
1743 void lu_env_fini(struct lu_env *env) lu_env_fini() argument
1745 lu_context_exit(&env->le_ctx); lu_env_fini()
1746 lu_context_fini(&env->le_ctx); lu_env_fini()
1747 env->le_ses = NULL; lu_env_fini()
1751 int lu_env_refill(struct lu_env *env) lu_env_refill() argument
1755 result = lu_context_refill(&env->le_ctx); lu_env_refill()
1756 if (result == 0 && env->le_ses != NULL) lu_env_refill()
1757 result = lu_context_refill(env->le_ses); lu_env_refill()
1766 * the env context after it get one from the cache, especially
1769 int lu_env_refill_by_tags(struct lu_env *env, __u32 ctags, lu_env_refill_by_tags() argument
1772 if ((env->le_ctx.lc_tags & ctags) != ctags) { lu_env_refill_by_tags()
1773 env->le_ctx.lc_version = 0; lu_env_refill_by_tags()
1774 env->le_ctx.lc_tags |= ctags; lu_env_refill_by_tags()
1777 if (env->le_ses && (env->le_ses->lc_tags & stags) != stags) { lu_env_refill_by_tags()
1778 env->le_ses->lc_version = 0; lu_env_refill_by_tags()
1779 env->le_ses->lc_tags |= stags; lu_env_refill_by_tags()
1782 return lu_env_refill(env); lu_env_refill_by_tags()
1915 int lu_printk_printer(const struct lu_env *env, lu_printk_printer() argument
2071 void lu_object_assign_fid(const struct lu_env *env, struct lu_object *o, lu_object_assign_fid() argument
2103 struct lu_object *lu_object_anon(const struct lu_env *env, lu_object_anon() argument
2111 o = lu_object_alloc(env, dev, &fid, conf); lu_object_anon()
H A Dllog_obd.c72 int __llog_ctxt_put(const struct lu_env *env, struct llog_ctxt *ctxt) __llog_ctxt_put() argument
100 rc = CTXTP(ctxt, cleanup)(env, ctxt); __llog_ctxt_put()
108 int llog_cleanup(const struct lu_env *env, struct llog_ctxt *ctxt) llog_cleanup() argument
133 rc = __llog_ctxt_put(env, ctxt); llog_cleanup()
145 int llog_setup(const struct lu_env *env, struct obd_device *obd, llog_setup() argument
197 rc = op->lop_setup(env, obd, olg, index, disk_obd); llog_setup()
229 int llog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt, llog_cancel() argument
240 rc = CTXTP(ctxt, cancel)(env, ctxt, cookies, flags); llog_cancel()
H A Dobd_config.c1386 int class_config_llog_handler(const struct lu_env *env, class_config_llog_handler() argument
1577 int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt, class_config_parse_llog() argument
1586 rc = llog_open(env, ctxt, &llh, NULL, name, LLOG_OPEN_EXISTS); class_config_parse_llog()
1590 rc = llog_init_handle(env, llh, LLOG_F_IS_PLAIN, NULL); class_config_parse_llog()
1605 rc = llog_process(env, llh, callback, cfg, &cd); class_config_parse_llog()
1613 llog_close(env, llh); class_config_parse_llog()
1667 int class_config_dump_handler(const struct lu_env *env, class_config_dump_handler() argument
1690 int class_config_dump_llog(const struct lu_env *env, struct llog_ctxt *ctxt, class_config_dump_llog() argument
1698 rc = llog_open(env, ctxt, &llh, NULL, name, LLOG_OPEN_EXISTS); class_config_dump_llog()
1702 rc = llog_init_handle(env, llh, LLOG_F_IS_PLAIN, NULL); class_config_dump_llog()
1706 rc = llog_process(env, llh, class_config_dump_handler, cfg, NULL); class_config_dump_llog()
1708 llog_close(env, llh); class_config_dump_llog()
H A Dcl_internal.h119 struct cl_thread_info *cl_env_info(const struct lu_env *env);
/linux-4.1.27/security/tomoyo/
H A Denviron.c23 return tomoyo_path_matches_pattern(r->param.environ.name, acl->env); tomoyo_check_env_acl()
35 return tomoyo_supervisor(r, "misc env %s\n", tomoyo_audit_env_log()
43 * @env: The name of environment variable.
49 int tomoyo_env_perm(struct tomoyo_request_info *r, const char *env) tomoyo_env_perm() argument
54 if (!env || !*env) tomoyo_env_perm()
56 environ.name = env; tomoyo_env_perm()
81 return p1->env == p2->env; tomoyo_same_env_acl()
101 e.env = tomoyo_get_name(data); tomoyo_write_env()
102 if (!e.env) tomoyo_write_env()
106 tomoyo_put_name(e.env); tomoyo_write_env()
119 if (tomoyo_str_starts(&param->data, "env ")) tomoyo_write_misc()
/linux-4.1.27/drivers/staging/lustre/lustre/include/
H A Ddt_object.h99 typedef void (*dt_cb_t)(struct lu_env *env, struct thandle *th,
122 int (*dt_statfs)(const struct lu_env *env,
127 struct thandle *(*dt_trans_create)(const struct lu_env *env,
132 int (*dt_trans_start)(const struct lu_env *env,
137 int (*dt_trans_stop)(const struct lu_env *env,
147 int (*dt_root_get)(const struct lu_env *env,
152 void (*dt_conf_get)(const struct lu_env *env,
158 int (*dt_sync)(const struct lu_env *env, struct dt_device *dev);
159 int (*dt_ro)(const struct lu_env *env, struct dt_device *dev);
163 * \param env environment
168 int (*dt_commit_async)(const struct lu_env *env,
173 int (*dt_init_capa_ctxt)(const struct lu_env *env,
284 void (*do_read_lock)(const struct lu_env *env,
286 void (*do_write_lock)(const struct lu_env *env,
288 void (*do_read_unlock)(const struct lu_env *env,
290 void (*do_write_unlock)(const struct lu_env *env,
292 int (*do_write_locked)(const struct lu_env *env,
309 int (*do_attr_get)(const struct lu_env *env,
317 int (*do_declare_attr_set)(const struct lu_env *env,
321 int (*do_attr_set)(const struct lu_env *env,
331 int (*do_xattr_get)(const struct lu_env *env, struct dt_object *dt,
341 int (*do_declare_xattr_set)(const struct lu_env *env,
346 int (*do_xattr_set)(const struct lu_env *env,
355 int (*do_declare_xattr_del)(const struct lu_env *env,
358 int (*do_xattr_del)(const struct lu_env *env,
368 int (*do_xattr_list)(const struct lu_env *env,
378 void (*do_ah_init)(const struct lu_env *env,
389 int (*do_declare_create)(const struct lu_env *env,
395 int (*do_create)(const struct lu_env *env, struct dt_object *dt,
406 int (*do_declare_destroy)(const struct lu_env *env,
409 int (*do_destroy)(const struct lu_env *env, struct dt_object *dt,
420 int (*do_index_try)(const struct lu_env *env,
427 int (*do_declare_ref_add)(const struct lu_env *env,
429 int (*do_ref_add)(const struct lu_env *env,
435 int (*do_declare_ref_del)(const struct lu_env *env,
437 int (*do_ref_del)(const struct lu_env *env,
440 struct obd_capa *(*do_capa_get)(const struct lu_env *env,
444 int (*do_object_sync)(const struct lu_env *env, struct dt_object *obj,
451 int (*do_data_get)(const struct lu_env *env, struct dt_object *dt,
457 int (*do_object_lock)(const struct lu_env *env, struct dt_object *dt,
470 ssize_t (*dbo_read)(const struct lu_env *env, struct dt_object *dt,
476 ssize_t (*dbo_declare_write)(const struct lu_env *env,
480 ssize_t (*dbo_write)(const struct lu_env *env, struct dt_object *dt,
495 int (*dbo_bufs_get)(const struct lu_env *env, struct dt_object *dt,
501 int (*dbo_bufs_put)(const struct lu_env *env, struct dt_object *dt,
506 int (*dbo_write_prep)(const struct lu_env *env, struct dt_object *dt,
511 int (*dbo_declare_write_commit)(const struct lu_env *env,
518 int (*dbo_write_commit)(const struct lu_env *env, struct dt_object *dt,
523 int (*dbo_read_prep)(const struct lu_env *env, struct dt_object *dt,
525 int (*dbo_fiemap_get)(const struct lu_env *env, struct dt_object *dt,
533 int (*dbo_punch)(const struct lu_env *env, struct dt_object *dt,
560 int (*dio_lookup)(const struct lu_env *env, struct dt_object *dt,
566 int (*dio_declare_insert)(const struct lu_env *env,
571 int (*dio_insert)(const struct lu_env *env, struct dt_object *dt,
578 int (*dio_declare_delete)(const struct lu_env *env,
582 int (*dio_delete)(const struct lu_env *env, struct dt_object *dt,
594 struct dt_it *(*init)(const struct lu_env *env,
598 void (*fini)(const struct lu_env *env,
600 int (*get)(const struct lu_env *env,
603 void (*put)(const struct lu_env *env,
605 int (*next)(const struct lu_env *env,
607 struct dt_key *(*key)(const struct lu_env *env,
609 int (*key_size)(const struct lu_env *env,
611 int (*rec)(const struct lu_env *env,
615 __u64 (*store)(const struct lu_env *env,
617 int (*load)(const struct lu_env *env,
619 int (*key_rec)(const struct lu_env *env,
783 int (*dtc_txn_start)(const struct lu_env *env,
785 int (*dtc_txn_stop)(const struct lu_env *env,
796 int dt_txn_hook_start(const struct lu_env *env,
798 int dt_txn_hook_stop(const struct lu_env *env, struct thandle *txn);
801 int dt_try_as_dir(const struct lu_env *env, struct dt_object *obj);
807 typedef int (*dt_entry_func_t)(const struct lu_env *env,
813 int dt_path_parser(const struct lu_env *env,
818 dt_store_resolve(const struct lu_env *env, struct dt_device *dt,
821 struct dt_object *dt_store_open(const struct lu_env *env,
827 struct dt_object *dt_find_or_create(const struct lu_env *env,
833 struct dt_object *dt_locate_at(const struct lu_env *env,
838 dt_locate(const struct lu_env *env, struct dt_device *dev, dt_locate() argument
841 return dt_locate_at(env, dev, fid, dev->dd_lu_dev.ld_site->ls_top_dev); dt_locate()
845 int local_oid_storage_init(const struct lu_env *env, struct dt_device *dev,
848 void local_oid_storage_fini(const struct lu_env *env,
850 int local_object_fid_generate(const struct lu_env *env,
853 int local_object_declare_create(const struct lu_env *env,
859 int local_object_create(const struct lu_env *env,
864 struct dt_object *local_file_find_or_create(const struct lu_env *env,
868 struct dt_object *local_file_find_or_create_with_fid(const struct lu_env *env,
875 local_index_find_or_create(const struct lu_env *env,
881 local_index_find_or_create_with_fid(const struct lu_env *env,
887 int local_object_unlink(const struct lu_env *env, struct dt_device *dt,
890 static inline int dt_object_lock(const struct lu_env *env, dt_object_lock() argument
898 return o->do_ops->do_object_lock(env, o, lh, einfo, policy); dt_object_lock()
901 int dt_lookup_dir(const struct lu_env *env, struct dt_object *dir,
904 static inline int dt_object_sync(const struct lu_env *env, struct dt_object *o, dt_object_sync() argument
910 return o->do_ops->do_object_sync(env, o, start, end); dt_object_sync()
913 int dt_declare_version_set(const struct lu_env *env, struct dt_object *o,
915 void dt_version_set(const struct lu_env *env, struct dt_object *o,
917 dt_obj_version_t dt_version_get(const struct lu_env *env, struct dt_object *o);
920 int dt_read(const struct lu_env *env, struct dt_object *dt,
922 int dt_record_read(const struct lu_env *env, struct dt_object *dt,
924 int dt_record_write(const struct lu_env *env, struct dt_object *dt,
926 typedef int (*dt_index_page_build_t)(const struct lu_env *env,
930 int dt_index_walk(const struct lu_env *env, struct dt_object *obj,
933 int dt_index_read(const struct lu_env *env, struct dt_device *dev,
936 static inline struct thandle *dt_trans_create(const struct lu_env *env, dt_trans_create() argument
940 return d->dd_ops->dt_trans_create(env, d); dt_trans_create()
943 static inline int dt_trans_start(const struct lu_env *env, dt_trans_start() argument
947 return d->dd_ops->dt_trans_start(env, d, th); dt_trans_start()
951 static inline int dt_trans_start_local(const struct lu_env *env, dt_trans_start_local() argument
956 return d->dd_ops->dt_trans_start(env, d, th); dt_trans_start_local()
959 static inline int dt_trans_stop(const struct lu_env *env, dt_trans_stop() argument
963 return d->dd_ops->dt_trans_stop(env, th); dt_trans_stop()
976 static inline int dt_declare_record_write(const struct lu_env *env, dt_declare_record_write() argument
987 rc = dt->do_body_ops->dbo_declare_write(env, dt, size, pos, th); dt_declare_record_write()
991 static inline int dt_declare_create(const struct lu_env *env, dt_declare_create() argument
1001 return dt->do_ops->do_declare_create(env, dt, attr, hint, dof, th); dt_declare_create()
1004 static inline int dt_create(const struct lu_env *env, dt_create() argument
1014 return dt->do_ops->do_create(env, dt, attr, hint, dof, th); dt_create()
1017 static inline int dt_declare_destroy(const struct lu_env *env, dt_declare_destroy() argument
1024 return dt->do_ops->do_declare_destroy(env, dt, th); dt_declare_destroy()
1027 static inline int dt_destroy(const struct lu_env *env, dt_destroy() argument
1034 return dt->do_ops->do_destroy(env, dt, th); dt_destroy()
1037 static inline void dt_read_lock(const struct lu_env *env, dt_read_lock() argument
1044 dt->do_ops->do_read_lock(env, dt, role); dt_read_lock()
1047 static inline void dt_write_lock(const struct lu_env *env, dt_write_lock() argument
1054 dt->do_ops->do_write_lock(env, dt, role); dt_write_lock()
1057 static inline void dt_read_unlock(const struct lu_env *env, dt_read_unlock() argument
1063 dt->do_ops->do_read_unlock(env, dt); dt_read_unlock()
1066 static inline void dt_write_unlock(const struct lu_env *env, dt_write_unlock() argument
1072 dt->do_ops->do_write_unlock(env, dt); dt_write_unlock()
1075 static inline int dt_write_locked(const struct lu_env *env, dt_write_locked() argument
1081 return dt->do_ops->do_write_locked(env, dt); dt_write_locked()
1084 static inline int dt_attr_get(const struct lu_env *env, struct dt_object *dt, dt_attr_get() argument
1090 return dt->do_ops->do_attr_get(env, dt, la, arg); dt_attr_get()
1093 static inline int dt_declare_attr_set(const struct lu_env *env, dt_declare_attr_set() argument
1101 return dt->do_ops->do_declare_attr_set(env, dt, la, th); dt_declare_attr_set()
1104 static inline int dt_attr_set(const struct lu_env *env, struct dt_object *dt, dt_attr_set() argument
1111 return dt->do_ops->do_attr_set(env, dt, la, th, capa); dt_attr_set()
1114 static inline int dt_declare_ref_add(const struct lu_env *env, dt_declare_ref_add() argument
1120 return dt->do_ops->do_declare_ref_add(env, dt, th); dt_declare_ref_add()
1123 static inline int dt_ref_add(const struct lu_env *env, dt_ref_add() argument
1129 return dt->do_ops->do_ref_add(env, dt, th); dt_ref_add()
1132 static inline int dt_declare_ref_del(const struct lu_env *env, dt_declare_ref_del() argument
1138 return dt->do_ops->do_declare_ref_del(env, dt, th); dt_declare_ref_del()
1141 static inline int dt_ref_del(const struct lu_env *env, dt_ref_del() argument
1147 return dt->do_ops->do_ref_del(env, dt, th); dt_ref_del()
1150 static inline struct obd_capa *dt_capa_get(const struct lu_env *env, dt_capa_get() argument
1157 return dt->do_ops->do_capa_get(env, dt, old, opc); dt_capa_get()
1160 static inline int dt_bufs_get(const struct lu_env *env, struct dt_object *d, dt_bufs_get() argument
1168 return d->do_body_ops->dbo_bufs_get(env, d, rnb->offset, dt_bufs_get()
1172 static inline int dt_bufs_put(const struct lu_env *env, struct dt_object *d, dt_bufs_put() argument
1178 return d->do_body_ops->dbo_bufs_put(env, d, lnb, n); dt_bufs_put()
1181 static inline int dt_write_prep(const struct lu_env *env, struct dt_object *d, dt_write_prep() argument
1187 return d->do_body_ops->dbo_write_prep(env, d, lnb, n); dt_write_prep()
1190 static inline int dt_declare_write_commit(const struct lu_env *env, dt_declare_write_commit() argument
1197 return d->do_body_ops->dbo_declare_write_commit(env, d, lnb, n, th); dt_declare_write_commit()
1201 static inline int dt_write_commit(const struct lu_env *env, dt_write_commit() argument
1208 return d->do_body_ops->dbo_write_commit(env, d, lnb, n, th); dt_write_commit()
1211 static inline int dt_read_prep(const struct lu_env *env, struct dt_object *d, dt_read_prep() argument
1217 return d->do_body_ops->dbo_read_prep(env, d, lnb, n); dt_read_prep()
1220 static inline int dt_declare_punch(const struct lu_env *env, dt_declare_punch() argument
1227 return dt->do_body_ops->dbo_declare_punch(env, dt, start, end, th); dt_declare_punch()
1230 static inline int dt_punch(const struct lu_env *env, struct dt_object *dt, dt_punch() argument
1237 return dt->do_body_ops->dbo_punch(env, dt, start, end, th, capa); dt_punch()
1240 static inline int dt_fiemap_get(const struct lu_env *env, struct dt_object *d, dt_fiemap_get() argument
1248 return d->do_body_ops->dbo_fiemap_get(env, d, fm); dt_fiemap_get()
1251 static inline int dt_statfs(const struct lu_env *env, struct dt_device *dev, dt_statfs() argument
1257 return dev->dd_ops->dt_statfs(env, dev, osfs); dt_statfs()
1260 static inline int dt_root_get(const struct lu_env *env, struct dt_device *dev, dt_root_get() argument
1266 return dev->dd_ops->dt_root_get(env, dev, f); dt_root_get()
1269 static inline void dt_conf_get(const struct lu_env *env, dt_conf_get() argument
1276 return dev->dd_ops->dt_conf_get(env, dev, param); dt_conf_get()
1279 static inline int dt_sync(const struct lu_env *env, struct dt_device *dev) dt_sync() argument
1284 return dev->dd_ops->dt_sync(env, dev); dt_sync()
1287 static inline int dt_ro(const struct lu_env *env, struct dt_device *dev) dt_ro() argument
1292 return dev->dd_ops->dt_ro(env, dev); dt_ro()
1295 static inline int dt_declare_insert(const struct lu_env *env, dt_declare_insert() argument
1304 return dt->do_index_ops->dio_declare_insert(env, dt, rec, key, th); dt_declare_insert()
1307 static inline int dt_insert(const struct lu_env *env, dt_insert() argument
1318 return dt->do_index_ops->dio_insert(env, dt, rec, key, th, dt_insert()
1322 static inline int dt_declare_xattr_del(const struct lu_env *env, dt_declare_xattr_del() argument
1330 return dt->do_ops->do_declare_xattr_del(env, dt, name, th); dt_declare_xattr_del()
1333 static inline int dt_xattr_del(const struct lu_env *env, dt_xattr_del() argument
1341 return dt->do_ops->do_xattr_del(env, dt, name, th, capa); dt_xattr_del()
1344 static inline int dt_declare_xattr_set(const struct lu_env *env, dt_declare_xattr_set() argument
1353 return dt->do_ops->do_declare_xattr_set(env, dt, buf, name, fl, th); dt_declare_xattr_set()
1356 static inline int dt_xattr_set(const struct lu_env *env, dt_xattr_set() argument
1364 return dt->do_ops->do_xattr_set(env, dt, buf, name, fl, th, capa); dt_xattr_set()
1367 static inline int dt_xattr_get(const struct lu_env *env, dt_xattr_get() argument
1374 return dt->do_ops->do_xattr_get(env, dt, buf, name, capa); dt_xattr_get()
1377 static inline int dt_xattr_list(const struct lu_env *env, dt_xattr_list() argument
1384 return dt->do_ops->do_xattr_list(env, dt, buf, capa); dt_xattr_list()
1387 static inline int dt_declare_delete(const struct lu_env *env, dt_declare_delete() argument
1395 return dt->do_index_ops->dio_declare_delete(env, dt, key, th); dt_declare_delete()
1398 static inline int dt_delete(const struct lu_env *env, dt_delete() argument
1407 return dt->do_index_ops->dio_delete(env, dt, key, th, capa); dt_delete()
1410 static inline int dt_commit_async(const struct lu_env *env, dt_commit_async() argument
1416 return dev->dd_ops->dt_commit_async(env, dev); dt_commit_async()
1419 static inline int dt_init_capa_ctxt(const struct lu_env *env, dt_init_capa_ctxt() argument
1427 return dev->dd_ops->dt_init_capa_ctxt(env, dev, mode, dt_init_capa_ctxt()
1431 static inline int dt_lookup(const struct lu_env *env, dt_lookup() argument
1443 ret = dt->do_index_ops->dio_lookup(env, dt, rec, key, capa); dt_lookup()
1472 static inline struct dt_thread_info *dt_info(const struct lu_env *env) dt_info() argument
1476 dti = lu_context_key_get(&env->le_ctx, &dt_key); dt_info()
H A Dlclient.h49 int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io,
115 int cl_is_normalio(const struct lu_env *env, const struct cl_io *io);
126 static inline struct ccc_thread_info *ccc_env_info(const struct lu_env *env) ccc_env_info() argument
130 info = lu_context_key_get(&env->le_ctx, &ccc_key); ccc_env_info()
135 static inline struct cl_attr *ccc_env_thread_attr(const struct lu_env *env) ccc_env_thread_attr() argument
137 struct cl_attr *attr = &ccc_env_info(env)->cti_attr; ccc_env_thread_attr()
143 static inline struct cl_io *ccc_env_thread_io(const struct lu_env *env) ccc_env_thread_io() argument
145 struct cl_io *io = &ccc_env_info(env)->cti_io; ccc_env_thread_io()
155 static inline struct ccc_session *ccc_env_session(const struct lu_env *env) ccc_env_session() argument
159 ses = lu_context_key_get(env->le_ses, &ccc_session_key); ccc_env_session()
164 static inline struct ccc_io *ccc_env_io(const struct lu_env *env) ccc_env_io() argument
166 return &ccc_env_session(env)->cs_ios; ccc_env_io()
261 int ccc_device_init (const struct lu_env *env,
264 struct lu_device *ccc_device_fini (const struct lu_env *env,
266 struct lu_device *ccc_device_alloc(const struct lu_env *env,
271 struct lu_device *ccc_device_free (const struct lu_env *env,
273 struct lu_object *ccc_object_alloc(const struct lu_env *env,
279 int ccc_req_init(const struct lu_env *env, struct cl_device *dev,
281 void ccc_umount(const struct lu_env *env, struct cl_device *dev);
284 int ccc_object_init0(const struct lu_env *env, struct ccc_object *vob,
286 int ccc_object_init(const struct lu_env *env, struct lu_object *obj,
288 void ccc_object_free(const struct lu_env *env, struct lu_object *obj);
289 int ccc_lock_init(const struct lu_env *env, struct cl_object *obj,
292 int ccc_attr_set(const struct lu_env *env, struct cl_object *obj,
294 int ccc_object_glimpse(const struct lu_env *env,
296 int ccc_conf_set(const struct lu_env *env, struct cl_object *obj,
298 struct page *ccc_page_vmpage(const struct lu_env *env,
300 int ccc_page_is_under_lock(const struct lu_env *env,
302 int ccc_fail(const struct lu_env *env, const struct cl_page_slice *slice);
304 int ccc_transient_page_own(const struct lu_env *env,
307 void ccc_transient_page_assume(const struct lu_env *env,
310 void ccc_transient_page_unassume(const struct lu_env *env,
313 void ccc_transient_page_disown(const struct lu_env *env,
316 void ccc_transient_page_discard(const struct lu_env *env,
319 int ccc_transient_page_prep(const struct lu_env *env,
322 void ccc_lock_delete(const struct lu_env *env,
324 void ccc_lock_fini(const struct lu_env *env, struct cl_lock_slice *slice);
325 int ccc_lock_enqueue(const struct lu_env *env,
328 int ccc_lock_use(const struct lu_env *env, const struct cl_lock_slice *slice);
329 int ccc_lock_unuse(const struct lu_env *env, const struct cl_lock_slice *slice);
330 int ccc_lock_wait(const struct lu_env *env, const struct cl_lock_slice *slice);
331 int ccc_lock_fits_into(const struct lu_env *env,
335 void ccc_lock_state(const struct lu_env *env,
339 void ccc_io_fini(const struct lu_env *env, const struct cl_io_slice *ios);
340 int ccc_io_one_lock_index(const struct lu_env *env, struct cl_io *io,
343 int ccc_io_one_lock(const struct lu_env *env, struct cl_io *io,
346 void ccc_io_end(const struct lu_env *env, const struct cl_io_slice *ios);
347 void ccc_io_advance(const struct lu_env *env, const struct cl_io_slice *ios,
349 void ccc_io_update_iov(const struct lu_env *env, struct ccc_io *cio,
351 int ccc_prep_size(const struct lu_env *env, struct cl_object *obj,
353 void ccc_req_completion(const struct lu_env *env,
355 void ccc_req_attr_set(const struct lu_env *env,
367 struct ccc_io *cl2ccc_io (const struct lu_env *env,
387 # define CLOBINVRNT(env, clob, expr) \
388 ((void)sizeof(env), (void)sizeof(clob), (void)sizeof(!!(expr)))
H A Dlustre_log.h118 int llog_init_handle(const struct lu_env *env, struct llog_handle *handle,
120 int llog_copy_handler(const struct lu_env *env, struct llog_handle *llh,
122 int llog_process(const struct lu_env *env, struct llog_handle *loghandle,
124 int llog_process_or_fork(const struct lu_env *env,
127 int llog_reverse_process(const struct lu_env *env,
130 int llog_cancel_rec(const struct lu_env *env, struct llog_handle *loghandle,
132 int llog_open(const struct lu_env *env, struct llog_ctxt *ctxt,
135 int llog_close(const struct lu_env *env, struct llog_handle *cathandle);
136 int llog_is_empty(const struct lu_env *env, struct llog_ctxt *ctxt,
138 int llog_backup(const struct lu_env *env, struct obd_device *obd,
175 int llog_cat_close(const struct lu_env *env, struct llog_handle *cathandle);
176 int llog_cat_add_rec(const struct lu_env *env, struct llog_handle *cathandle,
179 int llog_cat_declare_add_rec(const struct lu_env *env,
182 int llog_cat_add(const struct lu_env *env, struct llog_handle *cathandle,
185 int llog_cat_cancel_records(const struct lu_env *env,
188 int llog_cat_process_or_fork(const struct lu_env *env,
191 int llog_cat_process(const struct lu_env *env, struct llog_handle *cat_llh,
193 int llog_cat_reverse_process(const struct lu_env *env,
196 int llog_cat_init_and_process(const struct lu_env *env,
200 int llog_setup(const struct lu_env *env, struct obd_device *obd,
203 int __llog_ctxt_put(const struct lu_env *env, struct llog_ctxt *ctxt);
204 int llog_cleanup(const struct lu_env *env, struct llog_ctxt *);
206 int llog_cancel(const struct lu_env *env, struct llog_ctxt *ctxt,
213 int (*lop_destroy)(const struct lu_env *env,
215 int (*lop_next_block)(const struct lu_env *env, struct llog_handle *h,
218 int (*lop_prev_block)(const struct lu_env *env, struct llog_handle *h,
220 int (*lop_read_header)(const struct lu_env *env,
222 int (*lop_setup)(const struct lu_env *env, struct obd_device *obd,
227 int (*lop_cleanup)(const struct lu_env *env, struct llog_ctxt *ctxt);
228 int (*lop_cancel)(const struct lu_env *env, struct llog_ctxt *ctxt,
237 int (*lop_open)(const struct lu_env *env, struct llog_handle *lgh,
249 int (*lop_close)(const struct lu_env *env, struct llog_handle *handle);
254 int (*lop_declare_create)(const struct lu_env *env,
257 int (*lop_create)(const struct lu_env *env, struct llog_handle *handle,
263 int (*lop_declare_write_rec)(const struct lu_env *env,
267 int (*lop_write_rec)(const struct lu_env *env,
276 int (*lop_declare_add)(const struct lu_env *env,
279 int (*lop_add)(const struct lu_env *env, struct llog_handle *lgh,
443 static inline int llog_destroy(const struct lu_env *env, llog_destroy() argument
455 rc = lop->lop_destroy(env, handle); llog_destroy()
459 static inline int llog_next_block(const struct lu_env *env, llog_next_block() argument
473 rc = lop->lop_next_block(env, loghandle, cur_idx, next_idx, llog_next_block()
478 static inline int llog_prev_block(const struct lu_env *env, llog_prev_block() argument
491 rc = lop->lop_prev_block(env, loghandle, prev_idx, buf, len); llog_prev_block()
514 int llog_declare_create(const struct lu_env *env,
516 int llog_create(const struct lu_env *env, struct llog_handle *handle,
518 int llog_declare_write_rec(const struct lu_env *env,
522 int llog_write_rec(const struct lu_env *env, struct llog_handle *handle,
525 int llog_add(const struct lu_env *env, struct llog_handle *lgh,
528 int llog_declare_add(const struct lu_env *env, struct llog_handle *lgh,
534 int llog_open_create(const struct lu_env *env, struct llog_ctxt *ctxt,
537 int llog_erase(const struct lu_env *env, struct llog_ctxt *ctxt,
539 int llog_write(const struct lu_env *env, struct llog_handle *loghandle,
H A Dcl_object.h143 int (*cdo_req_init)(const struct lu_env *env, struct cl_device *dev,
322 int (*coo_page_init)(const struct lu_env *env, struct cl_object *obj,
331 int (*coo_lock_init)(const struct lu_env *env,
343 int (*coo_io_init)(const struct lu_env *env,
356 int (*coo_attr_get)(const struct lu_env *env, struct cl_object *obj,
369 int (*coo_attr_set)(const struct lu_env *env, struct cl_object *obj,
377 int (*coo_conf_set)(const struct lu_env *env, struct cl_object *obj,
387 int (*coo_glimpse)(const struct lu_env *env,
844 struct page *(*cpo_vmpage)(const struct lu_env *env,
855 int (*cpo_own)(const struct lu_env *env,
863 void (*cpo_disown)(const struct lu_env *env,
872 void (*cpo_assume)(const struct lu_env *env,
881 void (*cpo_unassume)(const struct lu_env *env,
890 void (*cpo_export)(const struct lu_env *env,
898 int (*cpo_unmap)(const struct lu_env *env,
908 int (*cpo_is_vmlocked)(const struct lu_env *env,
920 void (*cpo_discard)(const struct lu_env *env,
930 void (*cpo_delete)(const struct lu_env *env,
933 void (*cpo_fini)(const struct lu_env *env,
951 int (*cpo_is_under_lock)(const struct lu_env *env,
960 int (*cpo_print)(const struct lu_env *env,
980 * slice->cp_ops.io[req->crq_type].cpo_method(env, slice, ...);
993 int (*cpo_prep)(const struct lu_env *env,
1008 void (*cpo_completion)(const struct lu_env *env,
1021 int (*cpo_make_ready)(const struct lu_env *env,
1040 int (*cpo_cache_add)(const struct lu_env *env,
1057 void (*cpo_clip)(const struct lu_env *env,
1075 int (*cpo_cancel)(const struct lu_env *env,
1083 int (*cpo_flush)(const struct lu_env *env,
1092 #define CL_PAGE_DEBUG(mask, env, page, format, ...) \
1097 cl_page_print(env, &msgdata, lu_cdebug_printer, page); \
1105 #define CL_PAGE_HEADER(mask, env, page, format, ...) \
1110 cl_page_header_print(env, &msgdata, lu_cdebug_printer, page); \
1706 int (*clo_enqueue)(const struct lu_env *env,
1714 int (*clo_wait)(const struct lu_env *env,
1725 int (*clo_unuse)(const struct lu_env *env,
1734 int (*clo_use)(const struct lu_env *env,
1745 void (*clo_state)(const struct lu_env *env,
1760 int (*clo_fits_into)(const struct lu_env *env,
1775 void (*clo_cancel)(const struct lu_env *env,
1784 unsigned long (*clo_weigh)(const struct lu_env *env,
1791 int (*clo_closure)(const struct lu_env *env,
1800 int (*clo_modify)(const struct lu_env *env,
1813 void (*clo_delete)(const struct lu_env *env,
1821 void (*clo_fini)(const struct lu_env *env, struct cl_lock_slice *slice);
1825 int (*clo_print)(const struct lu_env *env,
1830 #define CL_LOCK_DEBUG(mask, env, lock, format, ...) \
1835 cl_lock_print(env, &msgdata, lu_cdebug_printer, lock); \
1840 #define CL_LOCK_ASSERT(expr, env, lock) do { \
1844 CL_LOCK_DEBUG(D_ERROR, env, lock, "failed at %s.\n", #expr); \
2044 int (*cio_iter_init) (const struct lu_env *env,
2055 void (*cio_iter_fini) (const struct lu_env *env,
2066 int (*cio_lock) (const struct lu_env *env,
2075 void (*cio_unlock)(const struct lu_env *env,
2086 int (*cio_start)(const struct lu_env *env,
2092 void (*cio_end) (const struct lu_env *env,
2098 void (*cio_advance)(const struct lu_env *env,
2104 void (*cio_fini) (const struct lu_env *env,
2116 int (*cio_submit)(const struct lu_env *env,
2129 int (*cio_read_page)(const struct lu_env *env,
2142 int (*cio_prepare_write)(const struct lu_env *env,
2153 int (*cio_commit_write)(const struct lu_env *env,
2160 int (*cio_print)(const struct lu_env *env, void *cookie,
2224 void (*cill_fini)(const struct lu_env *env,
2495 int (*cro_prep)(const struct lu_env *env,
2508 void (*cro_attr_set)(const struct lu_env *env,
2517 void (*cro_completion)(const struct lu_env *env,
2634 void cl_stack_fini(const struct lu_env *env, struct cl_device *cl);
2735 struct cl_object *cl_object_find(const struct lu_env *env, struct cl_device *cd,
2741 void cl_object_put (const struct lu_env *env, struct cl_object *o);
2745 int cl_object_attr_get (const struct lu_env *env, struct cl_object *obj,
2747 int cl_object_attr_set (const struct lu_env *env, struct cl_object *obj,
2749 int cl_object_glimpse (const struct lu_env *env, struct cl_object *obj,
2751 int cl_conf_set (const struct lu_env *env, struct cl_object *obj,
2753 void cl_object_prune (const struct lu_env *env, struct cl_object *obj);
2754 void cl_object_kill (const struct lu_env *env, struct cl_object *obj);
2791 int cl_page_gang_lookup (const struct lu_env *env,
2798 struct cl_page *cl_page_find (const struct lu_env *env,
2802 struct cl_page *cl_page_find_sub (const struct lu_env *env,
2807 void cl_page_put (const struct lu_env *env,
2809 void cl_page_print (const struct lu_env *env, void *cookie,
2812 void cl_page_header_print(const struct lu_env *env, void *cookie,
2815 struct page *cl_page_vmpage (const struct lu_env *env,
2830 int cl_page_own (const struct lu_env *env,
2832 int cl_page_own_try (const struct lu_env *env,
2834 void cl_page_assume (const struct lu_env *env,
2836 void cl_page_unassume (const struct lu_env *env,
2838 void cl_page_disown (const struct lu_env *env,
2851 int cl_page_prep (const struct lu_env *env, struct cl_io *io,
2853 void cl_page_completion (const struct lu_env *env,
2855 int cl_page_make_ready (const struct lu_env *env, struct cl_page *pg,
2857 int cl_page_cache_add (const struct lu_env *env, struct cl_io *io,
2859 void cl_page_clip (const struct lu_env *env, struct cl_page *pg,
2861 int cl_page_cancel (const struct lu_env *env, struct cl_page *page);
2862 int cl_page_flush (const struct lu_env *env, struct cl_io *io,
2873 void cl_page_discard (const struct lu_env *env, struct cl_io *io,
2875 void cl_page_delete (const struct lu_env *env, struct cl_page *pg);
2876 int cl_page_unmap (const struct lu_env *env, struct cl_io *io,
2878 int cl_page_is_vmlocked (const struct lu_env *env,
2880 void cl_page_export (const struct lu_env *env,
2882 int cl_page_is_under_lock(const struct lu_env *env, struct cl_io *io,
2887 int cl_pages_prune (const struct lu_env *env, struct cl_object *obj);
2889 void cl_lock_print (const struct lu_env *env, void *cookie,
2891 void cl_lock_descr_print(const struct lu_env *env, void *cookie,
2901 struct cl_lock *cl_lock_hold(const struct lu_env *env, const struct cl_io *io,
2904 struct cl_lock *cl_lock_peek(const struct lu_env *env, const struct cl_io *io,
2907 struct cl_lock *cl_lock_request(const struct lu_env *env, struct cl_io *io,
2910 struct cl_lock *cl_lock_at_pgoff(const struct lu_env *env,
2914 static inline struct cl_lock *cl_lock_at_page(const struct lu_env *env, cl_lock_at_page() argument
2921 return cl_lock_at_pgoff(env, obj, page->cp_index, except, cl_lock_at_page()
2930 void cl_lock_put (const struct lu_env *env, struct cl_lock *lock);
2931 void cl_lock_hold_add (const struct lu_env *env, struct cl_lock *lock,
2933 void cl_lock_hold_release(const struct lu_env *env, struct cl_lock *lock,
2935 void cl_lock_unhold (const struct lu_env *env, struct cl_lock *lock,
2937 void cl_lock_release (const struct lu_env *env, struct cl_lock *lock,
2939 void cl_lock_user_add (const struct lu_env *env, struct cl_lock *lock);
2940 void cl_lock_user_del (const struct lu_env *env, struct cl_lock *lock);
2942 enum cl_lock_state cl_lock_intransit(const struct lu_env *env,
2944 void cl_lock_extransit(const struct lu_env *env, struct cl_lock *lock,
2948 int cl_lock_enqueue_wait(const struct lu_env *env, struct cl_lock *lock,
2983 int cl_enqueue (const struct lu_env *env, struct cl_lock *lock,
2985 int cl_wait (const struct lu_env *env, struct cl_lock *lock);
2986 void cl_unuse (const struct lu_env *env, struct cl_lock *lock);
2987 int cl_enqueue_try(const struct lu_env *env, struct cl_lock *lock,
2989 int cl_unuse_try (const struct lu_env *env, struct cl_lock *lock);
2990 int cl_wait_try (const struct lu_env *env, struct cl_lock *lock);
2991 int cl_use_try (const struct lu_env *env, struct cl_lock *lock, int atomic);
2995 void cl_lock_signal (const struct lu_env *env, struct cl_lock *lock);
2996 int cl_lock_state_wait (const struct lu_env *env, struct cl_lock *lock);
2997 void cl_lock_state_set (const struct lu_env *env, struct cl_lock *lock,
3002 void cl_lock_mutex_get (const struct lu_env *env, struct cl_lock *lock);
3003 int cl_lock_mutex_try (const struct lu_env *env, struct cl_lock *lock);
3004 void cl_lock_mutex_put (const struct lu_env *env, struct cl_lock *lock);
3006 int cl_lock_nr_mutexed (const struct lu_env *env);
3007 int cl_lock_discard_pages(const struct lu_env *env, struct cl_lock *lock);
3013 int cl_lock_modify (const struct lu_env *env, struct cl_lock *lock,
3016 void cl_lock_closure_init (const struct lu_env *env,
3020 int cl_lock_closure_build(const struct lu_env *env, struct cl_lock *lock,
3022 void cl_lock_disclosure (const struct lu_env *env,
3024 int cl_lock_enclosure (const struct lu_env *env, struct cl_lock *lock,
3027 void cl_lock_cancel(const struct lu_env *env, struct cl_lock *lock);
3028 void cl_lock_delete(const struct lu_env *env, struct cl_lock *lock);
3029 void cl_lock_error (const struct lu_env *env, struct cl_lock *lock, int error);
3030 void cl_locks_prune(const struct lu_env *env, struct cl_object *obj, int wait);
3032 unsigned long cl_lock_weigh(const struct lu_env *env, struct cl_lock *lock);
3039 int cl_io_init (const struct lu_env *env, struct cl_io *io,
3041 int cl_io_sub_init (const struct lu_env *env, struct cl_io *io,
3043 int cl_io_rw_init (const struct lu_env *env, struct cl_io *io,
3045 int cl_io_loop (const struct lu_env *env, struct cl_io *io);
3047 void cl_io_fini (const struct lu_env *env, struct cl_io *io);
3048 int cl_io_iter_init (const struct lu_env *env, struct cl_io *io);
3049 void cl_io_iter_fini (const struct lu_env *env, struct cl_io *io);
3050 int cl_io_lock (const struct lu_env *env, struct cl_io *io);
3051 void cl_io_unlock (const struct lu_env *env, struct cl_io *io);
3052 int cl_io_start (const struct lu_env *env, struct cl_io *io);
3053 void cl_io_end (const struct lu_env *env, struct cl_io *io);
3054 int cl_io_lock_add (const struct lu_env *env, struct cl_io *io,
3056 int cl_io_lock_alloc_add(const struct lu_env *env, struct cl_io *io,
3058 int cl_io_read_page (const struct lu_env *env, struct cl_io *io,
3060 int cl_io_prepare_write(const struct lu_env *env, struct cl_io *io,
3062 int cl_io_commit_write (const struct lu_env *env, struct cl_io *io,
3064 int cl_io_submit_rw (const struct lu_env *env, struct cl_io *io,
3066 int cl_io_submit_sync (const struct lu_env *env, struct cl_io *io,
3069 void cl_io_rw_advance (const struct lu_env *env, struct cl_io *io,
3071 int cl_io_cancel (const struct lu_env *env, struct cl_io *io,
3073 int cl_io_is_going (const struct lu_env *env);
3104 void cl_io_print(const struct lu_env *env, void *cookie,
3148 void cl_page_list_del (const struct lu_env *env,
3150 void cl_page_list_disown (const struct lu_env *env,
3152 int cl_page_list_own (const struct lu_env *env,
3154 void cl_page_list_assume (const struct lu_env *env,
3156 void cl_page_list_discard(const struct lu_env *env,
3158 int cl_page_list_unmap (const struct lu_env *env,
3160 void cl_page_list_fini (const struct lu_env *env, struct cl_page_list *plist);
3164 void cl_2queue_disown (const struct lu_env *env,
3166 void cl_2queue_assume (const struct lu_env *env,
3168 void cl_2queue_discard (const struct lu_env *env,
3170 void cl_2queue_fini (const struct lu_env *env, struct cl_2queue *queue);
3177 struct cl_req *cl_req_alloc(const struct lu_env *env, struct cl_page *page,
3180 void cl_req_page_add (const struct lu_env *env, struct cl_req *req,
3182 void cl_req_page_done (const struct lu_env *env, struct cl_page *page);
3183 int cl_req_prep (const struct lu_env *env, struct cl_req *req);
3184 void cl_req_attr_set (const struct lu_env *env, struct cl_req *req,
3186 void cl_req_completion(const struct lu_env *env, struct cl_req *req, int ioret);
3209 int cl_sync_io_wait(const struct lu_env *env, struct cl_io *io,
3264 void cl_env_put (struct lu_env *env, int *refcheck);
3265 void cl_env_nested_put (struct cl_env_nest *nest, struct lu_env *env);
3268 void cl_env_implant (struct lu_env *env, int *refcheck);
3269 void cl_env_unplant (struct lu_env *env, int *refcheck);
3279 struct cl_device *cl_type_setup(const struct lu_env *env, struct lu_site *site,
H A Dlu_object.h142 struct lu_object *(*ldo_object_alloc)(const struct lu_env *env,
148 int (*ldo_process_config)(const struct lu_env *env,
193 typedef int (*lu_printer_t)(const struct lu_env *env,
211 int (*loo_object_init)(const struct lu_env *env,
219 int (*loo_object_start)(const struct lu_env *env,
226 void (*loo_object_delete)(const struct lu_env *env,
232 void (*loo_object_free)(const struct lu_env *env,
238 void (*loo_object_release)(const struct lu_env *env,
243 int (*loo_object_print)(const struct lu_env *env, void *cookie,
352 struct lu_device *(*ldto_device_alloc)(const struct lu_env *env,
366 int (*ldto_device_init)(const struct lu_env *env,
374 struct lu_device *(*ldto_device_fini)(const struct lu_env *env,
662 void lu_stack_fini (const struct lu_env *env, struct lu_device *top);
713 void lu_object_put(const struct lu_env *env, struct lu_object *o);
714 void lu_object_put_nocache(const struct lu_env *env, struct lu_object *o);
715 void lu_object_unhash(const struct lu_env *env, struct lu_object *o);
717 int lu_site_purge(const struct lu_env *env, struct lu_site *s, int nr);
719 void lu_site_print(const struct lu_env *env, struct lu_site *s, void *cookie,
721 struct lu_object *lu_object_find(const struct lu_env *env,
724 struct lu_object *lu_object_find_at(const struct lu_env *env,
728 struct lu_object *lu_object_find_slice(const struct lu_env *env,
783 int lu_cdebug_printer(const struct lu_env *env,
789 #define LU_OBJECT_DEBUG(mask, env, object, format, ...) \
794 lu_object_print(env, &msgdata, lu_cdebug_printer, object);\
802 #define LU_OBJECT_HEADER(mask, env, object, format, ...) \
807 lu_object_header_print(env, &msgdata, lu_cdebug_printer,\
809 lu_cdebug_printer(env, &msgdata, "\n"); \
814 void lu_object_print (const struct lu_env *env, void *cookie,
816 void lu_object_header_print(const struct lu_env *env, void *cookie,
1267 int lu_env_init (struct lu_env *env, __u32 tags);
1268 void lu_env_fini (struct lu_env *env);
1269 int lu_env_refill(struct lu_env *env);
1270 int lu_env_refill_by_tags(struct lu_env *env, __u32 ctags, __u32 stags);
1323 void lu_object_assign_fid(const struct lu_env *env, struct lu_object *o,
1325 struct lu_object *lu_object_anon(const struct lu_env *env,
H A Dlustre_fld.h141 __u32 flags, const struct lu_env *env);
145 const struct lu_env *env);
148 const struct lu_env *env);
H A Dobd_class.h136 int class_config_llog_handler(const struct lu_env *env,
168 int class_config_parse_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
170 int class_config_dump_llog(const struct lu_env *env, struct llog_ctxt *ctxt,
507 static inline int obd_get_info(const struct lu_env *env, obd_get_info() argument
517 rc = OBP(exp->exp_obd, get_info)(env, exp, keylen, key, vallen, val, obd_get_info()
522 static inline int obd_set_info_async(const struct lu_env *env, obd_set_info_async() argument
532 rc = OBP(exp->exp_obd, set_info_async)(env, exp, keylen, key, vallen, obd_set_info_async()
567 struct lu_env env; obd_setup() local
572 rc = lu_env_init(&env, ldt->ldt_ctx_tags); obd_setup()
574 env.le_ses = &session_ctx; obd_setup()
575 d = ldt->ldt_ops->ldto_device_alloc(&env, ldt, cfg); obd_setup()
576 lu_env_fini(&env); obd_setup()
608 struct lu_env env; obd_precleanup() local
610 rc = lu_env_init(&env, ldt->ldt_ctx_tags); obd_precleanup()
612 ldt->ldt_ops->ldto_device_fini(&env, d); obd_precleanup()
613 lu_env_fini(&env); obd_precleanup()
636 struct lu_env env; obd_cleanup() local
638 rc = lu_env_init(&env, ldt->ldt_ctx_tags); obd_cleanup()
640 ldt->ldt_ops->ldto_device_free(&env, d); obd_cleanup()
641 lu_env_fini(&env); obd_cleanup()
687 struct lu_env env; obd_process_config() local
689 rc = lu_env_init(&env, ldt->ldt_ctx_tags); obd_process_config()
691 rc = d->ld_ops->ldo_process_config(&env, d, data); obd_process_config()
692 lu_env_fini(&env); obd_process_config()
790 static inline int obd_create(const struct lu_env *env, struct obd_export *exp, obd_create() argument
799 rc = OBP(exp->exp_obd, create)(env, exp, obdo, ea, oti); obd_create()
803 static inline int obd_destroy(const struct lu_env *env, struct obd_export *exp, obd_destroy() argument
813 rc = OBP(exp->exp_obd, destroy)(env, exp, obdo, ea, oti, md_exp, capa); obd_destroy()
817 static inline int obd_getattr(const struct lu_env *env, struct obd_export *exp, obd_getattr() argument
825 rc = OBP(exp->exp_obd, getattr)(env, exp, oinfo); obd_getattr()
842 static inline int obd_setattr(const struct lu_env *env, struct obd_export *exp, obd_setattr() argument
851 rc = OBP(exp->exp_obd, setattr)(env, exp, oinfo, oti); obd_setattr()
940 static inline int obd_connect(const struct lu_env *env, obd_connect() argument
956 rc = OBP(obd, connect)(env, exp, obd, cluuid, data, localdata); obd_connect()
963 static inline int obd_reconnect(const struct lu_env *env, obd_reconnect() argument
980 rc = OBP(obd, reconnect)(env, exp, obd, cluuid, d, localdata); obd_reconnect()
1174 static inline int obd_statfs(const struct lu_env *env, struct obd_export *exp, obd_statfs() argument
1190 rc = OBP(obd, statfs)(env, exp, osfs, max_age, flags); obd_statfs()
1209 static inline int obd_preprw(const struct lu_env *env, int cmd, obd_preprw() argument
1222 rc = OBP(exp->exp_obd, preprw)(env, cmd, exp, oa, objcount, obj, remote, obd_preprw()
1227 static inline int obd_commitrw(const struct lu_env *env, int cmd, obd_commitrw() argument
1237 rc = OBP(exp->exp_obd, commitrw)(env, cmd, exp, oa, objcount, obj, obd_commitrw()
1375 static inline int obd_health_check(const struct lu_env *env, obd_health_check() argument
1397 rc = OBP(obd, health_check)(env, obd); obd_health_check()
H A Dlustre_fid.h441 const struct lu_env *env);
444 const struct lu_env *env);
448 const struct lu_env *env);
452 const struct lu_env *env);
456 const struct lu_env *env);
469 int seq_client_alloc_fid(const struct lu_env *env, struct lu_client_seq *seq,
471 int seq_client_get_seq(const struct lu_env *env, struct lu_client_seq *seq,
473 int seq_site_fini(const struct lu_env *env, struct seq_server_site *ss);
475 int fid_is_local(const struct lu_env *env,
H A Dobd.h1106 int (*o_get_info)(const struct lu_env *env, struct obd_export *,
1128 int (*o_connect)(const struct lu_env *env,
1132 int (*o_reconnect)(const struct lu_env *env,
1163 int (*o_create)(const struct lu_env *env, struct obd_export *exp,
1166 int (*o_destroy)(const struct lu_env *env, struct obd_export *exp,
1175 int (*o_getattr)(const struct lu_env *env, struct obd_export *exp,
1181 int (*o_preprw)(const struct lu_env *env, int cmd,
1186 int (*o_commitrw)(const struct lu_env *env, int cmd,
1204 int (*o_health_check)(const struct lu_env *env, struct obd_device *);
/linux-4.1.27/lib/
H A Dkobject_uevent.c129 static int init_uevent_argv(struct kobj_uevent_env *env, const char *subsystem) init_uevent_argv() argument
133 len = strlcpy(&env->buf[env->buflen], subsystem, init_uevent_argv()
134 sizeof(env->buf) - env->buflen); init_uevent_argv()
135 if (len >= (sizeof(env->buf) - env->buflen)) { init_uevent_argv()
140 env->argv[0] = uevent_helper; init_uevent_argv()
141 env->argv[1] = &env->buf[env->buflen]; init_uevent_argv()
142 env->argv[2] = NULL; init_uevent_argv()
144 env->buflen += len + 1; init_uevent_argv()
167 struct kobj_uevent_env *env; kobject_uevent_env() local
227 env = kzalloc(sizeof(struct kobj_uevent_env), GFP_KERNEL); kobject_uevent_env()
228 if (!env) kobject_uevent_env()
239 retval = add_uevent_var(env, "ACTION=%s", action_string); kobject_uevent_env()
242 retval = add_uevent_var(env, "DEVPATH=%s", devpath); kobject_uevent_env()
245 retval = add_uevent_var(env, "SUBSYSTEM=%s", subsystem); kobject_uevent_env()
252 retval = add_uevent_var(env, "%s", envp_ext[i]); kobject_uevent_env()
260 retval = uevent_ops->uevent(kset, kobj, env); kobject_uevent_env()
282 retval = add_uevent_var(env, "SEQNUM=%llu", (unsigned long long)++uevent_seqnum); kobject_uevent_env()
300 skb = alloc_skb(len + env->buflen, GFP_KERNEL); kobject_uevent_env()
309 for (i = 0; i < env->envp_idx; i++) { kobject_uevent_env()
310 len = strlen(env->envp[i]) + 1; kobject_uevent_env()
312 strcpy(scratch, env->envp[i]); kobject_uevent_env()
334 retval = add_uevent_var(env, "HOME=/"); kobject_uevent_env()
337 retval = add_uevent_var(env, kobject_uevent_env()
341 retval = init_uevent_argv(env, subsystem); kobject_uevent_env()
346 info = call_usermodehelper_setup(env->argv[0], env->argv, kobject_uevent_env()
347 env->envp, GFP_KERNEL, kobject_uevent_env()
348 NULL, cleanup_uevent_env, env); kobject_uevent_env()
351 env = NULL; /* freed by cleanup_uevent_env */ kobject_uevent_env()
358 kfree(env); kobject_uevent_env()
380 * @env: environment buffer structure
386 int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...) add_uevent_var() argument
391 if (env->envp_idx >= ARRAY_SIZE(env->envp)) { add_uevent_var()
397 len = vsnprintf(&env->buf[env->buflen], add_uevent_var()
398 sizeof(env->buf) - env->buflen, add_uevent_var()
402 if (len >= (sizeof(env->buf) - env->buflen)) { add_uevent_var()
407 env->envp[env->envp_idx++] = &env->buf[env->buflen]; add_uevent_var()
408 env->buflen += len + 1; add_uevent_var()
/linux-4.1.27/arch/mips/loongson1/common/
H A Dprom.c24 char **env = prom_envp; prom_getenv() local
29 while (*env) { prom_getenv()
30 if (strncmp(envname, *env, i) == 0 && *(*env + i) == '=') prom_getenv()
31 return *env + i + 1; prom_getenv()
32 env++; prom_getenv()
38 static inline unsigned long env_or_default(char *env, unsigned long dfl) env_or_default() argument
40 char *str = prom_getenv(env); env_or_default()
/linux-4.1.27/drivers/staging/lustre/lustre/lclient/
H A Dglimpse.c86 int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io, cl_glimpse_lock() argument
89 struct cl_lock_descr *descr = &ccc_env_info(env)->cti_descr; cl_glimpse_lock()
92 struct ccc_io *cio = ccc_env_io(env); cl_glimpse_lock()
128 lock = cl_lock_request(env, io, descr, "glimpse", cl_glimpse_lock()
139 result = cl_wait(env, lock); cl_glimpse_lock()
141 cl_merge_lvb(env, inode); cl_glimpse_lock()
152 cl_unuse(env, lock); cl_glimpse_lock()
154 cl_lock_release(env, lock, "glimpse", current); cl_glimpse_lock()
157 cl_merge_lvb(env, inode); cl_glimpse_lock()
167 struct lu_env *env; cl_io_get() local
174 env = cl_env_get(refcheck); cl_io_get()
175 if (!IS_ERR(env)) { cl_io_get()
176 io = ccc_env_thread_io(env); cl_io_get()
178 *envout = env; cl_io_get()
182 result = PTR_ERR(env); cl_io_get()
200 struct lu_env *env = NULL; cl_glimpse_size0() local
205 result = cl_io_get(inode, &env, &io, &refcheck); cl_glimpse_size0()
209 result = cl_io_init(env, io, CIT_MISC, io->ci_obj); cl_glimpse_size0()
217 result = cl_glimpse_lock(env, io, inode, io->ci_obj, cl_glimpse_size0()
221 cl_io_fini(env, io); cl_glimpse_size0()
224 cl_env_put(env, &refcheck); cl_glimpse_size0()
231 struct lu_env *env = NULL; cl_local_size() local
243 result = cl_io_get(inode, &env, &io, &refcheck); cl_local_size()
248 result = cl_io_init(env, io, CIT_MISC, clob); cl_local_size()
252 cti = ccc_env_info(env); cl_local_size()
257 lock = cl_lock_peek(env, io, descr, "localsize", current); cl_local_size()
259 cl_merge_lvb(env, inode); cl_local_size()
260 cl_unuse(env, lock); cl_local_size()
261 cl_lock_release(env, lock, "localsize", current); cl_local_size()
266 cl_io_fini(env, io); cl_local_size()
267 cl_env_put(env, &refcheck); cl_local_size()
H A Dlcommon_cl.c168 int ccc_device_init(const struct lu_env *env, struct lu_device *d, ccc_device_init() argument
180 env, next, next->ld_type->ldt_name, NULL); ccc_device_init()
188 struct lu_device *ccc_device_fini(const struct lu_env *env, ccc_device_fini() argument
194 struct lu_device *ccc_device_alloc(const struct lu_env *env, ccc_device_alloc() argument
227 ccc_device_free(env, lud); ccc_device_alloc()
233 struct lu_device *ccc_device_free(const struct lu_env *env, ccc_device_free() argument
249 int ccc_req_init(const struct lu_env *env, struct cl_device *dev, ccc_req_init() argument
322 struct lu_object *ccc_object_alloc(const struct lu_env *env, ccc_object_alloc() argument
348 int ccc_object_init0(const struct lu_env *env, ccc_object_init0() argument
358 int ccc_object_init(const struct lu_env *env, struct lu_object *obj, ccc_object_init() argument
368 below = under->ld_ops->ldo_object_alloc(env, obj->lo_header, under); ccc_object_init()
375 result = ccc_object_init0(env, vob, cconf); ccc_object_init()
381 void ccc_object_free(const struct lu_env *env, struct lu_object *obj) ccc_object_free() argument
390 int ccc_lock_init(const struct lu_env *env, ccc_lock_init() argument
398 CLOBINVRNT(env, obj, ccc_object_invariant(obj)); ccc_lock_init()
409 int ccc_attr_set(const struct lu_env *env, struct cl_object *obj, ccc_attr_set() argument
415 int ccc_object_glimpse(const struct lu_env *env, ccc_object_glimpse() argument
435 int ccc_conf_set(const struct lu_env *env, struct cl_object *obj, ccc_conf_set() argument
464 struct page *ccc_page_vmpage(const struct lu_env *env, ccc_page_vmpage() argument
470 int ccc_page_is_under_lock(const struct lu_env *env, ccc_page_is_under_lock() argument
474 struct ccc_io *cio = ccc_env_io(env); ccc_page_is_under_lock()
475 struct cl_lock_descr *desc = &ccc_env_info(env)->cti_descr; ccc_page_is_under_lock()
497 int ccc_fail(const struct lu_env *env, const struct cl_page_slice *slice) ccc_fail() argument
510 int ccc_transient_page_own(const struct lu_env *env, ccc_transient_page_own() argument
519 void ccc_transient_page_assume(const struct lu_env *env, ccc_transient_page_assume() argument
526 void ccc_transient_page_unassume(const struct lu_env *env, ccc_transient_page_unassume() argument
533 void ccc_transient_page_disown(const struct lu_env *env, ccc_transient_page_disown() argument
540 void ccc_transient_page_discard(const struct lu_env *env, ccc_transient_page_discard() argument
551 cl_page_delete(env, page); ccc_transient_page_discard()
554 int ccc_transient_page_prep(const struct lu_env *env, ccc_transient_page_prep() argument
568 void ccc_lock_delete(const struct lu_env *env, ccc_lock_delete() argument
571 CLOBINVRNT(env, slice->cls_obj, ccc_object_invariant(slice->cls_obj)); ccc_lock_delete()
574 void ccc_lock_fini(const struct lu_env *env, struct cl_lock_slice *slice) ccc_lock_fini() argument
581 int ccc_lock_enqueue(const struct lu_env *env, ccc_lock_enqueue() argument
585 CLOBINVRNT(env, slice->cls_obj, ccc_object_invariant(slice->cls_obj)); ccc_lock_enqueue()
589 int ccc_lock_use(const struct lu_env *env, const struct cl_lock_slice *slice) ccc_lock_use() argument
591 CLOBINVRNT(env, slice->cls_obj, ccc_object_invariant(slice->cls_obj)); ccc_lock_use()
595 int ccc_lock_unuse(const struct lu_env *env, const struct cl_lock_slice *slice) ccc_lock_unuse() argument
597 CLOBINVRNT(env, slice->cls_obj, ccc_object_invariant(slice->cls_obj)); ccc_lock_unuse()
601 int ccc_lock_wait(const struct lu_env *env, const struct cl_lock_slice *slice) ccc_lock_wait() argument
603 CLOBINVRNT(env, slice->cls_obj, ccc_object_invariant(slice->cls_obj)); ccc_lock_wait()
618 int ccc_lock_fits_into(const struct lu_env *env, ccc_lock_fits_into() argument
625 const struct ccc_io *cio = ccc_env_io(env); ccc_lock_fits_into()
654 void ccc_lock_state(const struct lu_env *env, ccc_lock_state() argument
683 cl_merge_lvb(env, inode); ccc_lock_state()
693 void ccc_io_fini(const struct lu_env *env, const struct cl_io_slice *ios) ccc_io_fini() argument
697 CLOBINVRNT(env, io->ci_obj, ccc_object_invariant(io->ci_obj)); ccc_io_fini()
700 int ccc_io_one_lock_index(const struct lu_env *env, struct cl_io *io, ccc_io_one_lock_index() argument
704 struct ccc_io *cio = ccc_env_io(env); ccc_io_one_lock_index()
708 CLOBINVRNT(env, obj, ccc_object_invariant(obj)); ccc_io_one_lock_index()
725 cl_io_lock_add(env, io, &cio->cui_link); ccc_io_one_lock_index()
729 void ccc_io_update_iov(const struct lu_env *env, ccc_io_update_iov() argument
734 if (!cl_is_normalio(env, io) || cio->cui_iter == NULL) ccc_io_update_iov()
740 int ccc_io_one_lock(const struct lu_env *env, struct cl_io *io, ccc_io_one_lock() argument
746 return ccc_io_one_lock_index(env, io, enqflags, mode, ccc_io_one_lock()
750 void ccc_io_end(const struct lu_env *env, const struct cl_io_slice *ios) ccc_io_end() argument
752 CLOBINVRNT(env, ios->cis_io->ci_obj, ccc_io_end()
756 void ccc_io_advance(const struct lu_env *env, ccc_io_advance() argument
760 struct ccc_io *cio = cl2ccc_io(env, ios); ccc_io_advance()
764 CLOBINVRNT(env, obj, ccc_object_invariant(obj)); ccc_io_advance()
766 if (!cl_is_normalio(env, io)) ccc_io_advance()
783 int ccc_prep_size(const struct lu_env *env, struct cl_object *obj, ccc_prep_size() argument
786 struct cl_attr *attr = ccc_env_thread_attr(env); ccc_prep_size()
812 result = cl_object_attr_get(env, obj, attr); ccc_prep_size()
822 result = cl_glimpse_lock(env, io, inode, obj, 0); ccc_prep_size()
870 void ccc_req_completion(const struct lu_env *env, ccc_req_completion() argument
902 void ccc_req_attr_set(const struct lu_env *env, ccc_req_attr_set() argument
943 struct lu_env *env; cl_setattr_ost() local
948 env = cl_env_get(&refcheck); cl_setattr_ost()
949 if (IS_ERR(env)) cl_setattr_ost()
950 return PTR_ERR(env); cl_setattr_ost()
952 io = ccc_env_thread_io(env); cl_setattr_ost()
963 if (cl_io_init(env, io, CIT_SETATTR, io->ci_obj) == 0) { cl_setattr_ost()
964 struct ccc_io *cio = ccc_env_io(env); cl_setattr_ost()
971 result = cl_io_loop(env, io); cl_setattr_ost()
975 cl_io_fini(env, io); cl_setattr_ost()
984 cl_env_put(env, &refcheck); cl_setattr_ost()
1029 struct ccc_io *cl2ccc_io(const struct lu_env *env, cl2ccc_io() argument
1035 LASSERT(cio == ccc_env_io(env)); cl2ccc_io()
1091 struct lu_env *env; cl_file_inode_init() local
1108 env = cl_env_get(&refcheck); cl_file_inode_init()
1109 if (IS_ERR(env)) cl_file_inode_init()
1110 return PTR_ERR(env); cl_file_inode_init()
1124 clob = cl_object_find(env, lu2cl_dev(site->ls_top_dev), cl_file_inode_init()
1137 result = cl_conf_set(env, lli->lli_clob, &conf); cl_file_inode_init()
1140 cl_env_put(env, &refcheck); cl_file_inode_init()
1157 static void cl_object_put_last(struct lu_env *env, struct cl_object *obj) cl_object_put_last() argument
1182 cl_object_put(env, obj); cl_object_put_last()
1187 struct lu_env *env; cl_inode_fini() local
1197 env = cl_env_get(&refcheck); cl_inode_fini()
1198 emergency = IS_ERR(env); cl_inode_fini()
1203 env = ccc_inode_fini_env; cl_inode_fini()
1210 cl_object_kill(env, clob); cl_inode_fini()
1212 cl_object_put_last(env, clob); cl_inode_fini()
1218 cl_env_put(env, &refcheck); cl_inode_fini()
H A Dlcommon_misc.c130 struct lu_env *env; cl_get_grouplock() local
138 env = cl_env_get(&refcheck); cl_get_grouplock()
139 if (IS_ERR(env)) cl_get_grouplock()
140 return PTR_ERR(env); cl_get_grouplock()
142 io = ccc_env_thread_io(env); cl_get_grouplock()
146 rc = cl_io_init(env, io, CIT_MISC, io->ci_obj); cl_get_grouplock()
151 cl_env_put(env, &refcheck); cl_get_grouplock()
155 descr = &ccc_env_info(env)->cti_descr; cl_get_grouplock()
165 lock = cl_lock_request(env, io, descr, GROUPLOCK_SCOPE, current); cl_get_grouplock()
167 cl_io_fini(env, io); cl_get_grouplock()
168 cl_env_put(env, &refcheck); cl_get_grouplock()
176 LASSERT(cg->cg_env == env); cl_get_grouplock()
178 cl_env_unplant(env, &refcheck); cl_get_grouplock()
184 struct lu_env *env = cg->cg_env; cl_put_grouplock() local
192 cl_env_implant(env, &refcheck); cl_put_grouplock()
193 cl_env_put(env, &refcheck); cl_put_grouplock()
195 cl_unuse(env, lock); cl_put_grouplock()
196 cl_lock_release(env, lock, GROUPLOCK_SCOPE, current); cl_put_grouplock()
197 cl_io_fini(env, io); cl_put_grouplock()
198 cl_env_put(env, NULL); cl_put_grouplock()
/linux-4.1.27/drivers/staging/lustre/lustre/lov/
H A Dlov_lock.c49 static struct cl_lock_closure *lov_closure_get(const struct lu_env *env,
52 static int lov_lock_unuse(const struct lu_env *env,
60 static struct lov_sublock_env *lov_sublock_env_get(const struct lu_env *env, lov_sublock_env_get() argument
65 struct lov_io *lio = lov_env_io(env); lov_sublock_env_get()
69 subenv = &lov_env_session(env)->ls_subenv; lov_sublock_env_get()
72 * FIXME: We tend to use the subio's env & io to call the sublock lov_sublock_env_get()
78 * we still borrow the parent's env to call sublock operations. lov_sublock_env_get()
81 subenv->lse_env = env; lov_sublock_env_get()
85 sub = lov_sub_get(env, lio, lls->sub_stripe); lov_sublock_env_get()
103 static void lov_sublock_adopt(const struct lu_env *env, struct lov_lock *lck, lov_sublock_adopt() argument
118 LASSERT(lov_lock_link_find(env, lck, lsl) == NULL); lov_sublock_adopt()
130 cl_lock_user_add(env, sublock); lov_sublock_adopt()
132 rc = lov_sublock_modify(env, lck, lsl, &sublock->cll_descr, idx); lov_sublock_adopt()
136 static struct cl_lock *lov_sublock_alloc(const struct lu_env *env, lov_sublock_alloc() argument
157 subenv = lov_sublock_env_get(env, parent, lls); lov_sublock_alloc()
182 static void lov_sublock_unlock(const struct lu_env *env, lov_sublock_unlock() argument
189 cl_lock_disclosure(env, closure); lov_sublock_unlock()
192 static int lov_sublock_lock(const struct lu_env *env, lov_sublock_lock() argument
206 result = cl_lock_closure_build(env, child, closure); lov_sublock_lock()
222 link = lov_lock_link_find(env, lck, sublock); lov_sublock_lock()
224 lov_lock_unlink(env, link, sublock); lov_sublock_lock()
225 lov_sublock_unlock(env, sublock, closure, NULL); lov_sublock_lock()
230 subenv = lov_sublock_env_get(env, parent, lls); lov_sublock_lock()
232 lov_sublock_unlock(env, sublock, lov_sublock_lock()
287 static int lov_lock_sub_init(const struct lu_env *env, lov_lock_sub_init() argument
360 static int lov_sublock_release(const struct lu_env *env, struct lov_lock *lck, lov_sublock_release() argument
377 cl_lock_user_del(env, sublock); lov_sublock_release()
388 cl_lock_mutex_put(env, parent); lov_sublock_release()
389 cl_lock_unhold(env, sublock, "lov-parent", parent); lov_sublock_release()
391 cl_lock_mutex_get(env, parent); lov_sublock_release()
405 static void lov_sublock_hold(const struct lu_env *env, struct lov_lock *lck, lov_sublock_hold() argument
423 cl_lock_hold_add(env, sublock, "lov-parent", parent); lov_sublock_hold()
424 cl_lock_user_add(env, sublock); lov_sublock_hold()
425 cl_lock_put(env, sublock); lov_sublock_hold()
429 static void lov_lock_fini(const struct lu_env *env, lov_lock_fini() argument
450 static int lov_lock_enqueue_wait(const struct lu_env *env, lov_lock_enqueue_wait() argument
459 cl_lock_mutex_put(env, lock); lov_lock_enqueue_wait()
460 result = cl_lock_enqueue_wait(env, sublock, 0); lov_lock_enqueue_wait()
461 cl_lock_mutex_get(env, lock); lov_lock_enqueue_wait()
472 static int lov_lock_enqueue_one(const struct lu_env *env, struct lov_lock *lck, lov_lock_enqueue_one() argument
479 result = cl_enqueue_try(env, sublock, io, enqflags); lov_lock_enqueue_one()
483 result = cl_wait_try(env, sublock); lov_lock_enqueue_one()
501 static int lov_sublock_fill(const struct lu_env *env, struct cl_lock *parent, lov_sublock_fill() argument
509 cl_lock_mutex_put(env, parent); lov_sublock_fill()
510 sublock = lov_sublock_alloc(env, io, lck, idx, &link); lov_sublock_fill()
512 cl_lock_mutex_get(env, sublock); lov_sublock_fill()
513 cl_lock_mutex_get(env, parent); lov_sublock_fill()
519 lov_sublock_adopt(env, lck, sublock, idx, link); lov_sublock_fill()
524 cl_lock_mutex_put(env, parent); lov_sublock_fill()
525 cl_lock_unhold(env, sublock, "lov-parent", parent); lov_sublock_fill()
526 cl_lock_mutex_get(env, parent); lov_sublock_fill()
528 cl_lock_mutex_put(env, sublock); lov_sublock_fill()
529 cl_lock_put(env, sublock); lov_sublock_fill()
543 static int lov_lock_enqueue(const struct lu_env *env, lov_lock_enqueue() argument
549 struct cl_lock_closure *closure = lov_closure_get(env, lock); lov_lock_enqueue()
578 result = lov_sublock_fill(env, lock, io, lck, i); lov_lock_enqueue()
584 rc = lov_sublock_lock(env, lck, lls, closure, &subenv); lov_lock_enqueue()
586 lov_sublock_hold(env, lck, i); lov_lock_enqueue()
597 cl_lock_mutex_get(env, sublock); lov_lock_enqueue()
598 lov_sublock_unlock(env, sub, closure, lov_lock_enqueue()
600 rc = lov_lock_enqueue_wait(env, lck, lov_lock_enqueue()
606 cl_lock_mutex_get(env, sublock); lov_lock_enqueue()
609 lov_sublock_unlock(env, sub, closure, lov_lock_enqueue()
612 rc = lov_sublock_release(env, lck, i, lov_lock_enqueue()
614 cl_lock_mutex_put(env, sublock); lov_lock_enqueue()
615 cl_lock_put(env, sublock); lov_lock_enqueue()
618 lov_sublock_unlock(env, sub, closure, lov_lock_enqueue()
624 lov_sublock_unlock(env, sub, closure, subenv); lov_lock_enqueue()
635 static int lov_lock_unuse(const struct lu_env *env, lov_lock_unuse() argument
639 struct cl_lock_closure *closure = lov_closure_get(env, slice->cls_lock); lov_lock_unuse()
660 rc = lov_sublock_lock(env, lck, lls, closure, &subenv); lov_lock_unuse()
666 rc = lov_sublock_release(env, lck, i, 0, rc); lov_lock_unuse()
668 lov_sublock_unlock(env, sub, closure, subenv); lov_lock_unuse()
682 static void lov_lock_cancel(const struct lu_env *env, lov_lock_cancel() argument
686 struct cl_lock_closure *closure = lov_closure_get(env, slice->cls_lock); lov_lock_cancel()
706 rc = lov_sublock_lock(env, lck, lls, closure, &subenv); lov_lock_cancel()
709 lov_sublock_unlock(env, sub, closure, subenv); lov_lock_cancel()
716 lov_sublock_release(env, lck, i, 0, 0); lov_lock_cancel()
719 lov_sublock_release(env, lck, i, 1, 0); lov_lock_cancel()
722 lov_sublock_unlock(env, sub, closure, subenv); lov_lock_cancel()
734 CL_LOCK_DEBUG(D_ERROR, env, slice->cls_lock, lov_lock_cancel()
740 static int lov_lock_wait(const struct lu_env *env, lov_lock_wait() argument
744 struct cl_lock_closure *closure = lov_closure_get(env, slice->cls_lock); lov_lock_wait()
763 rc = lov_sublock_lock(env, lck, lls, closure, &subenv); lov_lock_wait()
767 rc = cl_wait_try(env, sublock); lov_lock_wait()
770 lov_sublock_unlock(env, sub, closure, subenv); lov_lock_wait()
788 static int lov_lock_use(const struct lu_env *env, lov_lock_use() argument
792 struct cl_lock_closure *closure = lov_closure_get(env, slice->cls_lock); lov_lock_use()
819 rc = lov_sublock_lock(env, lck, lls, closure, &subenv); lov_lock_use()
822 lov_sublock_hold(env, lck, i); lov_lock_use()
826 rc = lov_sublock_release(env, lck, lov_lock_use()
832 lov_sublock_release(env, lck, i, 1, result); lov_lock_use()
834 lov_sublock_unlock(env, sub, closure, subenv); lov_lock_use()
860 struct cl_lock_descr *subneed = &lov_env_info(env)->lti_ldescr;
874 cl_lock_mutex_get(env, lock);
891 cl_lock_mutex_put(env, lock);
899 static int lov_lock_stripe_is_matching(const struct lu_env *env, lov_lock_stripe_is_matching() argument
935 struct cl_lock_descr *subd = &lov_env_info(env)->lti_ldescr; lov_lock_stripe_is_matching()
961 static int lov_lock_fits_into(const struct lu_env *env, lov_lock_fits_into() argument
985 result = lov_lock_stripe_is_matching(env, lov_lock_fits_into()
1013 void lov_lock_unlink(const struct lu_env *env, lov_lock_unlink() argument
1029 cl_lock_put(env, parent); lov_lock_unlink()
1033 struct lov_lock_link *lov_lock_link_find(const struct lu_env *env, lov_lock_link_find() argument
1062 static void lov_lock_delete(const struct lu_env *env, lov_lock_delete() argument
1066 struct cl_lock_closure *closure = lov_closure_get(env, slice->cls_lock); lov_lock_delete()
1080 rc = lov_sublock_lock(env, lck, lls, closure, NULL); lov_lock_delete()
1090 lov_sublock_release(env, lck, i, 1, 0); lov_lock_delete()
1092 link = lov_lock_link_find(env, lck, lsl); lov_lock_delete()
1094 lov_lock_unlink(env, link, lsl); lov_lock_delete()
1097 lov_sublock_unlock(env, lsl, closure, NULL); lov_lock_delete()
1103 static int lov_lock_print(const struct lu_env *env, void *cookie, lov_lock_print() argument
1109 (*p)(env, cookie, "%d\n", lck->lls_nr); lov_lock_print()
1114 (*p)(env, cookie, " %d %x: ", i, sub->sub_flags); lov_lock_print()
1116 cl_lock_print(env, cookie, p, lov_lock_print()
1119 (*p)(env, cookie, "---\n"); lov_lock_print()
1136 int lov_lock_init_raid0(const struct lu_env *env, struct cl_object *obj, lov_lock_init_raid0() argument
1145 result = lov_lock_sub_init(env, lck, io); lov_lock_init_raid0()
1151 static void lov_empty_lock_fini(const struct lu_env *env, lov_empty_lock_fini() argument
1158 static int lov_empty_lock_print(const struct lu_env *env, void *cookie, lov_empty_lock_print() argument
1161 (*p)(env, cookie, "empty\n"); lov_empty_lock_print()
1171 int lov_lock_init_empty(const struct lu_env *env, struct cl_object *obj, lov_lock_init_empty() argument
1186 static struct cl_lock_closure *lov_closure_get(const struct lu_env *env, lov_closure_get() argument
1191 closure = &lov_env_info(env)->lti_closure; lov_closure_get()
1193 cl_lock_closure_init(env, closure, parent, 1); lov_closure_get()
H A Dlovsub_lock.c55 static void lovsub_lock_fini(const struct lu_env *env, lovsub_lock_fini() argument
65 static void lovsub_parent_lock(const struct lu_env *env, struct lov_lock *lov) lovsub_parent_lock() argument
72 cl_lock_mutex_get(env, parent); lovsub_parent_lock()
75 static void lovsub_parent_unlock(const struct lu_env *env, struct lov_lock *lov) lovsub_parent_unlock() argument
80 cl_lock_mutex_put(env, lov->lls_cl.cls_lock); lovsub_parent_unlock()
82 cl_lock_put(env, parent); lovsub_parent_unlock()
90 static void lovsub_lock_state(const struct lu_env *env, lovsub_lock_state() argument
104 lovsub_parent_lock(env, lov); lovsub_lock_state()
105 cl_lock_signal(env, parent); lovsub_lock_state()
106 lovsub_parent_unlock(env, lov); lovsub_lock_state()
115 static unsigned long lovsub_lock_weigh(const struct lu_env *env, lovsub_lock_weigh() argument
133 lovsub_parent_lock(env, lov); lovsub_lock_weigh()
134 dumbbell = cl_lock_weigh(env, lov->lls_cl.cls_lock); lovsub_lock_weigh()
135 lovsub_parent_unlock(env, lov); lovsub_lock_weigh()
190 int lov_sublock_modify(const struct lu_env *env, struct lov_lock *lov, lov_sublock_modify() argument
205 pd = &lov_env_info(env)->lti_ldescr; lov_sublock_modify()
217 result = cl_lock_modify(env, parent, pd); lov_sublock_modify()
223 static int lovsub_lock_modify(const struct lu_env *env, lovsub_lock_modify() argument
238 lovsub_parent_lock(env, lov); lovsub_lock_modify()
239 rc = lov_sublock_modify(env, lov, lock, d, scan->lll_idx); lovsub_lock_modify()
240 lovsub_parent_unlock(env, lov); lovsub_lock_modify()
246 static int lovsub_lock_closure(const struct lu_env *env, lovsub_lock_closure() argument
262 result = cl_lock_closure_build(env, parent, closure); lovsub_lock_closure()
273 static int lovsub_lock_delete_one(const struct lu_env *env, lovsub_lock_delete_one() argument
292 cl_lock_signal(env, parent); lovsub_lock_delete_one()
323 cl_lock_state_set(env, parent, CLS_NEW); lovsub_lock_delete_one()
357 if (cl_lock_nr_mutexed(env) == 2) { lovsub_lock_delete_one()
358 cl_lock_mutex_put(env, child); lovsub_lock_delete_one()
359 cl_lock_cancel(env, parent); lovsub_lock_delete_one()
360 cl_lock_delete(env, parent); lovsub_lock_delete_one()
366 CL_LOCK_DEBUG(D_ERROR, env, parent, "Delete CLS_HELD lock\n"); lovsub_lock_delete_one()
381 static void lovsub_lock_delete(const struct lu_env *env, lovsub_lock_delete() argument
408 lovsub_parent_lock(env, lov); lovsub_lock_delete()
410 lov_lock_unlink(env, scan, sub); lovsub_lock_delete()
411 restart = lovsub_lock_delete_one(env, child, lov); lovsub_lock_delete()
412 lovsub_parent_unlock(env, lov); lovsub_lock_delete()
415 cl_lock_mutex_get(env, child); lovsub_lock_delete()
422 static int lovsub_lock_print(const struct lu_env *env, void *cookie, lovsub_lock_print() argument
431 (*p)(env, cookie, "[%d %p ", scan->lll_idx, lov); lovsub_lock_print()
433 cl_lock_descr_print(env, cookie, p, lovsub_lock_print()
435 (*p)(env, cookie, "] "); lovsub_lock_print()
450 int lovsub_lock_init(const struct lu_env *env, struct cl_object *obj, lovsub_lock_init() argument
H A Dlov_object.c58 int (*llo_init)(const struct lu_env *env, struct lov_device *dev,
62 int (*llo_delete)(const struct lu_env *env, struct lov_object *lov,
64 void (*llo_fini)(const struct lu_env *env, struct lov_object *lov,
66 void (*llo_install)(const struct lu_env *env, struct lov_object *lov,
68 int (*llo_print)(const struct lu_env *env, void *cookie,
70 int (*llo_page_init)(const struct lu_env *env, struct cl_object *obj,
72 int (*llo_lock_init)(const struct lu_env *env,
75 int (*llo_io_init)(const struct lu_env *env,
77 int (*llo_getattr)(const struct lu_env *env, struct cl_object *obj,
81 static int lov_layout_wait(const struct lu_env *env, struct lov_object *lov);
89 static void lov_install_empty(const struct lu_env *env, lov_install_empty() argument
98 static int lov_init_empty(const struct lu_env *env, lov_init_empty() argument
106 static void lov_install_raid0(const struct lu_env *env, lov_install_raid0() argument
112 static struct cl_object *lov_sub_find(const struct lu_env *env, lov_sub_find() argument
119 o = lu_object_find_at(env, cl2lu_dev(dev), fid, &conf->coc_lu); lov_sub_find()
124 static int lov_init_sub(const struct lu_env *env, struct lov_object *lov, lov_init_sub() argument
140 cl_object_kill(env, stripe); lov_init_sub()
141 cl_object_put(env, stripe); lov_init_sub()
179 lu_object_unhash(env, &stripe->co_lu); lov_init_sub()
186 LU_OBJECT_DEBUG(mask, env, &stripe->co_lu, lov_init_sub()
188 LU_OBJECT_DEBUG(mask, env, old_obj, "owned.\n"); lov_init_sub()
189 LU_OBJECT_HEADER(mask, env, lov2lu(lov), "try to own.\n"); lov_init_sub()
190 cl_object_put(env, stripe); lov_init_sub()
195 static int lov_init_raid0(const struct lu_env *env, lov_init_raid0() argument
204 struct lov_thread_info *lti = lov_env_info(env); lov_init_raid0()
248 stripe = lov_sub_find(env, subdev, ofid, subconf); lov_init_raid0()
250 result = lov_init_sub(env, lov, stripe, r0, i); lov_init_raid0()
265 static int lov_init_released(const struct lu_env *env, lov_init_released() argument
280 static int lov_delete_empty(const struct lu_env *env, struct lov_object *lov, lov_delete_empty() argument
285 lov_layout_wait(env, lov); lov_delete_empty()
287 cl_object_prune(env, &lov->lo_cl); lov_delete_empty()
291 static void lov_subobject_kill(const struct lu_env *env, struct lov_object *lov, lov_subobject_kill() argument
307 cl_object_kill(env, sub); lov_subobject_kill()
310 cl_object_put(env, sub); lov_subobject_kill()
315 waiter = &lov_env_info(env)->lti_waiter; lov_subobject_kill()
338 static int lov_delete_raid0(const struct lu_env *env, struct lov_object *lov, lov_delete_raid0() argument
347 lov_layout_wait(env, lov); lov_delete_raid0()
353 cl_locks_prune(env, &los->lso_cl, 1); lov_delete_raid0()
358 lov_subobject_kill(env, lov, los, i); lov_delete_raid0()
362 cl_object_prune(env, &lov->lo_cl); lov_delete_raid0()
366 static void lov_fini_empty(const struct lu_env *env, struct lov_object *lov, lov_fini_empty() argument
372 static void lov_fini_raid0(const struct lu_env *env, struct lov_object *lov, lov_fini_raid0() argument
386 static void lov_fini_released(const struct lu_env *env, struct lov_object *lov, lov_fini_released() argument
393 static int lov_print_empty(const struct lu_env *env, void *cookie, lov_print_empty() argument
396 (*p)(env, cookie, "empty %d\n", lu2lov(o)->lo_layout_invalid); lov_print_empty()
400 static int lov_print_raid0(const struct lu_env *env, void *cookie, lov_print_raid0() argument
408 (*p)(env, cookie, "stripes: %d, %s, lsm{%p 0x%08X %d %u %u}:\n", lov_print_raid0()
417 lu_object_print(env, cookie, p, sub); lov_print_raid0()
419 (*p)(env, cookie, "sub %d absent\n", i); lov_print_raid0()
425 static int lov_print_released(const struct lu_env *env, void *cookie, lov_print_released() argument
431 (*p)(env, cookie, lov_print_released()
446 static int lov_attr_get_empty(const struct lu_env *env, struct cl_object *obj, lov_attr_get_empty() argument
453 static int lov_attr_get_raid0(const struct lu_env *env, struct cl_object *obj, lov_attr_get_raid0() argument
473 struct ost_lvb *lvb = &lov_env_info(env)->lti_lvb; lov_attr_get_raid0()
637 static int lov_layout_wait(const struct lu_env *env, struct lov_object *lov) lov_layout_wait() argument
664 struct lu_env *env; lov_layout_change() local
674 env = cl_env_get(&refcheck); lov_layout_change()
675 if (IS_ERR(env)) { lov_layout_change()
677 return PTR_ERR(env); lov_layout_change()
687 result = old_ops->llo_delete(env, lov, &lov->u); lov_layout_change()
689 old_ops->llo_fini(env, lov, &lov->u); lov_layout_change()
696 result = new_ops->llo_init(env, lov_layout_change()
700 new_ops->llo_install(env, lov, state); lov_layout_change()
703 new_ops->llo_delete(env, lov, state); lov_layout_change()
704 new_ops->llo_fini(env, lov, state); lov_layout_change()
709 cl_env_put(env, &refcheck); lov_layout_change()
719 int lov_object_init(const struct lu_env *env, struct lu_object *obj, lov_object_init() argument
738 result = ops->llo_init(env, dev, lov, cconf, set); lov_object_init()
740 ops->llo_install(env, lov, set); lov_object_init()
744 static int lov_conf_set(const struct lu_env *env, struct cl_object *obj, lov_conf_set() argument
762 result = lov_layout_wait(env, lov); lov_conf_set()
789 lov->lo_layout_invalid = lov_layout_change(env, lov, conf); lov_conf_set()
798 static void lov_object_delete(const struct lu_env *env, struct lu_object *obj) lov_object_delete() argument
802 LOV_2DISPATCH_VOID(lov, llo_delete, env, lov, &lov->u); lov_object_delete()
805 static void lov_object_free(const struct lu_env *env, struct lu_object *obj) lov_object_free() argument
809 LOV_2DISPATCH_VOID(lov, llo_fini, env, lov, &lov->u); lov_object_free()
814 static int lov_object_print(const struct lu_env *env, void *cookie, lov_object_print() argument
817 return LOV_2DISPATCH_NOLOCK(lu2lov(o), llo_print, env, cookie, p, o); lov_object_print()
820 int lov_page_init(const struct lu_env *env, struct cl_object *obj, lov_page_init() argument
824 llo_page_init, env, obj, page, vmpage); lov_page_init()
831 int lov_io_init(const struct lu_env *env, struct cl_object *obj, lov_io_init() argument
834 CL_IO_SLICE_CLEAN(lov_env_io(env), lis_cl); lov_io_init()
836 !io->ci_ignore_layout, env, obj, io); lov_io_init()
844 static int lov_attr_get(const struct lu_env *env, struct cl_object *obj, lov_attr_get() argument
849 return LOV_2DISPATCH_NOLOCK(cl2lov(obj), llo_getattr, env, obj, attr); lov_attr_get()
852 static int lov_attr_set(const struct lu_env *env, struct cl_object *obj, lov_attr_set() argument
861 int lov_lock_init(const struct lu_env *env, struct cl_object *obj, lov_lock_init() argument
865 return LOV_2DISPATCH_NOLOCK(cl2lov(obj), llo_lock_init, env, obj, lock, lov_lock_init()
887 struct lu_object *lov_object_alloc(const struct lu_env *env, lov_object_alloc() argument
H A Dlov_page.c66 static void lov_page_fini(const struct lu_env *env, lov_page_fini() argument
78 cl_page_put(env, sub); lov_page_fini()
82 static int lov_page_own(const struct lu_env *env, lov_page_own() argument
86 struct lov_io *lio = lov_env_io(env); lov_page_own()
92 sub = lov_page_subio(env, lio, slice); lov_page_own()
101 static void lov_page_assume(const struct lu_env *env, lov_page_assume() argument
104 lov_page_own(env, slice, io, 0); lov_page_assume()
107 static int lov_page_cache_add(const struct lu_env *env, lov_page_cache_add() argument
111 struct lov_io *lio = lov_env_io(env); lov_page_cache_add()
118 sub = lov_page_subio(env, lio, slice); lov_page_cache_add()
125 CL_PAGE_DEBUG(D_ERROR, env, slice->cpl_page, "rc = %d\n", rc); lov_page_cache_add()
130 static int lov_page_print(const struct lu_env *env, lov_page_print() argument
136 return (*printer)(env, cookie, LUSTRE_LOV_NAME"-page@%p\n", lp); lov_page_print()
151 static void lov_empty_page_fini(const struct lu_env *env, lov_empty_page_fini() argument
157 int lov_page_init_raid0(const struct lu_env *env, struct cl_object *obj, lov_page_init_raid0() argument
162 struct lov_io *lio = lov_env_io(env); lov_page_init_raid0()
182 sub = lov_sub_get(env, lio, stripe); lov_page_init_raid0()
202 CL_PAGE_DEBUG(D_ERROR, env, page, "parent page\n"); lov_page_init_raid0()
203 CL_PAGE_DEBUG(D_ERROR, env, subpage, "child page\n"); lov_page_init_raid0()
217 int lov_page_init_empty(const struct lu_env *env, struct cl_object *obj, lov_page_init_empty() argument
227 cl_page_export(env, page, 1); lov_page_init_empty()
H A Dlov_io.c59 static void lov_io_sub_fini(const struct lu_env *env, struct lov_io *lio, lov_io_sub_fini() argument
135 static int lov_io_sub_init(const struct lu_env *env, struct lov_io *lio, lov_io_sub_init() argument
213 lov_io_sub_fini(env, lio, sub); lov_io_sub_init()
217 struct lov_io_sub *lov_sub_get(const struct lu_env *env, lov_sub_get() argument
227 rc = lov_io_sub_init(env, lio, sub); lov_sub_get()
259 struct lov_io_sub *lov_page_subio(const struct lu_env *env, struct lov_io *lio, lov_page_subio() argument
272 return lov_sub_get(env, lio, stripe); lov_page_subio()
276 static int lov_io_subio_init(const struct lu_env *env, struct lov_io *lio, lov_io_subio_init() argument
353 static void lov_io_fini(const struct lu_env *env, const struct cl_io_slice *ios) lov_io_fini() argument
355 struct lov_io *lio = cl2lov_io(env, ios); lov_io_fini()
361 lov_io_sub_fini(env, lio, &lio->lis_subs[i]); lov_io_fini()
379 static int lov_io_iter_init(const struct lu_env *env, lov_io_iter_init() argument
382 struct lov_io *lio = cl2lov_io(env, ios); lov_io_iter_init()
407 sub = lov_sub_get(env, lio, stripe); lov_io_iter_init()
426 static int lov_io_rw_iter_init(const struct lu_env *env, lov_io_rw_iter_init() argument
429 struct lov_io *lio = cl2lov_io(env, ios); lov_io_rw_iter_init()
459 return lov_io_iter_init(env, ios); lov_io_rw_iter_init()
462 static int lov_io_call(const struct lu_env *env, struct lov_io *lio, lov_io_call() argument
482 static int lov_io_lock(const struct lu_env *env, const struct cl_io_slice *ios) lov_io_lock() argument
484 return lov_io_call(env, cl2lov_io(env, ios), cl_io_lock); lov_io_lock()
487 static int lov_io_start(const struct lu_env *env, const struct cl_io_slice *ios) lov_io_start() argument
489 return lov_io_call(env, cl2lov_io(env, ios), cl_io_start); lov_io_start()
492 static int lov_io_end_wrapper(const struct lu_env *env, struct cl_io *io) lov_io_end_wrapper() argument
500 cl_io_end(env, io); lov_io_end_wrapper()
506 static int lov_io_iter_fini_wrapper(const struct lu_env *env, struct cl_io *io) lov_io_iter_fini_wrapper() argument
508 cl_io_iter_fini(env, io); lov_io_iter_fini_wrapper()
512 static int lov_io_unlock_wrapper(const struct lu_env *env, struct cl_io *io) lov_io_unlock_wrapper() argument
514 cl_io_unlock(env, io); lov_io_unlock_wrapper()
518 static void lov_io_end(const struct lu_env *env, const struct cl_io_slice *ios) lov_io_end() argument
522 rc = lov_io_call(env, cl2lov_io(env, ios), lov_io_end_wrapper); lov_io_end()
526 static void lov_io_iter_fini(const struct lu_env *env, lov_io_iter_fini() argument
529 struct lov_io *lio = cl2lov_io(env, ios); lov_io_iter_fini()
532 rc = lov_io_call(env, lio, lov_io_iter_fini_wrapper); lov_io_iter_fini()
538 static void lov_io_unlock(const struct lu_env *env, lov_io_unlock() argument
543 rc = lov_io_call(env, cl2lov_io(env, ios), lov_io_unlock_wrapper); lov_io_unlock()
570 static int lov_io_submit(const struct lu_env *env, lov_io_submit() argument
574 struct lov_io *lio = cl2lov_io(env, ios); lov_io_submit()
578 struct cl_2queue *cl2q = &lov_env_info(env)->lti_cl2q; lov_io_submit()
595 sub = lov_sub_get(env, lio, idx); lov_io_submit()
637 sub = lov_sub_get(env, lio, stripe);
669 lov_io_sub_fini(env, lio, &lio->lis_subs[i]);
679 static int lov_io_prepare_write(const struct lu_env *env, lov_io_prepare_write() argument
684 struct lov_io *lio = cl2lov_io(env, ios); lov_io_prepare_write()
689 sub = lov_page_subio(env, lio, slice); lov_io_prepare_write()
699 static int lov_io_commit_write(const struct lu_env *env, lov_io_commit_write() argument
704 struct lov_io *lio = cl2lov_io(env, ios); lov_io_commit_write()
709 sub = lov_page_subio(env, lio, slice); lov_io_commit_write()
719 static int lov_io_fault_start(const struct lu_env *env, lov_io_fault_start() argument
727 lio = cl2lov_io(env, ios); lov_io_fault_start()
728 sub = lov_sub_get(env, lio, lov_page_stripe(fio->ft_page)); lov_io_fault_start()
731 return lov_io_start(env, ios); lov_io_fault_start()
734 static void lov_io_fsync_end(const struct lu_env *env, lov_io_fsync_end() argument
737 struct lov_io *lio = cl2lov_io(env, ios); lov_io_fsync_end()
823 static void lov_empty_io_fini(const struct lu_env *env, lov_empty_io_fini() argument
832 static void lov_empty_impossible(const struct lu_env *env, lov_empty_impossible() argument
893 int lov_io_init_raid0(const struct lu_env *env, struct cl_object *obj, lov_io_init_raid0() argument
896 struct lov_io *lio = lov_env_io(env); lov_io_init_raid0()
902 io->ci_result = lov_io_subio_init(env, lio, io); lov_io_init_raid0()
911 int lov_io_init_empty(const struct lu_env *env, struct cl_object *obj, lov_io_init_empty() argument
915 struct lov_io *lio = lov_env_io(env); lov_io_init_empty()
948 int lov_io_init_released(const struct lu_env *env, struct cl_object *obj, lov_io_init_released() argument
952 struct lov_io *lio = lov_env_io(env); lov_io_init_released()
H A Dlov_dev.c122 static void lov_req_completion(const struct lu_env *env, lov_req_completion() argument
195 static struct lu_device *lov_device_fini(const struct lu_env *env, lov_device_fini() argument
210 cl_stack_fini(env, lovsub2cl_dev(lsd)); lov_foreach_target()
217 static int lov_device_init(const struct lu_env *env, struct lu_device *d, lov_device_init() argument
237 cl = cl_type_setup(env, d->ld_site, &lovsub_device_type, lov_foreach_target()
250 lov_device_fini(env, d);
257 static int lov_req_init(const struct lu_env *env, struct cl_device *dev, lov_req_init() argument
294 static struct lu_device *lov_device_free(const struct lu_env *env, lov_device_free() argument
309 static void lov_cl_del_target(const struct lu_env *env, struct lu_device *dev, lov_cl_del_target() argument
315 cl_stack_fini(env, lovsub2cl_dev(ld->ld_target[index])); lov_cl_del_target()
354 static int lov_expand_targets(const struct lu_env *env, struct lov_device *dev) lov_expand_targets() argument
394 static int lov_cl_add_target(const struct lu_env *env, struct lu_device *dev, lov_cl_add_target() argument
415 rc = lov_expand_targets(env, ld); lov_cl_add_target()
419 cl = cl_type_setup(env, dev->ld_site, &lovsub_device_type, lov_cl_add_target()
429 lov_cl_del_target(env, dev, index); lov_cl_add_target()
437 static int lov_process_config(const struct lu_env *env, lov_process_config() argument
454 rc = lov_cl_add_target(env, d, index); lov_process_config()
459 lov_cl_del_target(env, d, index); lov_process_config()
472 static struct lu_device *lov_device_alloc(const struct lu_env *env, lov_device_alloc() argument
498 lov_device_free(env, d); lov_device_alloc()
H A Dlovsub_dev.c53 static void lovsub_req_completion(const struct lu_env *env, lovsub_req_completion() argument
67 static void lovsub_req_attr_set(const struct lu_env *env, lovsub_req_attr_set() argument
93 static int lovsub_device_init(const struct lu_env *env, struct lu_device *d, lovsub_device_init() argument
103 rc = ldt->ldt_ops->ldto_device_init(env, next, ldt->ldt_name, NULL); lovsub_device_init()
115 static struct lu_device *lovsub_device_fini(const struct lu_env *env, lovsub_device_fini() argument
128 static struct lu_device *lovsub_device_free(const struct lu_env *env, lovsub_device_free() argument
136 lu_site_print(env, d->ld_site, &msgdata, lu_cdebug_printer); lovsub_device_free()
143 static int lovsub_req_init(const struct lu_env *env, struct cl_device *dev, lovsub_req_init() argument
168 static struct lu_device *lovsub_device_alloc(const struct lu_env *env, lovsub_device_alloc() argument
H A Dlovsub_object.c55 int lovsub_object_init(const struct lu_env *env, struct lu_object *obj, lovsub_object_init() argument
65 below = under->ld_ops->ldo_object_alloc(env, obj->lo_header, under); lovsub_object_init()
76 static void lovsub_object_free(const struct lu_env *env, struct lu_object *obj) lovsub_object_free() argument
97 static int lovsub_object_print(const struct lu_env *env, void *cookie, lovsub_object_print() argument
102 return (*p)(env, cookie, "[%d]", los->lso_index); lovsub_object_print()
105 static int lovsub_attr_set(const struct lu_env *env, struct cl_object *obj, lovsub_attr_set() argument
114 static int lovsub_object_glimpse(const struct lu_env *env, lovsub_object_glimpse() argument
120 return cl_object_glimpse(env, &los->lso_super->lo_cl, lvb); lovsub_object_glimpse()
141 struct lu_object *lovsub_object_alloc(const struct lu_env *env, lovsub_object_alloc() argument
H A Dlovsub_page.c53 static void lovsub_page_fini(const struct lu_env *env, lovsub_page_fini() argument
62 int lovsub_page_init(const struct lu_env *env, struct cl_object *obj, lovsub_page_init() argument
H A Dlov_cl_internal.h583 int lov_object_init(const struct lu_env *env, struct lu_object *obj,
585 int lovsub_object_init(const struct lu_env *env, struct lu_object *obj,
587 int lov_lock_init(const struct lu_env *env, struct cl_object *obj,
589 int lov_io_init(const struct lu_env *env, struct cl_object *obj,
591 int lovsub_lock_init(const struct lu_env *env, struct cl_object *obj,
594 int lov_lock_init_raid0(const struct lu_env *env, struct cl_object *obj,
596 int lov_lock_init_empty(const struct lu_env *env, struct cl_object *obj,
598 int lov_io_init_raid0(const struct lu_env *env, struct cl_object *obj,
600 int lov_io_init_empty(const struct lu_env *env, struct cl_object *obj,
602 int lov_io_init_released(const struct lu_env *env, struct cl_object *obj,
604 void lov_lock_unlink(const struct lu_env *env, struct lov_lock_link *link,
607 struct lov_io_sub *lov_sub_get(const struct lu_env *env, struct lov_io *lio,
610 int lov_sublock_modify(const struct lu_env *env, struct lov_lock *lov,
615 int lov_page_init(const struct lu_env *env, struct cl_object *ob,
617 int lovsub_page_init(const struct lu_env *env, struct cl_object *ob,
620 int lov_page_init_empty(const struct lu_env *env,
623 int lov_page_init_raid0(const struct lu_env *env,
626 struct lu_object *lov_object_alloc(const struct lu_env *env,
629 struct lu_object *lovsub_object_alloc(const struct lu_env *env,
633 struct lov_lock_link *lov_lock_link_find(const struct lu_env *env,
636 struct lov_io_sub *lov_page_subio(const struct lu_env *env,
654 static inline struct lov_session *lov_env_session(const struct lu_env *env) lov_env_session() argument
658 ses = lu_context_key_get(env->le_ses, &lov_session_key); lov_env_session()
663 static inline struct lov_io *lov_env_io(const struct lu_env *env) lov_env_io() argument
665 return &lov_env_session(env)->ls_io; lov_env_io()
805 static inline struct lov_io *cl2lov_io(const struct lu_env *env, cl2lov_io() argument
811 LASSERT(lio == lov_env_io(env)); cl2lov_io()
820 static inline struct lov_thread_info *lov_env_info(const struct lu_env *env) lov_env_info() argument
824 info = lu_context_key_get(&env->le_ctx, &lov_key); lov_env_info()
H A Dlov_obd.c215 static int lov_connect(const struct lu_env *env, lov_connect() argument
1040 static int lov_create(const struct lu_env *env, struct obd_export *exp, lov_create() argument
1080 static int lov_destroy(const struct lu_env *env, struct obd_export *exp, lov_destroy() argument
1114 err = obd_destroy(env, lov->lov_tgts[req->rq_idx]->ltd_exp, lov_destroy()
1382 static int lov_statfs(const struct lu_env *env, struct obd_export *exp, lov_statfs() argument
1969 static int lov_get_info(const struct lu_env *env, struct obd_export *exp, lov_get_info() argument
2035 rc = obd_get_info(env, tgt->ltd_exp, keylen, key, lov_get_info()
2077 static int lov_set_info_async(const struct lu_env *env, struct obd_export *exp, lov_set_info_async() argument
2146 err = obd_set_info_async(env, tgt->ltd_exp, lov_set_info_async()
2150 err = obd_set_info_async(env, tgt->ltd_exp, lov_set_info_async()
2163 err = obd_set_info_async(env, tgt->ltd_exp, keylen, lov_set_info_async()
2172 err = obd_set_info_async(env, tgt->ltd_exp, lov_set_info_async()
/linux-4.1.27/drivers/staging/lustre/lustre/llite/
H A Dvvp_io.c50 static struct vvp_io *cl2vvp_io(const struct lu_env *env,
56 int cl_is_normalio(const struct lu_env *env, const struct cl_io *io) cl_is_normalio() argument
58 struct vvp_io *vio = vvp_env_io(env); cl_is_normalio()
71 static bool can_populate_pages(const struct lu_env *env, struct cl_io *io, can_populate_pages() argument
75 struct ccc_io *cio = ccc_env_io(env); can_populate_pages()
104 static int vvp_io_fault_iter_init(const struct lu_env *env, vvp_io_fault_iter_init() argument
107 struct vvp_io *vio = cl2vvp_io(env, ios); vvp_io_fault_iter_init()
111 file_inode(cl2ccc_io(env, ios)->cui_fd->fd_file)); vvp_io_fault_iter_init()
116 static void vvp_io_fini(const struct lu_env *env, const struct cl_io_slice *ios) vvp_io_fini() argument
120 struct ccc_io *cio = cl2ccc_io(env, ios); vvp_io_fini()
122 CLOBINVRNT(env, obj, ccc_object_invariant(obj)); vvp_io_fini()
177 static void vvp_io_fault_fini(const struct lu_env *env, vvp_io_fault_fini() argument
183 CLOBINVRNT(env, io->ci_obj, ccc_object_invariant(io->ci_obj)); vvp_io_fault_fini()
187 cl_page_put(env, page); vvp_io_fault_fini()
190 vvp_io_fini(env, ios); vvp_io_fault_fini()
205 static int vvp_mmap_locks(const struct lu_env *env, vvp_mmap_locks() argument
208 struct ccc_thread_info *cti = ccc_env_info(env); vvp_mmap_locks()
221 if (!cl_is_normalio(env, io)) vvp_mmap_locks()
266 result = cl_io_lock_alloc_add(env, io, descr); vvp_mmap_locks()
288 static int vvp_io_rw_lock(const struct lu_env *env, struct cl_io *io, vvp_io_rw_lock() argument
291 struct ccc_io *cio = ccc_env_io(env); vvp_io_rw_lock()
297 ccc_io_update_iov(env, cio, io); vvp_io_rw_lock()
301 result = vvp_mmap_locks(env, cio, io); vvp_io_rw_lock()
303 result = ccc_io_one_lock(env, io, ast_flags, mode, start, end); vvp_io_rw_lock()
307 static int vvp_io_read_lock(const struct lu_env *env, vvp_io_read_lock() argument
314 result = vvp_io_rw_lock(env, io, CLM_READ, rd->crw_pos, vvp_io_read_lock()
320 static int vvp_io_fault_lock(const struct lu_env *env, vvp_io_fault_lock() argument
324 struct vvp_io *vio = cl2vvp_io(env, ios); vvp_io_fault_lock()
329 (env, io, 0, vvp_mode_from_vma(vio->u.fault.ft_vma), vvp_io_fault_lock()
333 static int vvp_io_write_lock(const struct lu_env *env, vvp_io_write_lock() argument
347 return vvp_io_rw_lock(env, io, CLM_WRITE, start, end); vvp_io_write_lock()
350 static int vvp_io_setattr_iter_init(const struct lu_env *env, vvp_io_setattr_iter_init() argument
361 static int vvp_io_setattr_lock(const struct lu_env *env, vvp_io_setattr_lock() argument
364 struct ccc_io *cio = ccc_env_io(env); vvp_io_setattr_lock()
382 return ccc_io_one_lock(env, io, enqflags, CLM_WRITE, vvp_io_setattr_lock()
403 static int vvp_io_setattr_trunc(const struct lu_env *env, vvp_io_setattr_trunc() argument
411 static int vvp_io_setattr_time(const struct lu_env *env, vvp_io_setattr_time() argument
416 struct cl_attr *attr = ccc_env_thread_attr(env); vvp_io_setattr_time()
430 result = cl_object_attr_set(env, obj, attr, valid); vvp_io_setattr_time()
436 static int vvp_io_setattr_start(const struct lu_env *env, vvp_io_setattr_start() argument
445 result = vvp_io_setattr_trunc(env, ios, inode, vvp_io_setattr_start()
448 result = vvp_io_setattr_time(env, ios); vvp_io_setattr_start()
452 static void vvp_io_setattr_end(const struct lu_env *env, vvp_io_setattr_end() argument
467 static void vvp_io_setattr_fini(const struct lu_env *env, vvp_io_setattr_fini() argument
470 vvp_io_fini(env, ios); vvp_io_setattr_fini()
473 static int vvp_io_read_start(const struct lu_env *env, vvp_io_read_start() argument
476 struct vvp_io *vio = cl2vvp_io(env, ios); vvp_io_read_start()
477 struct ccc_io *cio = cl2ccc_io(env, ios); vvp_io_read_start()
490 CLOBINVRNT(env, obj, ccc_object_invariant(obj)); vvp_io_read_start()
494 if (!can_populate_pages(env, io, inode)) vvp_io_read_start()
497 result = ccc_prep_size(env, obj, io, pos, tot, &exceed); vvp_io_read_start()
503 LU_OBJECT_HEADER(D_INODE, env, &obj->co_lu, vvp_io_read_start()
554 static void vvp_io_read_fini(const struct lu_env *env, const struct cl_io_slice *ios) vvp_io_read_fini() argument
556 struct vvp_io *vio = cl2vvp_io(env, ios); vvp_io_read_fini()
557 struct ccc_io *cio = cl2ccc_io(env, ios); vvp_io_read_fini()
562 vvp_io_fini(env, ios); vvp_io_read_fini()
565 static int vvp_io_write_start(const struct lu_env *env, vvp_io_write_start() argument
568 struct ccc_io *cio = cl2ccc_io(env, ios); vvp_io_write_start()
576 if (!can_populate_pages(env, io, inode)) vvp_io_write_start()
648 static int vvp_io_fault_start(const struct lu_env *env, vvp_io_fault_start() argument
651 struct vvp_io *vio = cl2vvp_io(env, ios); vvp_io_fault_start()
673 result = ccc_prep_size(env, obj, io, 0, offset + 1, NULL); vvp_io_fault_start()
736 page = cl_page_find(env, obj, fio->ft_index, vmpage, CPT_CACHEABLE); vvp_io_fault_start()
750 cl_page_assume(env, io, page); vvp_io_fault_start()
758 result = cl_page_cache_add(env, io, page, CRT_WRITE); vvp_io_fault_start()
763 cl_page_unmap(env, io, page); vvp_io_fault_start()
764 cl_page_discard(env, io, page); vvp_io_fault_start()
765 cl_page_disown(env, io, page); vvp_io_fault_start()
767 cl_page_put(env, page); vvp_io_fault_start()
774 cl_page_disown(env, io, page); vvp_io_fault_start()
805 static int vvp_io_fsync_start(const struct lu_env *env, vvp_io_fsync_start() argument
814 static int vvp_io_read_page(const struct lu_env *env, vvp_io_read_page() argument
824 struct ll_file_data *fd = cl2ccc_io(env, ios)->cui_fd; vvp_io_read_page()
830 CLOBINVRNT(env, obj, ccc_object_invariant(obj)); vvp_io_read_page()
839 rc = cl_page_is_under_lock(env, io, page); vvp_io_read_page()
841 CL_PAGE_HEADER(D_WARNING, env, page, "%s: %d\n", vvp_io_read_page()
850 cl_page_export(env, page, 1); vvp_io_read_page()
859 ll_readahead(env, io, ras, vvp_io_read_page()
865 static int vvp_page_sync_io(const struct lu_env *env, struct cl_io *io, vvp_page_sync_io() argument
877 result = cl_io_submit_sync(env, io, crt, queue, 0); vvp_page_sync_io()
885 cl_page_list_disown(env, io, &queue->c2_qin); vvp_page_sync_io()
886 cl_2queue_fini(env, queue); vvp_page_sync_io()
894 static int vvp_io_prepare_partial(const struct lu_env *env, struct cl_io *io, vvp_io_prepare_partial() argument
899 struct cl_attr *attr = ccc_env_thread_attr(env); vvp_io_prepare_partial()
904 result = cl_object_attr_get(env, obj, attr); vvp_io_prepare_partial()
920 result = vvp_page_sync_io(env, io, pg, cp, CRT_READ); vvp_io_prepare_partial()
930 cl_page_export(env, pg, 1); vvp_io_prepare_partial()
935 static int vvp_io_prepare_write(const struct lu_env *env, vvp_io_prepare_write() argument
947 LINVRNT(cl_page_is_vmlocked(env, pg)); vvp_io_prepare_write()
952 CL_PAGE_HEADER(D_PAGE, env, pg, "preparing: [%d, %d]\n", from, to); vvp_io_prepare_write()
959 CL_PAGE_HEADER(D_PAGE, env, pg, "full page write\n"); vvp_io_prepare_write()
962 result = vvp_io_prepare_partial(env, ios->cis_io, obj, vvp_io_prepare_write()
965 CL_PAGE_HEADER(D_PAGE, env, pg, "uptodate\n"); vvp_io_prepare_write()
969 static int vvp_io_commit_write(const struct lu_env *env, vvp_io_commit_write() argument
987 LINVRNT(cl_page_is_vmlocked(env, pg)); vvp_io_commit_write()
990 LU_OBJECT_HEADER(D_INODE, env, &obj->co_lu, "committing page write\n"); vvp_io_commit_write()
991 CL_PAGE_HEADER(D_PAGE, env, pg, "committing: [%d, %d]\n", from, to); vvp_io_commit_write()
1015 result = cl_page_cache_add(env, io, pg, CRT_WRITE); vvp_io_commit_write()
1047 cl_page_clip(env, pg, 0, to); vvp_io_commit_write()
1048 result = vvp_page_sync_io(env, io, pg, cp, CRT_WRITE); vvp_io_commit_write()
1083 cl_page_export(env, pg, 1); vvp_io_commit_write()
1086 cl_page_discard(env, io, pg); vvp_io_commit_write()
1133 int vvp_io_init(const struct lu_env *env, struct cl_object *obj, vvp_io_init() argument
1136 struct vvp_io *vio = vvp_env_io(env); vvp_io_init()
1137 struct ccc_io *cio = ccc_env_io(env); vvp_io_init()
1141 CLOBINVRNT(env, obj, ccc_object_invariant(obj)); vvp_io_init()
1203 static struct vvp_io *cl2vvp_io(const struct lu_env *env, cl2vvp_io() argument
1207 cl2ccc_io(env, slice); cl2vvp_io()
1208 return vvp_env_io(env); cl2vvp_io()
H A Dvvp_dev.c140 static struct lu_device *vvp_device_alloc(const struct lu_env *env, vvp_device_alloc() argument
144 return ccc_device_alloc(env, t, cfg, &vvp_lu_ops, &vvp_cl_ops); vvp_device_alloc()
201 struct lu_env *env; cl_sb_init() local
206 env = cl_env_get(&refcheck); cl_sb_init()
207 if (!IS_ERR(env)) { cl_sb_init()
208 cl = cl_type_setup(env, NULL, &vvp_device_type, cl_sb_init()
215 cl_env_put(env, &refcheck); cl_sb_init()
217 rc = PTR_ERR(env); cl_sb_init()
224 struct lu_env *env; cl_sb_fini() local
230 env = cl_env_get(&refcheck); cl_sb_fini()
231 if (!IS_ERR(env)) { cl_sb_fini()
235 cl_stack_fini(env, cld); cl_sb_fini()
239 cl_env_put(env, &refcheck); cl_sb_fini()
243 result = PTR_ERR(env); cl_sb_fini()
319 static struct cl_object *vvp_pgcache_obj(const struct lu_env *env, vvp_pgcache_obj() argument
339 lu_object_put(env, lu_object_top(id->vpi_obj)); vvp_pgcache_obj()
347 static loff_t vvp_pgcache_find(const struct lu_env *env, vvp_pgcache_find() argument
360 clob = vvp_pgcache_obj(env, dev, &id); vvp_pgcache_find()
381 cl_object_put(env, clob); vvp_pgcache_find()
401 static void vvp_pgcache_page_show(const struct lu_env *env, vvp_pgcache_page_show() argument
436 struct lu_env *env; vvp_pgcache_show() local
443 env = cl_env_get(&refcheck); vvp_pgcache_show()
444 if (!IS_ERR(env)) { vvp_pgcache_show()
448 clob = vvp_pgcache_obj(env, &sbi->ll_cl->cd_lu_dev, &id); vvp_pgcache_show()
459 vvp_pgcache_page_show(env, f, page); vvp_pgcache_show()
460 cl_page_put(env, page); vvp_pgcache_show()
464 cl_object_put(env, clob); vvp_pgcache_show()
467 cl_env_put(env, &refcheck); vvp_pgcache_show()
470 result = PTR_ERR(env); vvp_pgcache_show()
477 struct lu_env *env; vvp_pgcache_start() local
482 env = cl_env_get(&refcheck); vvp_pgcache_start()
483 if (!IS_ERR(env)) { vvp_pgcache_start()
488 *pos = vvp_pgcache_find(env, &sbi->ll_cl->cd_lu_dev, vvp_pgcache_start()
493 cl_env_put(env, &refcheck); vvp_pgcache_start()
501 struct lu_env *env; vvp_pgcache_next() local
504 env = cl_env_get(&refcheck); vvp_pgcache_next()
505 if (!IS_ERR(env)) { vvp_pgcache_next()
507 *pos = vvp_pgcache_find(env, &sbi->ll_cl->cd_lu_dev, *pos + 1); vvp_pgcache_next()
510 cl_env_put(env, &refcheck); vvp_pgcache_next()
H A Dvvp_page.c64 static void vvp_page_fini(const struct lu_env *env, vvp_page_fini() argument
78 static int vvp_page_own(const struct lu_env *env, vvp_page_own() argument
103 static void vvp_page_assume(const struct lu_env *env, vvp_page_assume() argument
114 static void vvp_page_unassume(const struct lu_env *env, vvp_page_unassume() argument
124 static void vvp_page_disown(const struct lu_env *env, vvp_page_disown() argument
135 static void vvp_page_discard(const struct lu_env *env, vvp_page_discard() argument
158 static int vvp_page_unmap(const struct lu_env *env, vvp_page_unmap() argument
177 static void vvp_page_delete(const struct lu_env *env, vvp_page_delete() argument
197 static void vvp_page_export(const struct lu_env *env, vvp_page_export() argument
211 static int vvp_page_is_vmlocked(const struct lu_env *env, vvp_page_is_vmlocked() argument
217 static int vvp_page_prep_read(const struct lu_env *env, vvp_page_prep_read() argument
225 static int vvp_page_prep_write(const struct lu_env *env, vvp_page_prep_write() argument
268 static void vvp_page_completion_read(const struct lu_env *env, vvp_page_completion_read() argument
278 CL_PAGE_HEADER(D_PAGE, env, page, "completing READ with %d\n", ioret); vvp_page_completion_read()
285 cl_page_export(env, page, 1); vvp_page_completion_read()
293 static void vvp_page_completion_write(const struct lu_env *env, vvp_page_completion_write() argument
304 CL_PAGE_HEADER(D_PAGE, env, pg, "completing WRITE with %d\n", ioret); vvp_page_completion_write()
343 static int vvp_page_make_ready(const struct lu_env *env, vvp_page_make_ready() argument
358 CL_PAGE_HEADER(D_PAGE, env, pg, "readied\n"); vvp_page_make_ready()
364 CL_PAGE_DEBUG(D_ERROR, env, pg, "Unexpecting page state %d.\n", vvp_page_make_ready()
372 static int vvp_page_print(const struct lu_env *env, vvp_page_print() argument
379 (*printer)(env, cookie, LUSTRE_VVP_NAME "-page@%p(%d:%d:%d) vm@%p ", vvp_page_print()
383 (*printer)(env, cookie, "%lx %d:%d %lx %lu %slru", vvp_page_print()
389 (*printer)(env, cookie, "\n"); vvp_page_print()
428 static int vvp_transient_page_own(const struct lu_env *env, vvp_transient_page_own() argument
436 static void vvp_transient_page_assume(const struct lu_env *env, vvp_transient_page_assume() argument
443 static void vvp_transient_page_unassume(const struct lu_env *env, vvp_transient_page_unassume() argument
450 static void vvp_transient_page_disown(const struct lu_env *env, vvp_transient_page_disown() argument
457 static void vvp_transient_page_discard(const struct lu_env *env, vvp_transient_page_discard() argument
468 cl_page_delete(env, page); vvp_transient_page_discard()
471 static int vvp_transient_page_is_vmlocked(const struct lu_env *env, vvp_transient_page_is_vmlocked() argument
484 vvp_transient_page_completion(const struct lu_env *env, vvp_transient_page_completion() argument
491 static void vvp_transient_page_fini(const struct lu_env *env, vvp_transient_page_fini() argument
526 int vvp_page_init(const struct lu_env *env, struct cl_object *obj, vvp_page_init() argument
531 CLOBINVRNT(env, obj, ccc_object_invariant(obj)); vvp_page_init()
H A Drw26.c76 struct lu_env *env; ll_invalidatepage() local
91 env = cl_env_get(&refcheck); ll_invalidatepage()
92 if (!IS_ERR(env)) { ll_invalidatepage()
100 cl_page_delete(env, page); ll_invalidatepage()
103 cl_page_put(env, page); ll_invalidatepage()
107 cl_env_put(env, &refcheck); ll_invalidatepage()
120 struct lu_env *env; ll_releasepage() local
143 env = cl_env_nested_get(&nest); ll_releasepage()
144 if (IS_ERR(env)) ll_releasepage()
145 /* If we can't allocate an env we won't call cl_page_put() ll_releasepage()
156 cl_page_delete(env, page); ll_releasepage()
158 cl_page_put(env, page); ll_releasepage()
160 cl_env_nested_put(&nest, env); ll_releasepage()
228 ssize_t ll_direct_rw_pages(const struct lu_env *env, struct cl_io *io, ll_direct_rw_pages() argument
252 clp = cl_page_find(env, obj, cl_index(obj, file_offset), ll_direct_rw_pages()
259 rc = cl_page_own(env, io, clp); ll_direct_rw_pages()
262 cl_page_put(env, clp); ll_direct_rw_pages()
271 struct page *vmpage = cl_page_vmpage(env, clp); ll_direct_rw_pages()
295 cl_page_disown(env, io, clp); ll_direct_rw_pages()
307 cl_page_clip(env, clp, 0, min(size, page_size)); ll_direct_rw_pages()
313 cl_page_put(env, clp); ll_direct_rw_pages()
319 rc = cl_io_submit_sync(env, io, ll_direct_rw_pages()
326 cl_2queue_discard(env, io, queue); ll_direct_rw_pages()
327 cl_2queue_disown(env, io, queue); ll_direct_rw_pages()
328 cl_2queue_fini(env, queue); ll_direct_rw_pages()
333 static ssize_t ll_direct_IO_26_seg(const struct lu_env *env, struct cl_io *io, ll_direct_IO_26_seg() argument
346 return ll_direct_rw_pages(env, io, rw, inode, &pvec); ll_direct_IO_26_seg()
365 struct lu_env *env; ll_direct_IO_26() local
393 env = cl_env_get(&refcheck); ll_direct_IO_26()
394 LASSERT(!IS_ERR(env)); ll_direct_IO_26()
395 io = ccc_env_io(env)->cui_cl.cis_io; ll_direct_IO_26()
421 result = ll_direct_IO_26_seg(env, io, iov_iter_rw(iter), ll_direct_IO_26()
468 cl_env_put(env, &refcheck); ll_direct_IO_26()
H A Dllite_mmap.c88 * \param env - corespondent lu_env to processing
93 * \return allocated and initialized env for fault operation.
94 * \retval EINVAL if env can't allocated
106 struct lu_env *env; ll_fault_io_init() local
120 env = cl_env_nested_get(nest); ll_fault_io_init()
121 if (IS_ERR(env)) ll_fault_io_init()
124 *env_ret = env; ll_fault_io_init()
126 io = ccc_env_thread_io(env); ll_fault_io_init()
147 rc = cl_io_init(env, io, CIT_FAULT, io->ci_obj); ll_fault_io_init()
149 struct ccc_io *cio = ccc_env_io(env); ll_fault_io_init()
160 cl_io_fini(env, io); ll_fault_io_init()
161 cl_env_nested_put(nest, env); ll_fault_io_init()
172 struct lu_env *env; ll_page_mkwrite0() local
183 io = ll_fault_io_init(vma, &env, &nest, vmpage->index, NULL); ll_page_mkwrite0()
196 vio = vvp_env_io(env); ll_page_mkwrite0()
209 result = cl_io_loop(env, io); ll_page_mkwrite0()
252 cl_io_fini(env, io); ll_page_mkwrite0()
253 cl_env_nested_put(&nest, env); ll_page_mkwrite0()
295 struct lu_env *env; ll_fault0() local
304 io = ll_fault_io_init(vma, &env, &nest, vmf->pgoff, &ra_flags); ll_fault0()
310 vio = vvp_env_io(env); ll_fault0()
317 result = cl_io_loop(env, io); ll_fault0()
330 cl_io_fini(env, io); ll_fault0()
331 cl_env_nested_put(&nest, env); ll_fault0()
H A Drw.c68 struct lu_env *env = lcc->lcc_env; ll_cl_fini() local
73 LASSERT(env != NULL); ll_cl_fini()
77 cl_page_put(env, page); ll_cl_fini()
80 cl_env_put(env, &lcc->lcc_refcheck); ll_cl_fini()
91 struct lu_env *env; ll_cl_init() local
102 env = cl_env_get(&refcheck); ll_cl_init()
103 if (IS_ERR(env)) ll_cl_init()
104 return ERR_CAST(env); ll_cl_init()
106 lcc = &vvp_env_info(env)->vti_io_ctx; ll_cl_init()
108 lcc->lcc_env = env; ll_cl_init()
112 cio = ccc_env_io(env); ll_cl_init()
136 io = ccc_env_thread_io(env); ll_cl_init()
151 result = cl_io_rw_init(env, io, CIT_WRITE, pos, PAGE_CACHE_SIZE); ll_cl_init()
155 result = cl_io_iter_init(env, io); ll_cl_init()
157 result = cl_io_lock(env, io); ll_cl_init()
159 result = cl_io_start(env, io); ll_cl_init()
174 page = cl_page_find(env, clob, vmpage->index, vmpage, ll_cl_init()
190 env, io); ll_cl_init()
197 struct lu_env *env; ll_cl_get() local
200 env = cl_env_get(&refcheck); ll_cl_get()
201 LASSERT(!IS_ERR(env)); ll_cl_get()
202 lcc = &vvp_env_info(env)->vti_io_ctx; ll_cl_get()
203 LASSERT(env == lcc->lcc_env); ll_cl_get()
205 cl_env_put(env, &refcheck); ll_cl_get()
207 /* env has got in ll_cl_init, so it is still usable. */ ll_cl_get()
223 struct lu_env *env = lcc->lcc_env; ll_prepare_write() local
227 cl_page_assume(env, io, page); ll_prepare_write()
229 result = cl_io_prepare_write(env, io, page, from, to); ll_prepare_write()
239 cl_page_unassume(env, io, page); ll_prepare_write()
254 struct lu_env *env; ll_commit_write() local
260 env = lcc->lcc_env; ll_commit_write()
267 result = cl_io_commit_write(env, io, page, from, to); ll_commit_write()
269 cl_page_unassume(env, io, page); ll_commit_write()
275 cl_page_put(env, page); ll_commit_write()
452 static int cl_read_ahead_page(const struct lu_env *env, struct cl_io *io, cl_read_ahead_page() argument
460 cl_page_assume(env, io, page); cl_read_ahead_page()
464 rc = cl_page_is_under_lock(env, io, page); cl_read_ahead_page()
471 cl_page_delete(env, page); cl_read_ahead_page()
476 cl_page_unassume(env, io, page); cl_read_ahead_page()
479 cl_page_put(env, page); cl_read_ahead_page()
493 static int ll_read_ahead_page(const struct lu_env *env, struct cl_io *io, ll_read_ahead_page() argument
508 page = cl_page_find(env, clob, vmpage->index, ll_read_ahead_page()
511 rc = cl_read_ahead_page(env, io, queue, ll_read_ahead_page()
637 static int ll_read_ahead_pages(const struct lu_env *env, ll_read_ahead_pages() argument
655 rc = ll_read_ahead_page(env, io, queue, ll_read_ahead_pages()
688 int ll_readahead(const struct lu_env *env, struct cl_io *io, ll_readahead() argument
692 struct vvp_io *vio = vvp_env_io(env); ll_readahead()
693 struct vvp_thread_info *vti = vvp_env_info(env); ll_readahead()
694 struct cl_attr *attr = ccc_env_thread_attr(env); ll_readahead()
712 ret = cl_object_attr_get(env, clob, attr); ll_readahead()
792 ret = ll_read_ahead_pages(env, io, queue, ll_readahead()
1126 struct lu_env *env; ll_writepage() local
1140 env = cl_env_nested_get(&nest); ll_writepage()
1141 if (IS_ERR(env)) { ll_writepage()
1142 result = PTR_ERR(env); ll_writepage()
1149 io = ccc_env_thread_io(env); ll_writepage()
1152 result = cl_io_init(env, io, CIT_MISC, clob); ll_writepage()
1154 page = cl_page_find(env, clob, vmpage->index, ll_writepage()
1159 cl_page_assume(env, io, page); ll_writepage()
1160 result = cl_page_flush(env, io, page); ll_writepage()
1173 cl_page_disown(env, io, page); ll_writepage()
1177 cl_page_put(env, page); ll_writepage()
1182 cl_io_fini(env, io); ll_writepage()
1203 cl_env_nested_put(&nest, env); ll_writepage()
1270 struct lu_env *env = lcc->lcc_env; ll_readpage() local
1276 cl_page_assume(env, io, page); ll_readpage()
1277 result = cl_io_read_page(env, io, page); ll_readpage()
H A Dvvp_internal.h46 int vvp_io_init (const struct lu_env *env,
48 int vvp_lock_init (const struct lu_env *env,
51 int vvp_page_init (const struct lu_env *env,
54 struct lu_object *vvp_object_alloc(const struct lu_env *env,
H A Dvvp_lock.c61 static unsigned long vvp_lock_weigh(const struct lu_env *env, vvp_lock_weigh() argument
81 int vvp_lock_init(const struct lu_env *env, struct cl_object *obj, vvp_lock_init() argument
84 return ccc_lock_init(env, obj, lock, io, &vvp_lock_ops); vvp_lock_init()
H A Dvvp_object.c57 static int vvp_object_print(const struct lu_env *env, void *cookie, vvp_object_print() argument
64 (*p)(env, cookie, "(%s %d %d) inode: %p ", vvp_object_print()
70 (*p)(env, cookie, "%lu/%u %o %u %d %p "DFID, vvp_object_print()
78 static int vvp_attr_get(const struct lu_env *env, struct cl_object *obj, vvp_attr_get() argument
100 static int vvp_attr_set(const struct lu_env *env, struct cl_object *obj, vvp_attr_set() argument
123 static int vvp_conf_set(const struct lu_env *env, struct cl_object *obj, vvp_conf_set() argument
196 struct lu_object *vvp_object_alloc(const struct lu_env *env, vvp_object_alloc() argument
200 return ccc_object_alloc(env, hdr, dev, &vvp_ops, &vvp_lu_obj_ops); vvp_object_alloc()
H A Dlloop.c187 const struct lu_env *env = lo->lo_env; do_bio_lustrebacked() local
209 ret = cl_io_init(env, io, CIT_MISC, obj); do_bio_lustrebacked()
261 bytes = ll_direct_rw_pages(env, io, rw, inode, pvec);
263 cl_io_fini(env, io);
402 struct lu_env *env; loop_thread() local
410 env = cl_env_get(&refcheck); loop_thread()
411 if (IS_ERR(env)) { loop_thread()
412 ret = PTR_ERR(env); loop_thread()
416 lo->lo_env = env; loop_thread()
461 cl_env_put(env, &refcheck); loop_thread()
H A Dfile.c988 int ll_merge_lvb(const struct lu_env *env, struct inode *inode) ll_merge_lvb() argument
992 struct cl_attr *attr = ccc_env_thread_attr(env); ll_merge_lvb()
1010 rc = cl_object_attr_get(env, obj, attr); ll_merge_lvb()
1104 ll_file_io_generic(const struct lu_env *env, struct vvp_io_args *args, ll_file_io_generic() argument
1114 io = ccc_env_thread_io(env); ll_file_io_generic()
1117 if (cl_io_rw_init(env, io, iot, *ppos, count) == 0) { ll_file_io_generic()
1118 struct vvp_io *vio = vvp_env_io(env); ll_file_io_generic()
1119 struct ccc_io *cio = ccc_env_io(env); ll_file_io_generic()
1149 result = cl_io_loop(env, io); ll_file_io_generic()
1165 cl_io_fini(env, io); ll_file_io_generic()
1195 struct lu_env *env; ll_file_read_iter() local
1200 env = cl_env_get(&refcheck); ll_file_read_iter()
1201 if (IS_ERR(env)) ll_file_read_iter()
1202 return PTR_ERR(env); ll_file_read_iter()
1204 args = vvp_env_args(env, IO_NORMAL); ll_file_read_iter()
1208 result = ll_file_io_generic(env, args, iocb->ki_filp, CIT_READ, ll_file_read_iter()
1210 cl_env_put(env, &refcheck); ll_file_read_iter()
1219 struct lu_env *env; ll_file_write_iter() local
1224 env = cl_env_get(&refcheck); ll_file_write_iter()
1225 if (IS_ERR(env)) ll_file_write_iter()
1226 return PTR_ERR(env); ll_file_write_iter()
1228 args = vvp_env_args(env, IO_NORMAL); ll_file_write_iter()
1232 result = ll_file_io_generic(env, args, iocb->ki_filp, CIT_WRITE, ll_file_write_iter()
1234 cl_env_put(env, &refcheck); ll_file_write_iter()
1245 struct lu_env *env; ll_file_splice_read() local
1250 env = cl_env_get(&refcheck); ll_file_splice_read()
1251 if (IS_ERR(env)) ll_file_splice_read()
1252 return PTR_ERR(env); ll_file_splice_read()
1254 args = vvp_env_args(env, IO_SPLICE); ll_file_splice_read()
1258 result = ll_file_io_generic(env, args, in_file, CIT_READ, ppos, count); ll_file_splice_read()
1259 cl_env_put(env, &refcheck); ll_file_splice_read()
1898 struct lu_env *env; ll_hsm_release() local
1919 env = cl_env_nested_get(&nest); ll_hsm_release()
1920 if (IS_ERR(env)) { ll_hsm_release()
1921 rc = PTR_ERR(env); ll_hsm_release()
1925 ll_merge_lvb(env, inode); ll_hsm_release()
1926 cl_env_nested_put(&nest, env); ll_hsm_release()
2584 struct lu_env *env; cl_sync_file_range() local
2594 env = cl_env_nested_get(&nest); cl_sync_file_range()
2595 if (IS_ERR(env)) cl_sync_file_range()
2596 return PTR_ERR(env); cl_sync_file_range()
2600 io = ccc_env_thread_io(env); cl_sync_file_range()
2613 if (cl_io_init(env, io, CIT_FSYNC, io->ci_obj) == 0) cl_sync_file_range()
2614 result = cl_io_loop(env, io); cl_sync_file_range()
2619 cl_io_fini(env, io); cl_sync_file_range()
2620 cl_env_nested_put(&nest, env); cl_sync_file_range()
3296 struct lu_env *env; ll_layout_conf() local
3302 env = cl_env_nested_get(&nest); ll_layout_conf()
3303 if (IS_ERR(env)) ll_layout_conf()
3304 return PTR_ERR(env); ll_layout_conf()
3306 result = cl_conf_set(env, lli->lli_clob, conf); ll_layout_conf()
3307 cl_env_nested_put(&nest, env); ll_layout_conf()
H A Dllite_internal.h726 int ll_readahead(const struct lu_env *env, struct cl_io *io,
777 int ll_merge_lvb(const struct lu_env *env, struct inode *inode);
946 static inline struct vvp_thread_info *vvp_env_info(const struct lu_env *env) vvp_env_info() argument
951 info = lu_context_key_get(&env->le_ctx, &vvp_key); vvp_env_info()
956 static inline struct vvp_io_args *vvp_env_args(const struct lu_env *env, vvp_env_args() argument
959 struct vvp_io_args *ret = &vvp_env_info(env)->vti_args; vvp_env_args()
970 static inline struct vvp_session *vvp_env_session(const struct lu_env *env) vvp_env_session() argument
975 ses = lu_context_key_get(env->le_ses, &vvp_session_key); vvp_env_session()
980 static inline struct vvp_io *vvp_env_io(const struct lu_env *env) vvp_env_io() argument
982 return &vvp_env_session(env)->vs_ios; vvp_env_io()
1366 static inline int cl_merge_lvb(const struct lu_env *env, struct inode *inode) cl_merge_lvb() argument
1368 return ll_merge_lvb(env, inode); cl_merge_lvb()
1406 extern ssize_t ll_direct_rw_pages(const struct lu_env *env, struct cl_io *io,
/linux-4.1.27/drivers/staging/lustre/lustre/osc/
H A Dosc_io.c62 static struct osc_io *cl2osc_io(const struct lu_env *env, cl2osc_io() argument
67 LINVRNT(oio == osc_env_io(env)); cl2osc_io()
88 static void osc_io_fini(const struct lu_env *env, const struct cl_io_slice *io) osc_io_fini() argument
99 static int osc_io_submit(const struct lu_env *env, osc_io_submit() argument
128 brw_flags = osc_io_srvlock(cl2osc_io(env, ios)) ? OBD_BRW_SRVLOCK : 0; osc_io_submit()
153 result = cl_page_prep(env, io, page, crt); cl_page_list_for_each_safe()
171 osc_page_submit(env, opg, crt, brw_flags); cl_page_list_for_each_safe()
175 result = osc_queue_sync_pages(env, osc, &list, cmd, cl_page_list_for_each_safe()
183 result = osc_queue_sync_pages(env, osc, &list, cmd, brw_flags);
189 static void osc_page_touch_at(const struct lu_env *env, osc_page_touch_at() argument
193 struct cl_attr *attr = &osc_env_info(env)->oti_attr; osc_page_touch_at()
221 cl_object_attr_set(env, obj, attr, valid); osc_page_touch_at()
233 static void osc_page_touch(const struct lu_env *env, osc_page_touch() argument
239 osc_page_touch_at(env, obj, page->cp_index, to); osc_page_touch()
256 static int osc_io_prepare_write(const struct lu_env *env, osc_io_prepare_write() argument
263 struct osc_io *oio = cl2osc_io(env, ios); osc_io_prepare_write()
277 cl_page_export(env, slice->cpl_page, 1); osc_io_prepare_write()
282 static int osc_io_commit_write(const struct lu_env *env, osc_io_commit_write() argument
287 struct osc_io *oio = cl2osc_io(env, ios); osc_io_commit_write()
299 osc_page_touch(env, cl2osc_page(slice), to); osc_io_commit_write()
306 cl_page_clip(env, slice->cpl_page, from, to); osc_io_commit_write()
311 static int osc_io_fault_start(const struct lu_env *env, osc_io_fault_start() argument
327 osc_page_touch_at(env, ios->cis_obj, osc_io_fault_start()
344 static int trunc_check_cb(const struct lu_env *env, struct cl_io *io, trunc_check_cb() argument
359 CL_PAGE_DEBUG(D_ERROR, env, page, "exists %llu/%s.\n", trunc_check_cb()
363 struct page *vmpage = cl_page_vmpage(env, page); trunc_check_cb()
374 static void osc_trunc_check(const struct lu_env *env, struct cl_io *io, osc_trunc_check() argument
388 cl_page_gang_lookup(env, clob, io, start + partial, CL_PAGE_EOF, osc_trunc_check()
392 static int osc_io_setattr_start(const struct lu_env *env, osc_io_setattr_start() argument
396 struct osc_io *oio = cl2osc_io(env, slice); osc_io_setattr_start()
399 struct cl_attr *attr = &osc_env_info(env)->oti_attr; osc_io_setattr_start()
409 result = osc_cache_truncate_start(env, oio, cl2osc(obj), size); osc_io_setattr_start()
413 result = cl_object_attr_get(env, obj, attr); osc_io_setattr_start()
434 result = cl_object_attr_set(env, obj, attr, cl_valid); osc_io_setattr_start()
477 static void osc_io_setattr_end(const struct lu_env *env, osc_io_setattr_end() argument
481 struct osc_io *oio = cl2osc_io(env, slice); osc_io_setattr_end()
504 osc_trunc_check(env, io, oio, size); osc_io_setattr_end()
506 osc_cache_truncate_end(env, oio, cl2osc(obj)); osc_io_setattr_end()
512 static int osc_io_read_start(const struct lu_env *env, osc_io_read_start() argument
516 struct cl_attr *attr = &osc_env_info(env)->oti_attr; osc_io_read_start()
522 rc = cl_object_attr_set(env, obj, attr, CAT_ATIME); osc_io_read_start()
528 static int osc_io_write_start(const struct lu_env *env, osc_io_write_start() argument
532 struct cl_attr *attr = &osc_env_info(env)->oti_attr; osc_io_write_start()
538 rc = cl_object_attr_set(env, obj, attr, CAT_MTIME | CAT_CTIME); osc_io_write_start()
544 static int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj, osc_fsync_ost() argument
547 struct osc_io *oio = osc_env_io(env); osc_fsync_ost()
575 static int osc_io_fsync_start(const struct lu_env *env, osc_io_fsync_start() argument
589 result = osc_cache_writeback_range(env, osc, start, end, 0, osc_io_fsync_start()
603 rc = osc_cache_wait_range(env, osc, start, end); osc_io_fsync_start()
606 rc = osc_fsync_ost(env, osc, fio); osc_io_fsync_start()
614 static void osc_io_fsync_end(const struct lu_env *env, osc_io_fsync_end() argument
624 result = osc_cache_wait_range(env, cl2osc(obj), start, end); osc_io_fsync_end()
626 struct osc_io *oio = cl2osc_io(env, slice); osc_io_fsync_end()
636 static void osc_io_end(const struct lu_env *env, osc_io_end() argument
639 struct osc_io *oio = cl2osc_io(env, slice); osc_io_end()
642 osc_extent_release(env, oio->oi_active); osc_io_end()
694 static int osc_req_prep(const struct lu_env *env, osc_req_prep() argument
700 static void osc_req_completion(const struct lu_env *env, osc_req_completion() argument
714 static void osc_req_attr_set(const struct lu_env *env, osc_req_attr_set() argument
759 lock = cl_lock_at_page(env, apage->cp_obj, apage, NULL, 1, 1); osc_req_attr_set()
767 CL_LOCK_DEBUG(D_ERROR, env, scan, osc_req_attr_set()
769 CL_PAGE_DEBUG(D_ERROR, env, apage, osc_req_attr_set()
783 cl_lock_put(env, lock); osc_req_attr_set()
794 int osc_io_init(const struct lu_env *env, osc_io_init() argument
797 struct osc_io *oio = osc_env_io(env); osc_io_init()
804 int osc_req_init(const struct lu_env *env, struct cl_device *dev, osc_req_init() argument
H A Dosc_lock.c63 static void osc_lock_to_lockless(const struct lu_env *env,
146 static void osc_lock_detach(const struct lu_env *env, struct osc_lock *olck) osc_lock_detach() argument
167 struct cl_attr *attr = &osc_env_info(env)->oti_attr; osc_lock_detach()
177 cl_object_attr_set(env, obj, attr, CAT_KMS); osc_lock_detach()
201 static int osc_lock_unuse(const struct lu_env *env, osc_lock_unuse() argument
217 osc_lock_detach(env, ols); osc_lock_unuse()
237 static void osc_lock_fini(const struct lu_env *env, osc_lock_fini() argument
257 static void osc_lock_build_policy(const struct lu_env *env, osc_lock_build_policy() argument
318 static void osc_ast_data_put(const struct lu_env *env, struct osc_lock *olck) osc_ast_data_put() argument
324 cl_lock_put(env, lock); osc_ast_data_put()
337 static void osc_lock_lvb_update(const struct lu_env *env, struct osc_lock *olck, osc_lock_lvb_update() argument
352 attr = &osc_env_info(env)->oti_attr; osc_lock_lvb_update()
389 cl_object_attr_set(env, obj, attr, valid); osc_lock_lvb_update()
401 static void osc_lock_granted(const struct lu_env *env, struct osc_lock *olck, osc_lock_granted() argument
413 descr = &osc_env_info(env)->oti_descr; osc_lock_granted()
426 osc_lock_lvb_update(env, olck, rc); osc_lock_granted()
434 cl_lock_modify(env, lock, descr); osc_lock_granted()
435 cl_lock_signal(env, lock); osc_lock_granted()
441 static void osc_lock_upcall0(const struct lu_env *env, struct osc_lock *olck) osc_lock_upcall0() argument
462 osc_lock_granted(env, olck, dlmlock, 0); osc_lock_upcall0()
488 struct lu_env *env; osc_lock_upcall() local
491 env = cl_env_nested_get(&nest); osc_lock_upcall()
492 if (!IS_ERR(env)) { osc_lock_upcall()
495 cl_lock_mutex_get(env, lock); osc_lock_upcall()
525 osc_lock_upcall0(env, olck); osc_lock_upcall()
537 osc_lock_to_lockless(env, olck, 1); osc_lock_upcall()
541 osc_lock_lvb_update(env, olck, rc); osc_lock_upcall()
542 cl_lock_delete(env, lock); osc_lock_upcall()
554 cl_wait_try(env, lock); osc_lock_upcall()
559 cl_lock_signal(env, lock); osc_lock_upcall()
561 cl_unuse_try(env, lock); osc_lock_upcall()
564 cl_lock_user_del(env, lock); osc_lock_upcall()
565 cl_lock_error(env, lock, rc); osc_lock_upcall()
569 cl_lock_hold_release(env, lock, "upcall", lock); osc_lock_upcall()
570 cl_lock_mutex_put(env, lock); osc_lock_upcall()
575 cl_lock_put(env, lock); osc_lock_upcall()
577 cl_env_nested_put(&nest, env); osc_lock_upcall()
588 static void osc_lock_blocking(const struct lu_env *env, osc_lock_blocking() argument
616 cl_lock_cancel(env, lock); osc_lock_blocking()
617 cl_lock_delete(env, lock); osc_lock_blocking()
624 static int osc_dlm_blocking_ast0(const struct lu_env *env, osc_dlm_blocking_ast0() argument
639 cl_lock_mutex_get(env, lock); osc_dlm_blocking_ast0()
643 cl_lock_signal(env, lock); osc_dlm_blocking_ast0()
665 osc_lock_blocking(env, dlmlock, osc_dlm_blocking_ast0()
669 cl_lock_mutex_put(env, lock); osc_dlm_blocking_ast0()
670 osc_ast_data_put(env, olck); osc_dlm_blocking_ast0()
682 lockh = &osc_env_info(env)->oti_handle; osc_dlm_blocking_ast0()
736 struct lu_env *env; osc_ldlm_blocking_ast() local
751 env = cl_env_nested_get(&nest); osc_ldlm_blocking_ast()
752 if (!IS_ERR(env)) { osc_ldlm_blocking_ast()
753 result = osc_dlm_blocking_ast0(env, dlmlock, data, flag); osc_ldlm_blocking_ast()
754 cl_env_nested_put(&nest, env); osc_ldlm_blocking_ast()
756 result = PTR_ERR(env); osc_ldlm_blocking_ast()
777 struct lu_env *env; osc_ldlm_completion_ast() local
786 env = cl_env_nested_get(&nest); osc_ldlm_completion_ast()
787 if (!IS_ERR(env)) { osc_ldlm_completion_ast()
791 cl_lock_mutex_get(env, lock); osc_ldlm_completion_ast()
811 osc_lock_granted(env, olck, dlmlock, dlmrc); osc_ldlm_completion_ast()
816 CL_LOCK_DEBUG(D_ERROR, env, lock, osc_ldlm_completion_ast()
818 cl_lock_error(env, lock, dlmrc); osc_ldlm_completion_ast()
820 cl_lock_mutex_put(env, lock); osc_ldlm_completion_ast()
821 osc_ast_data_put(env, olck); osc_ldlm_completion_ast()
825 cl_env_nested_put(&nest, env); osc_ldlm_completion_ast()
827 result = PTR_ERR(env); osc_ldlm_completion_ast()
838 struct lu_env *env; osc_ldlm_glimpse_ast() local
845 env = cl_env_nested_get(&nest); osc_ldlm_glimpse_ast()
846 if (!IS_ERR(env)) { osc_ldlm_glimpse_ast()
860 * cl_lock_mutex_get(env, lock); */ osc_ldlm_glimpse_ast()
869 result = cl_object_glimpse(env, obj, lvb); osc_ldlm_glimpse_ast()
876 osc_ast_data_put(env, olck); osc_ldlm_glimpse_ast()
886 cl_env_nested_put(&nest, env); osc_ldlm_glimpse_ast()
888 result = PTR_ERR(env); osc_ldlm_glimpse_ast()
893 static unsigned long osc_lock_weigh(const struct lu_env *env, osc_lock_weigh() argument
903 static void osc_lock_build_einfo(const struct lu_env *env, osc_lock_build_einfo() argument
939 static void osc_lock_to_lockless(const struct lu_env *env, osc_lock_to_lockless() argument
951 struct osc_io *oio = osc_env_io(env); osc_lock_to_lockless()
1006 static int osc_lock_enqueue_wait(const struct lu_env *env, osc_lock_enqueue_wait() argument
1072 cl_lock_put(env, conflict); osc_lock_enqueue_wait()
1101 static int osc_lock_enqueue(const struct lu_env *env, osc_lock_enqueue() argument
1116 result = osc_lock_enqueue_wait(env, ols); osc_lock_enqueue()
1120 struct osc_thread_info *info = osc_env_info(env); osc_lock_enqueue()
1127 cl_lock_hold_add(env, lock, "upcall", lock); osc_lock_enqueue()
1129 cl_lock_user_add(env, lock); osc_lock_enqueue()
1138 osc_lock_build_policy(env, lock, policy); osc_lock_enqueue()
1147 cl_lock_user_del(env, lock); osc_lock_enqueue()
1148 cl_lock_unhold(env, lock, "upcall", lock); osc_lock_enqueue()
1156 ols->ols_owner = osc_env_io(env); osc_lock_enqueue()
1163 static int osc_lock_wait(const struct lu_env *env, osc_lock_wait() argument
1193 rc = osc_lock_enqueue(env, slice, NULL, CEF_ASYNC | CEF_MUST); osc_lock_wait()
1210 static int osc_lock_use(const struct lu_env *env, osc_lock_use() argument
1250 struct lu_env *env; osc_lock_flush() local
1253 env = cl_env_nested_get(&nest); osc_lock_flush()
1254 if (!IS_ERR(env)) { osc_lock_flush()
1260 result = osc_cache_writeback_range(env, obj, osc_lock_flush()
1270 rc = cl_lock_discard_pages(env, lock); osc_lock_flush()
1274 cl_env_nested_put(&nest, env); osc_lock_flush()
1276 result = PTR_ERR(env); osc_lock_flush()
1298 static void osc_lock_cancel(const struct lu_env *env, osc_lock_cancel() argument
1330 CL_LOCK_DEBUG(D_ERROR, env, lock, osc_lock_cancel()
1336 osc_lock_detach(env, olck); osc_lock_cancel()
1344 static void osc_lock_delete(const struct lu_env *env, osc_lock_delete() argument
1360 osc_lock_detach(env, olck); osc_lock_delete()
1373 static void osc_lock_state(const struct lu_env *env, osc_lock_state() argument
1384 struct osc_io *oio = osc_env_io(env); osc_lock_state()
1392 static int osc_lock_print(const struct lu_env *env, void *cookie, osc_lock_print() argument
1400 (*p)(env, cookie, "%p %#16llx %#llx %d %p ", osc_lock_print()
1403 osc_lvb_print(env, cookie, p, &lock->ols_lvb); osc_lock_print()
1407 static int osc_lock_fits_into(const struct lu_env *env, osc_lock_fits_into() argument
1468 static int osc_lock_lockless_unuse(const struct lu_env *env, osc_lock_lockless_unuse() argument
1477 cl_lock_cancel(env, lock); osc_lock_lockless_unuse()
1478 cl_lock_delete(env, lock); osc_lock_lockless_unuse()
1482 static void osc_lock_lockless_cancel(const struct lu_env *env, osc_lock_lockless_cancel() argument
1495 static int osc_lock_lockless_wait(const struct lu_env *env, osc_lock_lockless_wait() argument
1507 static void osc_lock_lockless_state(const struct lu_env *env, osc_lock_lockless_state() argument
1515 struct osc_io *oio = osc_env_io(env); osc_lock_lockless_state()
1527 static int osc_lock_lockless_fits_into(const struct lu_env *env, osc_lock_lockless_fits_into() argument
1538 return (lock->ols_owner == osc_env_io(env)); osc_lock_lockless_fits_into()
1552 int osc_lock_init(const struct lu_env *env, osc_lock_init() argument
1563 osc_lock_build_einfo(env, lock, clk, &clk->ols_einfo); osc_lock_init()
1578 osc_lock_to_lockless(env, clk, (enqflags & CEF_NEVER)); osc_lock_init()
H A Dosc_page.c47 static int osc_lru_reserve(const struct lu_env *env, struct osc_object *obj,
62 static int osc_page_is_dlocked(const struct lu_env *env,
77 info = osc_env_info(env);
89 osc_lock_build_res(env, obj, resname);
99 static int osc_page_protected(const struct lu_env *env,
121 result = osc_page_is_dlocked(env, opg, mode, 1, unref);
125 descr = &osc_env_info(env)->oti_descr;
152 static int osc_page_protected(const struct lu_env *env, osc_page_protected() argument
165 static void osc_page_fini(const struct lu_env *env, osc_page_fini() argument
183 static void osc_page_transfer_put(const struct lu_env *env, osc_page_transfer_put() argument
191 cl_page_put(env, page); osc_page_transfer_put()
200 static void osc_page_transfer_add(const struct lu_env *env, osc_page_transfer_add() argument
215 static int osc_page_cache_add(const struct lu_env *env, osc_page_cache_add() argument
219 struct osc_io *oio = osc_env_io(env); osc_page_cache_add()
223 LINVRNT(osc_page_protected(env, opg, CLM_WRITE, 0)); osc_page_cache_add()
226 result = osc_queue_async_io(env, io, opg); osc_page_cache_add()
228 osc_page_transfer_put(env, opg); osc_page_cache_add()
230 osc_page_transfer_add(env, opg, CRT_WRITE); osc_page_cache_add()
237 osc_extent_release(env, oio->oi_active); osc_page_cache_add()
253 static int osc_page_addref_lock(const struct lu_env *env, osc_page_addref_lock() argument
274 static void osc_page_putref_lock(const struct lu_env *env, osc_page_putref_lock() argument
286 cl_lock_put(env, lock); osc_page_putref_lock()
289 static int osc_page_is_under_lock(const struct lu_env *env, osc_page_is_under_lock() argument
296 lock = cl_lock_at_page(env, slice->cpl_obj, slice->cpl_page, osc_page_is_under_lock()
299 if (osc_page_addref_lock(env, cl2osc_page(slice), lock) == 0) osc_page_is_under_lock()
301 cl_lock_put(env, lock); osc_page_is_under_lock()
306 static void osc_page_disown(const struct lu_env *env, osc_page_disown() argument
313 osc_page_putref_lock(env, opg); osc_page_disown()
316 static void osc_page_completion_read(const struct lu_env *env, osc_page_completion_read() argument
324 osc_page_putref_lock(env, opg); osc_page_completion_read()
328 static void osc_page_completion_write(const struct lu_env *env, osc_page_completion_write() argument
338 static int osc_page_fail(const struct lu_env *env, osc_page_fail() argument
363 static int osc_page_print(const struct lu_env *env, osc_page_print() argument
372 return (*printer)(env, cookie, LUSTRE_OSC_NAME "-page@%p: 1< %#x %d %u %s %s > 2< %llu %u %u %#x %#x | %p %p %p > 3< %s %p %d %lu %d > 4< %d %d %d %lu %s | %s %s %s %s > 5< %s %s %s %s | %d %s | %d %s %s>\n", osc_page_print()
408 static void osc_page_delete(const struct lu_env *env, osc_page_delete() argument
415 LINVRNT(opg->ops_temp || osc_page_protected(env, opg, CLM_READ, 1)); osc_page_delete()
418 osc_page_transfer_put(env, opg); osc_page_delete()
419 rc = osc_teardown_async_page(env, obj, opg); osc_page_delete()
421 CL_PAGE_DEBUG(D_ERROR, env, cl_page_top(slice->cpl_page), osc_page_delete()
437 void osc_page_clip(const struct lu_env *env, const struct cl_page_slice *slice, osc_page_clip() argument
443 LINVRNT(osc_page_protected(env, opg, CLM_READ, 0)); osc_page_clip()
452 static int osc_page_cancel(const struct lu_env *env, osc_page_cancel() argument
458 LINVRNT(osc_page_protected(env, opg, CLM_READ, 0)); osc_page_cancel()
464 rc = osc_cancel_async_page(env, opg); osc_page_cancel()
469 static int osc_page_flush(const struct lu_env *env, osc_page_flush() argument
476 rc = osc_flush_async_page(env, io, opg); osc_page_flush()
501 int osc_page_init(const struct lu_env *env, struct cl_object *obj, osc_page_init() argument
514 struct osc_io *oio = osc_env_io(env); osc_page_init()
530 result = osc_lru_reserve(env, osc, opg); osc_page_init()
539 void osc_page_submit(const struct lu_env *env, struct osc_page *opg, osc_page_submit() argument
545 LINVRNT(osc_page_protected(env, opg, osc_page_submit()
566 osc_page_transfer_add(env, opg, crt); osc_page_submit()
619 static int discard_pagevec(const struct lu_env *env, struct cl_io *io, discard_pagevec() argument
627 if (cl_page_own_try(env, io, page) == 0) { discard_pagevec()
633 cl_page_unmap(env, io, page); discard_pagevec()
634 cl_page_discard(env, io, page); discard_pagevec()
637 cl_page_disown(env, io, page); discard_pagevec()
639 cl_page_put(env, page); discard_pagevec()
651 struct lu_env *env; osc_lru_shrink() local
665 env = cl_env_nested_get(&nest); osc_lru_shrink()
666 if (IS_ERR(env)) osc_lru_shrink()
667 return PTR_ERR(env); osc_lru_shrink()
669 pvec = osc_env_info(env)->oti_pvec; osc_lru_shrink()
670 io = &osc_env_info(env)->oti_io; osc_lru_shrink()
697 count -= discard_pagevec(env, io, pvec, index); osc_lru_shrink()
700 cl_io_fini(env, io); osc_lru_shrink()
701 cl_object_put(env, clobj); osc_lru_shrink()
708 rc = cl_io_init(env, io, CIT_MISC, clobj); osc_lru_shrink()
733 count -= discard_pagevec(env, io, pvec, index); osc_lru_shrink()
742 count -= discard_pagevec(env, io, pvec, index); osc_lru_shrink()
744 cl_io_fini(env, io); osc_lru_shrink()
745 cl_object_put(env, clobj); osc_lru_shrink()
747 cl_env_nested_put(&nest, env); osc_lru_shrink()
868 static int osc_lru_reserve(const struct lu_env *env, struct osc_object *obj, osc_lru_reserve() argument
H A Dosc_object.c72 static int osc_object_init(const struct lu_env *env, struct lu_object *obj, osc_object_init() argument
103 static void osc_object_free(const struct lu_env *env, struct lu_object *obj) osc_object_free() argument
128 int osc_lvb_print(const struct lu_env *env, void *cookie, osc_lvb_print() argument
131 return (*p)(env, cookie, "size: %llu mtime: %llu atime: %llu ctime: %llu blocks: %llu", osc_lvb_print()
136 static int osc_object_print(const struct lu_env *env, void *cookie, osc_object_print() argument
143 (*p)(env, cookie, "id: " DOSTID " idx: %d gen: %d kms_valid: %u kms %llu rc: %d force_sync: %d min_xid: %llu ", osc_object_print()
147 osc_lvb_print(env, cookie, p, &oinfo->loi_lvb); osc_object_print()
152 static int osc_attr_get(const struct lu_env *env, struct cl_object *obj, osc_attr_get() argument
162 int osc_attr_set(const struct lu_env *env, struct cl_object *obj, osc_attr_set() argument
186 static int osc_object_glimpse(const struct lu_env *env, osc_object_glimpse() argument
253 struct lu_object *osc_object_alloc(const struct lu_env *env, osc_object_alloc() argument
H A Dosc_cache.c50 static int osc_extent_wait(const struct lu_env *env, struct osc_extent *ext,
52 static void osc_ap_completion(const struct lu_env *env, struct client_obd *cli,
54 static int osc_make_ready(const struct lu_env *env, struct osc_async_page *oap,
56 static int osc_refresh_count(const struct lu_env *env,
58 static int osc_io_unplug_async(const struct lu_env *env,
378 static void osc_extent_put(const struct lu_env *env, struct osc_extent *ext) osc_extent_put() argument
388 cl_lock_put(env, ext->oe_osclock); osc_extent_put()
525 static int osc_extent_merge(const struct lu_env *env, struct osc_extent *cur, osc_extent_merge() argument
567 osc_extent_put(env, victim); osc_extent_merge()
576 void osc_extent_release(const struct lu_env *env, struct osc_extent *ext) osc_extent_release() argument
598 osc_extent_merge(env, ext, prev_extent(ext)); osc_extent_release()
599 osc_extent_merge(env, ext, next_extent(ext)); osc_extent_release()
607 osc_io_unplug_async(env, osc_cli(obj), obj); osc_extent_release()
609 osc_extent_put(env, ext); osc_extent_release()
621 struct osc_extent *osc_extent_find(const struct lu_env *env, osc_extent_find() argument
644 lock = cl_lock_at_pgoff(env, osc2cl(obj), index, NULL, 1, 0); osc_extent_find()
771 if (osc_extent_merge(env, ext, next_extent(ext)) == 0) osc_extent_find()
811 rc = osc_extent_wait(env, conflict, OES_INV); osc_extent_find()
812 osc_extent_put(env, conflict); osc_extent_find()
823 osc_extent_put(env, cur); osc_extent_find()
831 int osc_extent_finish(const struct lu_env *env, struct osc_extent *ext, osc_extent_finish() argument
857 osc_ap_completion(env, cli, oap, sent, rc); osc_extent_finish()
881 osc_extent_put(env, ext); osc_extent_finish()
899 static int osc_extent_wait(const struct lu_env *env, struct osc_extent *ext, osc_extent_wait() argument
923 osc_extent_release(env, ext); osc_extent_wait()
949 struct lu_env *env; osc_extent_truncate() local
967 * We can't use that env from osc_cache_truncate_start() because osc_extent_truncate()
969 env = cl_env_nested_get(&nest); osc_extent_truncate()
970 io = &osc_env_info(env)->oti_io; osc_extent_truncate()
972 rc = cl_io_init(env, io, CIT_MISC, io->ci_obj); osc_extent_truncate()
1000 if (cl_page_own(env, io, page) == 0) { osc_extent_truncate()
1001 cl_page_unmap(env, io, page); osc_extent_truncate()
1002 cl_page_discard(env, io, page); osc_extent_truncate()
1003 cl_page_disown(env, io, page); osc_extent_truncate()
1010 cl_page_put(env, page); osc_extent_truncate()
1054 cl_io_fini(env, io); osc_extent_truncate()
1055 cl_env_nested_put(&nest, env); osc_extent_truncate()
1063 static int osc_extent_make_ready(const struct lu_env *env, osc_extent_make_ready() argument
1089 rc = osc_make_ready(env, oap, OBD_BRW_WRITE); osc_extent_make_ready()
1109 last->oap_count = osc_refresh_count(env, last, OBD_BRW_WRITE); osc_extent_make_ready()
1236 static int osc_make_ready(const struct lu_env *env, struct osc_async_page *oap, osc_make_ready() argument
1245 result = cl_page_make_ready(env, page, CRT_WRITE); osc_make_ready()
1251 static int osc_refresh_count(const struct lu_env *env, osc_refresh_count() argument
1257 struct cl_attr *attr = &osc_env_info(env)->oti_attr; osc_refresh_count()
1268 result = cl_object_attr_get(env, obj, attr); osc_refresh_count()
1283 static int osc_completion(const struct lu_env *env, struct osc_async_page *oap, osc_completion() argument
1302 cl_req_page_done(env, page); osc_completion()
1338 cl_page_completion(env, page, crt, rc); osc_completion()
1526 static int osc_enter_cache(const struct lu_env *env, struct client_obd *cli, osc_enter_cache() argument
1568 osc_io_unplug_async(env, cli, NULL); osc_enter_cache()
1781 static void osc_ap_completion(const struct lu_env *env, struct client_obd *cli, osc_ap_completion() argument
1807 rc = osc_completion(env, oap, oap->oap_cmd, rc); osc_ap_completion()
1942 osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli, osc_send_write_rpc() argument
1978 rc = osc_extent_make_ready(env, ext); osc_send_write_rpc()
1981 osc_extent_finish(env, ext, 0, rc); osc_send_write_rpc()
1995 rc = osc_build_rpc(env, cli, &rpclist, OBD_BRW_WRITE, pol); osc_send_write_rpc()
2014 osc_send_read_rpc(const struct lu_env *env, struct client_obd *cli, osc_send_read_rpc() argument
2042 rc = osc_build_rpc(env, cli, &rpclist, OBD_BRW_READ, pol); osc_send_read_rpc()
2088 static void osc_check_rpcs(const struct lu_env *env, struct client_obd *cli, osc_check_rpcs() argument
2118 rc = osc_send_write_rpc(env, cli, osc, pol); osc_check_rpcs()
2142 rc = osc_send_read_rpc(env, cli, osc, pol); osc_check_rpcs()
2151 cl_object_put(env, obj); osc_check_rpcs()
2157 static int osc_io_unplug0(const struct lu_env *env, struct client_obd *cli, osc_io_unplug0() argument
2170 osc_check_rpcs(env, cli, pol); osc_io_unplug0()
2181 static int osc_io_unplug_async(const struct lu_env *env, osc_io_unplug_async() argument
2185 return osc_io_unplug0(env, cli, osc, PDL_POLICY_ROUND, 1); osc_io_unplug_async()
2188 void osc_io_unplug(const struct lu_env *env, struct client_obd *cli, osc_io_unplug() argument
2191 (void)osc_io_unplug0(env, cli, osc, pol, 0); osc_io_unplug()
2223 int osc_queue_async_io(const struct lu_env *env, struct cl_io *io, osc_queue_async_io() argument
2226 struct osc_io *oio = osc_env_io(env); osc_queue_async_io()
2263 attr = &osc_env_info(env)->oti_attr; osc_queue_async_io()
2266 rc = cl_object_attr_get(env, obj, attr); osc_queue_async_io()
2329 osc_extent_release(env, ext); osc_queue_async_io()
2346 rc = osc_enter_cache(env, cli, oap, tmp); osc_queue_async_io()
2353 ext = osc_extent_find(env, osc, index, &tmp); osc_queue_async_io()
2385 int osc_teardown_async_page(const struct lu_env *env, osc_teardown_async_page() argument
2414 osc_extent_put(env, ext); osc_teardown_async_page()
2425 int osc_flush_async_page(const struct lu_env *env, struct cl_io *io, osc_flush_async_page() argument
2446 CL_PAGE_DEBUG(D_ERROR, env, cl_page_top(cp), osc_flush_async_page()
2471 rc = cl_page_prep(env, io, cl_page_top(cp), CRT_WRITE); osc_flush_async_page()
2494 osc_extent_put(env, ext); osc_flush_async_page()
2496 osc_io_unplug_async(env, osc_cli(obj), obj); osc_flush_async_page()
2507 int osc_cancel_async_page(const struct lu_env *env, struct osc_page *ops) osc_cancel_async_page() argument
2545 osc_extent_finish(env, found, 0, -EINTR);
2546 osc_extent_put(env, found);
2564 int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj, osc_queue_sync_pages() argument
2589 osc_ap_completion(env, cli, oap, 0, -ENOMEM); list_for_each_entry_safe()
2616 osc_io_unplug_async(env, cli, obj);
2623 int osc_cache_truncate_start(const struct lu_env *env, struct osc_io *oio, osc_cache_truncate_start() argument
2694 osc_extent_wait(env, ext, OES_TRUNC); osc_cache_truncate_start()
2723 osc_extent_put(env, ext); osc_cache_truncate_start()
2730 rc = osc_extent_wait(env, waiting, OES_INV); osc_cache_truncate_start()
2734 osc_extent_put(env, waiting); osc_cache_truncate_start()
2744 void osc_cache_truncate_end(const struct lu_env *env, struct osc_io *oio, osc_cache_truncate_end() argument
2767 osc_extent_put(env, ext); osc_cache_truncate_end()
2770 osc_io_unplug_async(env, osc_cli(obj), obj); osc_cache_truncate_end()
2783 int osc_cache_wait_range(const struct lu_env *env, struct osc_object *obj, osc_cache_wait_range() argument
2817 rc = osc_extent_wait(env, ext, OES_INV); osc_cache_wait_range()
2820 osc_extent_put(env, ext); osc_cache_wait_range()
2838 int osc_cache_writeback_range(const struct lu_env *env, struct osc_object *obj, osc_cache_writeback_range() argument
2917 rc = osc_extent_make_ready(env, ext); osc_cache_writeback_range()
2926 osc_extent_finish(env, ext, 0, 0); osc_cache_writeback_range()
2931 osc_io_unplug(env, osc_cli(obj), obj, PDL_POLICY_ROUND); osc_cache_writeback_range()
2935 rc = osc_cache_wait_range(env, obj, start, end); osc_cache_writeback_range()
H A Dosc_cl_internal.h415 int osc_lock_init(const struct lu_env *env,
418 int osc_io_init (const struct lu_env *env,
420 int osc_req_init (const struct lu_env *env, struct cl_device *dev,
422 struct lu_object *osc_object_alloc(const struct lu_env *env,
425 int osc_page_init(const struct lu_env *env, struct cl_object *obj,
430 int osc_lvb_print (const struct lu_env *env, void *cookie,
433 void osc_page_submit(const struct lu_env *env, struct osc_page *opg,
435 int osc_cancel_async_page(const struct lu_env *env, struct osc_page *ops);
440 int osc_queue_async_io(const struct lu_env *env, struct cl_io *io,
442 int osc_teardown_async_page(const struct lu_env *env, struct osc_object *obj,
444 int osc_flush_async_page(const struct lu_env *env, struct cl_io *io,
446 int osc_queue_sync_pages(const struct lu_env *env, struct osc_object *obj,
448 int osc_cache_truncate_start(const struct lu_env *env, struct osc_io *oio,
450 void osc_cache_truncate_end(const struct lu_env *env, struct osc_io *oio,
452 int osc_cache_writeback_range(const struct lu_env *env, struct osc_object *obj,
454 int osc_cache_wait_range(const struct lu_env *env, struct osc_object *obj,
456 void osc_io_unplug(const struct lu_env *env, struct client_obd *cli,
471 static inline struct osc_thread_info *osc_env_info(const struct lu_env *env) osc_env_info() argument
475 info = lu_context_key_get(&env->le_ctx, &osc_key); osc_env_info()
480 static inline struct osc_session *osc_env_session(const struct lu_env *env) osc_env_session() argument
484 ses = lu_context_key_get(env->le_ses, &osc_session_key); osc_env_session()
489 static inline struct osc_io *osc_env_io(const struct lu_env *env) osc_env_io() argument
491 return &osc_env_session(env)->os_io; osc_env_io()
679 int osc_extent_finish(const struct lu_env *env, struct osc_extent *ext,
681 void osc_extent_release(const struct lu_env *env, struct osc_extent *ext);
H A Dosc_dev.c173 static int osc_cl_process_config(const struct lu_env *env, osc_cl_process_config() argument
189 static int osc_device_init(const struct lu_env *env, struct lu_device *d, osc_device_init() argument
195 static struct lu_device *osc_device_fini(const struct lu_env *env, osc_device_fini() argument
201 static struct lu_device *osc_device_free(const struct lu_env *env, osc_device_free() argument
211 static struct lu_device *osc_device_alloc(const struct lu_env *env, osc_device_alloc() argument
234 osc_device_free(env, d); osc_device_alloc()
H A Dosc_request.c98 static int brw_interpret(const struct lu_env *env,
233 static int osc_getattr_interpret(const struct lu_env *env, osc_getattr_interpret() argument
292 static int osc_getattr(const struct lu_env *env, struct obd_export *exp, osc_getattr() argument
336 static int osc_setattr(const struct lu_env *env, struct obd_export *exp, osc_setattr() argument
378 static int osc_setattr_interpret(const struct lu_env *env, osc_setattr_interpret() argument
590 static int osc_sync_interpret(const struct lu_env *env, osc_sync_interpret() argument
691 static int osc_destroy_interpret(const struct lu_env *env, osc_destroy_interpret() argument
720 int osc_create(const struct lu_env *env, struct obd_export *exp, osc_create() argument
754 static int osc_destroy(const struct lu_env *env, struct obd_export *exp, osc_destroy() argument
891 static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,
895 static int osc_shrink_grant_interpret(const struct lu_env *env, osc_shrink_grant_interpret() argument
1754 static int brw_interpret(const struct lu_env *env, brw_interpret() argument
1800 osc_extent_finish(env, ext, 1, rc); brw_interpret()
1807 struct cl_attr *attr = &osc_env_info(env)->oti_attr; brw_interpret()
1829 cl_object_attr_set(env, obj, attr, valid); brw_interpret()
1832 cl_object_put(env, obj); brw_interpret()
1836 cl_req_completion(env, aa->aa_clerq, rc < 0 ? rc : brw_interpret()
1852 osc_io_unplug(env, cli, NULL, PDL_POLICY_SAME); brw_interpret()
1861 int osc_build_rpc(const struct lu_env *env, struct client_obd *cli, osc_build_rpc() argument
1933 clerq = cl_req_alloc(env, page, crt,
1949 cl_req_page_add(env, clerq, page);
1955 cl_req_attr_set(env, clerq, crattr, ~0ULL);
1961 rc = cl_req_prep(env, clerq);
1987 cl_req_attr_set(env, clerq, crattr,
2074 osc_extent_finish(env, ext, 0, rc);
2077 cl_req_completion(env, clerq, rc);
2176 static int osc_enqueue_interpret(const struct lu_env *env, osc_enqueue_interpret() argument
2444 static int osc_statfs_interpret(const struct lu_env *env, osc_statfs_interpret() argument
2522 static int osc_statfs(const struct lu_env *env, struct obd_export *exp, osc_statfs() argument
2738 static int osc_get_info(const struct lu_env *env, struct obd_export *exp, osc_get_info() argument
2879 static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp, osc_set_info_async() argument
2996 static int osc_reconnect(const struct lu_env *env, osc_reconnect() argument
3074 struct lu_env *env; osc_import_event() local
3077 env = cl_env_get(&refcheck); osc_import_event()
3078 if (!IS_ERR(env)) { osc_import_event()
3083 osc_io_unplug(env, cli, NULL, PDL_POLICY_ROUND); osc_import_event()
3086 cl_env_put(env, &refcheck); osc_import_event()
3088 rc = PTR_ERR(env); osc_import_event()
3149 static int brw_queue_work(const struct lu_env *env, void *data) brw_queue_work() argument
3155 osc_io_unplug(env, cli, NULL, PDL_POLICY_SAME); brw_queue_work()
H A Dosc_internal.h88 int osc_create(const struct lu_env *env, struct obd_export *exp,
130 int osc_build_rpc(const struct lu_env *env, struct client_obd *cli,
/linux-4.1.27/arch/mips/pnx833x/common/
H A Dprom.c48 char **env = prom_envp; prom_getenv() local
53 while (*env) { prom_getenv()
54 if (strncmp(envname, *env, i) == 0 && *(*env+i) == '=') prom_getenv()
55 return *env + i + 1; prom_getenv()
56 env++; prom_getenv()
/linux-4.1.27/arch/mips/alchemy/common/
H A Dprom.c64 char **env = prom_envp; prom_getenv() local
66 int yamon = (*env && strchr(*env, '=') == NULL); prom_getenv()
68 while (*env) { prom_getenv()
70 if (strcmp(envname, *env++) == 0) prom_getenv()
71 return *env; prom_getenv()
72 } else if (strncmp(envname, *env, i) == 0 && (*env)[i] == '=') prom_getenv()
73 return *env + i + 1; prom_getenv()
74 env++; prom_getenv()
/linux-4.1.27/kernel/bpf/
H A Dverifier.c241 static void print_verifier_state(struct verifier_env *env) print_verifier_state() argument
247 t = env->cur_state.regs[i].type; print_verifier_state()
252 verbose("%d", env->cur_state.regs[i].imm); print_verifier_state()
256 env->cur_state.regs[i].map_ptr->key_size, print_verifier_state()
257 env->cur_state.regs[i].map_ptr->value_size); print_verifier_state()
260 if (env->cur_state.stack_slot_type[i] == STACK_SPILL) print_verifier_state()
262 reg_type_str[env->cur_state.spilled_regs[i / BPF_REG_SIZE].type]); print_verifier_state()
412 static int pop_stack(struct verifier_env *env, int *prev_insn_idx) pop_stack() argument
417 if (env->head == NULL) pop_stack()
420 memcpy(&env->cur_state, &env->head->st, sizeof(env->cur_state)); pop_stack()
421 insn_idx = env->head->insn_idx; pop_stack()
423 *prev_insn_idx = env->head->prev_insn_idx; pop_stack()
424 elem = env->head->next; pop_stack()
425 kfree(env->head); pop_stack()
426 env->head = elem; pop_stack()
427 env->stack_size--; pop_stack()
431 static struct verifier_state *push_stack(struct verifier_env *env, int insn_idx, push_stack() argument
440 memcpy(&elem->st, &env->cur_state, sizeof(env->cur_state)); push_stack()
443 elem->next = env->head; push_stack()
444 env->head = elem; push_stack()
445 env->stack_size++; push_stack()
446 if (env->stack_size > 1024) { push_stack()
453 while (pop_stack(env, NULL) >= 0); push_stack()
613 static int check_map_access(struct verifier_env *env, u32 regno, int off, check_map_access() argument
616 struct bpf_map *map = env->cur_state.regs[regno].map_ptr; check_map_access()
627 static int check_ctx_access(struct verifier_env *env, int off, int size, check_ctx_access() argument
630 if (env->prog->aux->ops->is_valid_access && check_ctx_access()
631 env->prog->aux->ops->is_valid_access(off, size, t)) check_ctx_access()
644 static int check_mem_access(struct verifier_env *env, u32 regno, int off, check_mem_access() argument
648 struct verifier_state *state = &env->cur_state; check_mem_access()
661 err = check_map_access(env, regno, off, size); check_mem_access()
666 err = check_ctx_access(env, off, size, t); check_mem_access()
687 static int check_xadd(struct verifier_env *env, struct bpf_insn *insn) check_xadd() argument
689 struct reg_state *regs = env->cur_state.regs; check_xadd()
709 err = check_mem_access(env, insn->dst_reg, insn->off, check_xadd()
715 return check_mem_access(env, insn->dst_reg, insn->off, check_xadd()
723 static int check_stack_boundary(struct verifier_env *env, check_stack_boundary() argument
726 struct verifier_state *state = &env->cur_state; check_stack_boundary()
751 static int check_func_arg(struct verifier_env *env, u32 regno, check_func_arg() argument
754 struct reg_state *reg = env->cur_state.regs + regno; check_func_arg()
807 err = check_stack_boundary(env, regno, (*mapp)->key_size); check_func_arg()
818 err = check_stack_boundary(env, regno, (*mapp)->value_size); check_func_arg()
830 err = check_stack_boundary(env, regno - 1, reg->imm); check_func_arg()
836 static int check_call(struct verifier_env *env, int func_id) check_call() argument
838 struct verifier_state *state = &env->cur_state; check_call()
851 if (env->prog->aux->ops->get_func_proto) check_call()
852 fn = env->prog->aux->ops->get_func_proto(func_id); check_call()
860 if (!env->prog->gpl_compatible && fn->gpl_only) { check_call()
866 err = check_func_arg(env, BPF_REG_1, fn->arg1_type, &map); check_call()
869 err = check_func_arg(env, BPF_REG_2, fn->arg2_type, &map); check_call()
872 err = check_func_arg(env, BPF_REG_3, fn->arg3_type, &map); check_call()
875 err = check_func_arg(env, BPF_REG_4, fn->arg4_type, &map); check_call()
878 err = check_func_arg(env, BPF_REG_5, fn->arg5_type, &map); check_call()
1052 static int check_cond_jmp_op(struct verifier_env *env, check_cond_jmp_op() argument
1055 struct reg_state *regs = env->cur_state.regs; check_cond_jmp_op()
1107 other_branch = push_stack(env, *insn_idx + insn->off + 1, *insn_idx); check_cond_jmp_op()
1147 print_verifier_state(env); check_cond_jmp_op()
1160 static int check_ld_imm(struct verifier_env *env, struct bpf_insn *insn) check_ld_imm() argument
1162 struct reg_state *regs = env->cur_state.regs; check_ld_imm()
1217 static int check_ld_abs(struct verifier_env *env, struct bpf_insn *insn) check_ld_abs() argument
1219 struct reg_state *regs = env->cur_state.regs; check_ld_abs()
1224 if (!may_access_skb(env->prog->type)) { check_ld_abs()
1317 static int push_insn(int t, int w, int e, struct verifier_env *env) push_insn() argument
1325 if (w < 0 || w >= env->prog->len) { push_insn()
1332 env->explored_states[w] = STATE_LIST_MARK; push_insn()
1338 if (cur_stack >= env->prog->len) push_insn()
1358 static int check_cfg(struct verifier_env *env) check_cfg() argument
1360 struct bpf_insn *insns = env->prog->insnsi; check_cfg()
1361 int insn_cnt = env->prog->len; check_cfg()
1390 ret = push_insn(t, t + 1, FALLTHROUGH, env); check_cfg()
1402 FALLTHROUGH, env); check_cfg()
1411 env->explored_states[t + 1] = STATE_LIST_MARK; check_cfg()
1414 ret = push_insn(t, t + 1, FALLTHROUGH, env); check_cfg()
1420 ret = push_insn(t, t + insns[t].off + 1, BRANCH, env); check_cfg()
1430 ret = push_insn(t, t + 1, FALLTHROUGH, env); check_cfg()
1535 static int is_state_visited(struct verifier_env *env, int insn_idx) is_state_visited() argument
1540 sl = env->explored_states[insn_idx]; is_state_visited()
1548 if (states_equal(&sl->state, &env->cur_state)) is_state_visited()
1567 memcpy(&new_sl->state, &env->cur_state, sizeof(env->cur_state)); is_state_visited()
1568 new_sl->next = env->explored_states[insn_idx]; is_state_visited()
1569 env->explored_states[insn_idx] = new_sl; is_state_visited()
1573 static int do_check(struct verifier_env *env) do_check() argument
1575 struct verifier_state *state = &env->cur_state; do_check()
1576 struct bpf_insn *insns = env->prog->insnsi; do_check()
1578 int insn_cnt = env->prog->len; do_check()
1605 err = is_state_visited(env, insn_idx); do_check()
1622 print_verifier_state(env); do_check()
1655 err = check_mem_access(env, insn->src_reg, insn->off, do_check()
1689 err = check_xadd(env, insn); do_check()
1711 err = check_mem_access(env, insn->dst_reg, insn->off, do_check()
1729 err = check_mem_access(env, insn->dst_reg, insn->off, do_check()
1747 err = check_call(env, insn->imm); do_check()
1783 insn_idx = pop_stack(env, &prev_insn_idx); do_check()
1791 err = check_cond_jmp_op(env, insn, &insn_idx); do_check()
1799 err = check_ld_abs(env, insn); do_check()
1804 err = check_ld_imm(env, insn); do_check()
1827 static int replace_map_fd_with_map_ptr(struct verifier_env *env) replace_map_fd_with_map_ptr() argument
1829 struct bpf_insn *insn = env->prog->insnsi; replace_map_fd_with_map_ptr()
1830 int insn_cnt = env->prog->len; replace_map_fd_with_map_ptr()
1876 for (j = 0; j < env->used_map_cnt; j++) replace_map_fd_with_map_ptr()
1877 if (env->used_maps[j] == map) { replace_map_fd_with_map_ptr()
1882 if (env->used_map_cnt >= MAX_USED_MAPS) { replace_map_fd_with_map_ptr()
1888 env->used_maps[env->used_map_cnt++] = map; replace_map_fd_with_map_ptr()
1912 static void release_maps(struct verifier_env *env) release_maps() argument
1916 for (i = 0; i < env->used_map_cnt; i++) release_maps()
1917 bpf_map_put(env->used_maps[i]); release_maps()
1921 static void convert_pseudo_ld_imm64(struct verifier_env *env) convert_pseudo_ld_imm64() argument
1923 struct bpf_insn *insn = env->prog->insnsi; convert_pseudo_ld_imm64()
1924 int insn_cnt = env->prog->len; convert_pseudo_ld_imm64()
1955 static int convert_ctx_accesses(struct verifier_env *env) convert_ctx_accesses() argument
1957 struct bpf_insn *insn = env->prog->insnsi; convert_ctx_accesses()
1958 int insn_cnt = env->prog->len; convert_ctx_accesses()
1964 if (!env->prog->aux->ops->convert_ctx_access) convert_ctx_accesses()
1977 cnt = env->prog->aux->ops-> convert_ctx_accesses()
1992 new_prog = bpf_prog_realloc(env->prog, convert_ctx_accesses()
2010 env->prog = new_prog; convert_ctx_accesses()
2018 static void free_states(struct verifier_env *env) free_states() argument
2023 if (!env->explored_states) free_states()
2026 for (i = 0; i < env->prog->len; i++) { free_states()
2027 sl = env->explored_states[i]; free_states()
2037 kfree(env->explored_states); free_states()
2043 struct verifier_env *env; bpf_check() local
2052 env = kzalloc(sizeof(struct verifier_env), GFP_KERNEL); bpf_check()
2053 if (!env) bpf_check()
2056 env->prog = *prog; bpf_check()
2084 ret = replace_map_fd_with_map_ptr(env); bpf_check()
2088 env->explored_states = kcalloc(env->prog->len, bpf_check()
2092 if (!env->explored_states) bpf_check()
2095 ret = check_cfg(env); bpf_check()
2099 ret = do_check(env); bpf_check()
2102 while (pop_stack(env, NULL) >= 0); bpf_check()
2103 free_states(env); bpf_check()
2107 ret = convert_ctx_accesses(env); bpf_check()
2122 if (ret == 0 && env->used_map_cnt) { bpf_check()
2124 env->prog->aux->used_maps = kmalloc_array(env->used_map_cnt, bpf_check()
2125 sizeof(env->used_maps[0]), bpf_check()
2128 if (!env->prog->aux->used_maps) { bpf_check()
2133 memcpy(env->prog->aux->used_maps, env->used_maps, bpf_check()
2134 sizeof(env->used_maps[0]) * env->used_map_cnt); bpf_check()
2135 env->prog->aux->used_map_cnt = env->used_map_cnt; bpf_check()
2140 convert_pseudo_ld_imm64(env); bpf_check()
2147 if (!env->prog->aux->used_maps) bpf_check()
2151 release_maps(env); bpf_check()
2152 *prog = env->prog; bpf_check()
2153 kfree(env); bpf_check()
/linux-4.1.27/arch/x86/kernel/
H A Di387.c487 convert_from_fxsr(struct user_i387_ia32_struct *env, struct task_struct *tsk) convert_from_fxsr() argument
490 struct _fpreg *to = (struct _fpreg *) &env->st_space[0]; convert_from_fxsr()
494 env->cwd = fxsave->cwd | 0xffff0000u; convert_from_fxsr()
495 env->swd = fxsave->swd | 0xffff0000u; convert_from_fxsr()
496 env->twd = twd_fxsr_to_i387(fxsave); convert_from_fxsr()
499 env->fip = fxsave->rip; convert_from_fxsr()
500 env->foo = fxsave->rdp; convert_from_fxsr()
505 env->fcs = task_pt_regs(tsk)->cs; convert_from_fxsr()
507 savesegment(ds, env->fos); convert_from_fxsr()
509 env->fos = tsk->thread.ds; convert_from_fxsr()
511 env->fos |= 0xffff0000; convert_from_fxsr()
513 env->fip = fxsave->fip; convert_from_fxsr()
514 env->fcs = (u16) fxsave->fcs | ((u32) fxsave->fop << 16); convert_from_fxsr()
515 env->foo = fxsave->foo; convert_from_fxsr()
516 env->fos = fxsave->fos; convert_from_fxsr()
524 const struct user_i387_ia32_struct *env) convert_to_fxsr()
528 struct _fpreg *from = (struct _fpreg *) &env->st_space[0]; convert_to_fxsr()
532 fxsave->cwd = env->cwd; convert_to_fxsr()
533 fxsave->swd = env->swd; convert_to_fxsr()
534 fxsave->twd = twd_i387_to_fxsr(env->twd); convert_to_fxsr()
535 fxsave->fop = (u16) ((u32) env->fcs >> 16); convert_to_fxsr()
537 fxsave->rip = env->fip; convert_to_fxsr()
538 fxsave->rdp = env->foo; convert_to_fxsr()
541 fxsave->fip = env->fip; convert_to_fxsr()
542 fxsave->fcs = (env->fcs & 0xffff); convert_to_fxsr()
543 fxsave->foo = env->foo; convert_to_fxsr()
544 fxsave->fos = env->fos; convert_to_fxsr()
555 struct user_i387_ia32_struct env; fpregs_get() local
572 if (kbuf && pos == 0 && count == sizeof(env)) { fpregs_get()
577 convert_from_fxsr(&env, target); fpregs_get()
579 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, &env, 0, -1); fpregs_get()
586 struct user_i387_ia32_struct env; fpregs_set() local
603 if (pos > 0 || count < sizeof(env)) fpregs_set()
604 convert_from_fxsr(&env, target); fpregs_set()
606 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf, &env, 0, -1); fpregs_set()
608 convert_to_fxsr(target, &env); fpregs_set()
523 convert_to_fxsr(struct task_struct *tsk, const struct user_i387_ia32_struct *env) convert_to_fxsr() argument
H A Dxsave.c143 struct user_i387_ia32_struct env; save_fsave_header() local
146 convert_from_fxsr(&env, tsk); save_fsave_header()
148 if (__copy_to_user(buf, &env, sizeof(env)) || save_fsave_header()
383 struct user_i387_ia32_struct env; __restore_xstate_sig() local
397 __copy_from_user(&env, buf, sizeof(env))) { __restore_xstate_sig()
401 sanitize_restored_xstate(tsk, &env, xstate_bv, fx_only); __restore_xstate_sig()
/linux-4.1.27/drivers/staging/lustre/lustre/obdecho/
H A Decho_client.c96 static int echo_client_setup(const struct lu_env *env,
146 static inline struct echo_thread_info *echo_env_info(const struct lu_env *env) echo_env_info() argument
150 info = lu_context_key_get(&env->le_ctx, &echo_thread_key); echo_env_info()
172 static struct echo_thread_info *echo_env_info(const struct lu_env *env);
227 static struct page *echo_page_vmpage(const struct lu_env *env, echo_page_vmpage() argument
233 static int echo_page_own(const struct lu_env *env, echo_page_own() argument
246 static void echo_page_disown(const struct lu_env *env, echo_page_disown() argument
256 static void echo_page_discard(const struct lu_env *env, echo_page_discard() argument
260 cl_page_delete(env, slice->cpl_page); echo_page_discard()
263 static int echo_page_is_vmlocked(const struct lu_env *env, echo_page_is_vmlocked() argument
271 static void echo_page_completion(const struct lu_env *env, echo_page_completion() argument
278 static void echo_page_fini(const struct lu_env *env, echo_page_fini() argument
289 static int echo_page_prep(const struct lu_env *env, echo_page_prep() argument
296 static int echo_page_print(const struct lu_env *env, echo_page_print() argument
302 (*printer)(env, cookie, LUSTRE_ECHO_CLIENT_NAME"-page@%p %d vm@%p\n", echo_page_print()
334 static void echo_lock_fini(const struct lu_env *env, echo_lock_fini() argument
343 static void echo_lock_delete(const struct lu_env *env, echo_lock_delete() argument
351 static int echo_lock_fits_into(const struct lu_env *env, echo_lock_fits_into() argument
373 static int echo_page_init(const struct lu_env *env, struct cl_object *obj, echo_page_init() argument
387 static int echo_io_init(const struct lu_env *env, struct cl_object *obj, echo_io_init() argument
393 static int echo_lock_init(const struct lu_env *env, echo_lock_init() argument
409 static int echo_conf_set(const struct lu_env *env, struct cl_object *obj, echo_conf_set() argument
429 static int echo_object_init(const struct lu_env *env, struct lu_object *obj, echo_object_init() argument
443 below = under->ld_ops->ldo_object_alloc(env, obj->lo_header, echo_object_init()
516 static void echo_object_free(const struct lu_env *env, struct lu_object *obj) echo_object_free() argument
535 static int echo_object_print(const struct lu_env *env, void *cookie, echo_object_print() argument
540 return (*p)(env, cookie, "echoclient-object@%p", obj); echo_object_print()
559 static struct lu_object *echo_object_alloc(const struct lu_env *env, echo_object_alloc() argument
598 static int echo_site_init(const struct lu_env *env, struct echo_device *ed) echo_site_init() argument
618 static void echo_site_fini(const struct lu_env *env, struct echo_device *ed) echo_site_fini() argument
690 static struct lu_device *echo_device_alloc(const struct lu_env *env, echo_device_alloc() argument
721 LASSERT(env != NULL); echo_device_alloc()
738 rc = echo_site_init(env, ed); echo_device_alloc()
744 rc = echo_client_setup(env, obd, cfg); echo_device_alloc()
765 rc = next->ld_type->ldt_ops->ldto_device_init(env, next, echo_device_alloc()
797 echo_site_fini(env, ed); echo_device_alloc()
809 static int echo_device_init(const struct lu_env *env, struct lu_device *d, echo_device_init() argument
816 static struct lu_device *echo_device_fini(const struct lu_env *env, echo_device_fini() argument
823 next = next->ld_type->ldt_ops->ldto_device_fini(env, next); echo_device_fini()
827 static void echo_lock_release(const struct lu_env *env, echo_lock_release() argument
834 cl_unuse(env, clk); echo_lock_release()
835 cl_lock_release(env, clk, "ec enqueue", ecl->el_object); echo_lock_release()
837 cl_lock_mutex_get(env, clk); echo_lock_release()
838 cl_lock_cancel(env, clk); echo_lock_release()
839 cl_lock_delete(env, clk); echo_lock_release()
840 cl_lock_mutex_put(env, clk); echo_lock_release()
842 cl_lock_put(env, clk); echo_lock_release()
845 static struct lu_device *echo_device_free(const struct lu_env *env, echo_device_free() argument
856 lu_site_purge(env, &ed->ed_site->cs_lu, -1); echo_device_free()
869 lu_site_purge(env, &ed->ed_site->cs_lu, -1); echo_device_free()
881 lu_site_purge(env, &ed->ed_site->cs_lu, -1); echo_device_free()
893 next = next->ld_type->ldt_ops->ldto_device_free(env, next); echo_device_free()
896 echo_site_fini(env, ed); echo_device_free()
935 struct lu_env *env; cl_echo_object_find() local
956 env = cl_env_get(&refcheck); cl_echo_object_find()
957 if (IS_ERR(env)) cl_echo_object_find()
958 return (void *)env; cl_echo_object_find()
960 info = echo_env_info(env); cl_echo_object_find()
990 obj = cl_object_find(env, echo_dev2cl(d), fid, &conf->eoc_cl); cl_echo_object_find()
998 cl_object_put(env, obj); cl_echo_object_find()
1003 cl_env_put(env, &refcheck); cl_echo_object_find()
1009 struct lu_env *env; cl_echo_object_put() local
1013 env = cl_env_get(&refcheck); cl_echo_object_put()
1014 if (IS_ERR(env)) cl_echo_object_put()
1015 return PTR_ERR(env); cl_echo_object_put()
1025 cl_object_put(env, obj); cl_echo_object_put()
1026 cl_env_put(env, &refcheck); cl_echo_object_put()
1030 static int cl_echo_enqueue0(struct lu_env *env, struct echo_object *eco, cl_echo_enqueue0() argument
1041 info = echo_env_info(env); cl_echo_enqueue0()
1053 lck = cl_lock_request(env, io, descr, "ec enqueue", eco); cl_echo_enqueue0()
1058 rc = cl_wait(env, lck); cl_echo_enqueue0()
1070 cl_lock_release(env, lck, "ec enqueue", current); cl_echo_enqueue0()
1080 struct lu_env *env; cl_echo_enqueue() local
1085 env = cl_env_get(&refcheck); cl_echo_enqueue()
1086 if (IS_ERR(env)) cl_echo_enqueue()
1087 return PTR_ERR(env); cl_echo_enqueue()
1089 info = echo_env_info(env); cl_echo_enqueue()
1093 result = cl_io_init(env, io, CIT_MISC, echo_obj2cl(eco)); cl_echo_enqueue()
1098 result = cl_echo_enqueue0(env, eco, start, end, mode, cookie, 0); cl_echo_enqueue()
1099 cl_io_fini(env, io); cl_echo_enqueue()
1102 cl_env_put(env, &refcheck); cl_echo_enqueue()
1106 static int cl_echo_cancel0(struct lu_env *env, struct echo_device *ed, cl_echo_cancel0() argument
1133 echo_lock_release(env, ecl, still_used); cl_echo_cancel0()
1139 struct lu_env *env; cl_echo_cancel() local
1143 env = cl_env_get(&refcheck); cl_echo_cancel()
1144 if (IS_ERR(env)) cl_echo_cancel()
1145 return PTR_ERR(env); cl_echo_cancel()
1147 rc = cl_echo_cancel0(env, ed, cookie); cl_echo_cancel()
1149 cl_env_put(env, &refcheck); cl_echo_cancel()
1153 static int cl_echo_async_brw(const struct lu_env *env, struct cl_io *io, cl_echo_async_brw() argument
1163 rc = cl_page_cache_add(env, io, clp, CRT_WRITE); cl_echo_async_brw()
1174 struct lu_env *env; cl_echo_object_brw() local
1189 env = cl_env_get(&refcheck); cl_echo_object_brw()
1190 if (IS_ERR(env)) cl_echo_object_brw()
1191 return PTR_ERR(env); cl_echo_object_brw()
1193 info = echo_env_info(env); cl_echo_object_brw()
1200 rc = cl_io_init(env, io, CIT_MISC, obj); cl_echo_object_brw()
1206 rc = cl_echo_enqueue0(env, eco, offset, cl_echo_object_brw()
1215 clp = cl_page_find(env, obj, cl_index(obj, offset), cl_echo_object_brw()
1223 rc = cl_page_own(env, io, clp); cl_echo_object_brw()
1226 cl_page_put(env, clp); cl_echo_object_brw()
1234 cl_page_put(env, clp); cl_echo_object_brw()
1235 cl_page_clip(env, clp, 0, page_size); cl_echo_object_brw()
1245 rc = cl_echo_async_brw(env, io, typ, queue); cl_echo_object_brw()
1247 rc = cl_io_submit_sync(env, io, typ, queue, 0); cl_echo_object_brw()
1252 cl_echo_cancel0(env, ed, lh.cookie); cl_echo_object_brw()
1254 cl_2queue_discard(env, io, queue); cl_echo_object_brw()
1255 cl_2queue_disown(env, io, queue); cl_echo_object_brw()
1256 cl_2queue_fini(env, queue); cl_echo_object_brw()
1257 cl_io_fini(env, io); cl_echo_object_brw()
1259 cl_env_put(env, &refcheck); cl_echo_object_brw()
1320 static int echo_create_object(const struct lu_env *env, struct echo_device *ed, echo_create_object() argument
1382 rc = obd_create(env, ec->ec_exp, oa, &lsm, oti); echo_create_object()
1405 obd_destroy(env, ec->ec_exp, oa, lsm, oti, NULL, NULL); echo_create_object()
1642 static int echo_client_prep_commit(const struct lu_env *env, echo_client_prep_commit() argument
1695 ret = obd_preprw(env, rw, exp, oa, 1, &ioo, rnb, &lpages, echo_client_prep_commit()
1728 ret = obd_commitrw(env, rw, exp, oa, 1, &ioo, echo_client_prep_commit()
1736 /* Reuse env context. */ echo_client_prep_commit()
1737 lu_context_exit((struct lu_context *)&env->le_ctx); echo_client_prep_commit()
1738 lu_context_enter((struct lu_context *)&env->le_ctx); echo_client_prep_commit()
1749 static int echo_client_brw_ioctl(const struct lu_env *env, int rw, echo_client_brw_ioctl() argument
1794 rc = echo_client_prep_commit(env, ec->ec_exp, rw, oa, echo_client_brw_ioctl()
1863 struct lu_env *env; echo_client_iocontrol() local
1884 OBD_ALLOC_PTR(env); echo_client_iocontrol()
1885 if (env == NULL) echo_client_iocontrol()
1888 rc = lu_env_init(env, LCT_DT_THREAD); echo_client_iocontrol()
1901 rc = echo_create_object(env, ed, 1, oa, data->ioc_pbuf1, echo_client_iocontrol()
1913 rc = obd_destroy(env, ec->ec_exp, oa, eco->eo_lsm, echo_client_iocontrol()
1928 rc = obd_getattr(env, ec->ec_exp, &oinfo); echo_client_iocontrol()
1946 rc = obd_setattr(env, ec->ec_exp, &oinfo, NULL); echo_client_iocontrol()
1960 rc = echo_client_brw_ioctl(env, rw, exp, data, &dummy_oti); echo_client_iocontrol()
1985 rc = echo_create_object(env, ed, 0, oa, echo_client_iocontrol()
2014 lu_env_fini(env); echo_client_iocontrol()
2015 OBD_FREE_PTR(env); echo_client_iocontrol()
2028 static int echo_client_setup(const struct lu_env *env, echo_client_setup() argument
2071 rc = obd_connect(env, &ec->ec_exp, tgt, &echo_uuid, ocd, NULL); echo_client_setup()
2108 static int echo_client_connect(const struct lu_env *env, echo_client_connect() argument
/linux-4.1.27/drivers/of/
H A Ddevice.c219 void of_device_uevent(struct device *dev, struct kobj_uevent_env *env) of_device_uevent() argument
228 add_uevent_var(env, "OF_NAME=%s", dev->of_node->name); of_device_uevent()
229 add_uevent_var(env, "OF_FULLNAME=%s", dev->of_node->full_name); of_device_uevent()
231 add_uevent_var(env, "OF_TYPE=%s", dev->of_node->type); of_device_uevent()
238 add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat); of_device_uevent()
244 add_uevent_var(env, "OF_COMPATIBLE_N=%d", seen); of_device_uevent()
250 add_uevent_var(env, "OF_ALIAS_%d=%s", seen, of_device_uevent()
258 int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env) of_device_uevent_modalias() argument
266 if (add_uevent_var(env, "MODALIAS=")) of_device_uevent_modalias()
269 sl = of_device_get_modalias(dev, &env->buf[env->buflen-1], of_device_uevent_modalias()
270 sizeof(env->buf) - env->buflen); of_device_uevent_modalias()
271 if (sl >= (sizeof(env->buf) - env->buflen)) of_device_uevent_modalias()
273 env->buflen += sl; of_device_uevent_modalias()
/linux-4.1.27/tools/perf/util/
H A Dpager.c93 const char *env; pager_in_use() local
98 env = getenv("PERF_PAGER_IN_USE"); pager_in_use()
99 return env ? perf_config_bool("PERF_PAGER_IN_USE", env) : 0; pager_in_use()
H A Dexec_cmd.c57 const char *env; perf_exec_path() local
62 env = getenv(EXEC_PATH_ENVIRONMENT); perf_exec_path()
63 if (env && *env) { perf_exec_path()
64 return env; perf_exec_path()
H A Drun-command.c105 if (cmd->env) { start_command()
106 for (; *cmd->env; cmd->env++) { start_command()
107 if (strchr(*cmd->env, '=')) start_command()
108 putenv((char*)*cmd->env); start_command()
110 unsetenv(*cmd->env); start_command()
H A Dheader.c875 fprintf(fp, "# hostname : %s\n", ph->env.hostname); print_hostname()
881 fprintf(fp, "# os release : %s\n", ph->env.os_release); print_osrelease()
886 fprintf(fp, "# arch : %s\n", ph->env.arch); print_arch()
892 fprintf(fp, "# cpudesc : %s\n", ph->env.cpu_desc); print_cpudesc()
898 fprintf(fp, "# nrcpus online : %u\n", ph->env.nr_cpus_online); print_nrcpus()
899 fprintf(fp, "# nrcpus avail : %u\n", ph->env.nr_cpus_avail); print_nrcpus()
905 fprintf(fp, "# perf version : %s\n", ph->env.version); print_version()
914 nr = ph->env.nr_cmdline; print_cmdline()
915 str = ph->env.cmdline; print_cmdline()
932 nr = ph->env.nr_sibling_cores; print_cpu_topology()
933 str = ph->env.sibling_cores; print_cpu_topology()
940 nr = ph->env.nr_sibling_threads; print_cpu_topology()
941 str = ph->env.sibling_threads; print_cpu_topology()
1099 fprintf(fp, "# total memory : %Lu kB\n", ph->env.total_mem); print_total_mem()
1110 nr = ph->env.nr_numa_nodes; print_numa_topology()
1111 str = ph->env.numa_nodes; print_numa_topology()
1145 fprintf(fp, "# cpuid : %s\n", ph->env.cpuid); print_cpuid()
1162 pmu_num = ph->env.nr_pmu_mappings; print_pmu_mappings()
1168 str = ph->env.pmu_mappings; print_pmu_mappings()
1387 ph->env.hostname = do_read_string(fd, ph); process_hostname()
1388 return ph->env.hostname ? 0 : -ENOMEM; process_hostname()
1395 ph->env.os_release = do_read_string(fd, ph); process_osrelease()
1396 return ph->env.os_release ? 0 : -ENOMEM; process_osrelease()
1403 ph->env.version = do_read_string(fd, ph); process_version()
1404 return ph->env.version ? 0 : -ENOMEM; process_version()
1411 ph->env.arch = do_read_string(fd, ph); process_arch()
1412 return ph->env.arch ? 0 : -ENOMEM; process_arch()
1429 ph->env.nr_cpus_avail = nr; process_nrcpus()
1438 ph->env.nr_cpus_online = nr; process_nrcpus()
1446 ph->env.cpu_desc = do_read_string(fd, ph); process_cpudesc()
1447 return ph->env.cpu_desc ? 0 : -ENOMEM; process_cpudesc()
1454 ph->env.cpuid = do_read_string(fd, ph); process_cpuid()
1455 return ph->env.cpuid ? 0 : -ENOMEM; process_cpuid()
1472 ph->env.total_mem = mem; process_total_mem()
1544 ph->env.nr_cmdline = nr; process_cmdline()
1556 ph->env.cmdline = strbuf_detach(&sb, NULL); process_cmdline()
1580 ph->env.nr_sibling_cores = nr; process_cpu_topology()
1592 ph->env.sibling_cores = strbuf_detach(&sb, NULL); process_cpu_topology()
1601 ph->env.nr_sibling_threads = nr; process_cpu_topology()
1612 ph->env.sibling_threads = strbuf_detach(&sb, NULL); process_cpu_topology()
1638 ph->env.nr_numa_nodes = nr; process_numa_topology()
1672 ph->env.numa_nodes = strbuf_detach(&sb, NULL); process_numa_topology()
1702 ph->env.nr_pmu_mappings = pmu_num; process_pmu_mappings()
1722 ph->env.pmu_mappings = strbuf_detach(&sb, NULL); process_pmu_mappings()
1750 ph->env.nr_groups = nr_groups; process_group_desc()
H A Drun-command.h40 const char *const *env; member in struct:child_process
H A Dsession.c170 static void perf_session_env__delete(struct perf_session_env *env) perf_session_env__delete() argument
172 zfree(&env->hostname); perf_session_env__delete()
173 zfree(&env->os_release); perf_session_env__delete()
174 zfree(&env->version); perf_session_env__delete()
175 zfree(&env->arch); perf_session_env__delete()
176 zfree(&env->cpu_desc); perf_session_env__delete()
177 zfree(&env->cpuid); perf_session_env__delete()
179 zfree(&env->cmdline); perf_session_env__delete()
180 zfree(&env->sibling_cores); perf_session_env__delete()
181 zfree(&env->sibling_threads); perf_session_env__delete()
182 zfree(&env->numa_nodes); perf_session_env__delete()
183 zfree(&env->pmu_mappings); perf_session_env__delete()
190 perf_session_env__delete(&session->header.env); perf_session__delete()
H A Dheader.h99 struct perf_session_env env; member in struct:perf_header
H A Dhist.h315 struct perf_session_env *env);
323 struct perf_session_env *env __maybe_unused) perf_evlist__tui_browse_hists()
H A Ddata-convert-bt.c619 ADD("host", header->env.hostname); ctf_writer__setup_env()
621 ADD("release", header->env.os_release); ctf_writer__setup_env()
622 ADD("version", header->env.version); ctf_writer__setup_env()
623 ADD("machine", header->env.arch); ctf_writer__setup_env()
829 /* CTF writer env/clock setup */ bt_convert__perf2ctf()
H A Dsymbol.h257 int symbol__init(struct perf_session_env *env);
H A Dsymbol.c1809 static int vmlinux_path__init(struct perf_session_env *env) vmlinux_path__init() argument
1832 if (env) { vmlinux_path__init()
1833 kernel_version = env->os_release; vmlinux_path__init()
1920 int symbol__init(struct perf_session_env *env) symbol__init() argument
1935 if (symbol_conf.try_vmlinux_path && vmlinux_path__init(env) < 0) symbol__init()
/linux-4.1.27/drivers/firmware/
H A Ddmi-id.c148 static int dmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env) dmi_dev_uevent() argument
152 if (add_uevent_var(env, "MODALIAS=")) dmi_dev_uevent()
154 len = get_modalias(&env->buf[env->buflen - 1], dmi_dev_uevent()
155 sizeof(env->buf) - env->buflen); dmi_dev_uevent()
156 if (len >= (sizeof(env->buf) - env->buflen)) dmi_dev_uevent()
158 env->buflen += len; dmi_dev_uevent()
/linux-4.1.27/sound/aoa/soundbus/
H A Dcore.c59 static int soundbus_uevent(struct device *dev, struct kobj_uevent_env *env) soundbus_uevent() argument
77 retval = add_uevent_var(env, "OF_NAME=%s", of->dev.of_node->name); soundbus_uevent()
81 retval = add_uevent_var(env, "OF_TYPE=%s", of->dev.of_node->type); soundbus_uevent()
91 int tmp = env->buflen; soundbus_uevent()
92 retval = add_uevent_var(env, "OF_COMPATIBLE_%d=%s", seen, compat); soundbus_uevent()
95 compat += env->buflen - tmp; soundbus_uevent()
96 cplen -= env->buflen - tmp; soundbus_uevent()
100 retval = add_uevent_var(env, "OF_COMPATIBLE_N=%d", seen); soundbus_uevent()
103 retval = add_uevent_var(env, "MODALIAS=%s", soundbus_dev->modalias); soundbus_uevent()
/linux-4.1.27/drivers/hwmon/
H A Dultra45_env.c60 struct env { struct
67 static u8 env_read(struct env *p, u8 ireg) env_read()
79 static void env_write(struct env *p, u8 ireg, u8 val) env_write()
100 struct env *p = dev_get_drvdata(dev); show_fan_speed()
119 struct env *p = dev_get_drvdata(dev); set_fan_speed()
142 struct env *p = dev_get_drvdata(dev); show_fan_fault()
165 struct env *p = dev_get_drvdata(dev); show_temp()
186 struct env *p = dev_get_drvdata(dev); show_stat_bit()
202 struct env *p = dev_get_drvdata(dev); show_fwver()
255 struct env *p = devm_kzalloc(&op->dev, sizeof(*p), GFP_KERNEL); env_probe()
294 struct env *p = platform_get_drvdata(op); env_remove()
307 .name = "env-monitor",
308 .compatible = "SUNW,ebus-pic16f747-env",
/linux-4.1.27/arch/mips/fw/arc/
H A Denv.c6 * env.c: ARCS environment variable routines.
/linux-4.1.27/include/linux/
H A Dof_device.h39 extern void of_device_uevent(struct device *dev, struct kobj_uevent_env *env);
40 extern int of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env);
66 struct kobj_uevent_env *env) { }
75 struct kobj_uevent_env *env) of_device_uevent_modalias()
65 of_device_uevent(struct device *dev, struct kobj_uevent_env *env) of_device_uevent() argument
74 of_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env) of_device_uevent_modalias() argument
H A Dkobject.h32 #define UEVENT_NUM_ENVP 32 /* number of env pointers */
50 * kobject_uevent_env(kobj, KOBJ_CHANGE, env) with additional event
135 struct kobj_uevent_env *env);
219 int add_uevent_var(struct kobj_uevent_env *env, const char *format, ...);
/linux-4.1.27/arch/x86/um/
H A Dsignal.c85 unsigned long env[7]; convert_fxsr_to_user() local
90 env[0] = (unsigned long)fxsave->cwd | 0xffff0000ul; convert_fxsr_to_user()
91 env[1] = (unsigned long)fxsave->swd | 0xffff0000ul; convert_fxsr_to_user()
92 env[2] = twd_fxsr_to_i387(fxsave); convert_fxsr_to_user()
93 env[3] = fxsave->fip; convert_fxsr_to_user()
94 env[4] = fxsave->fcs | ((unsigned long)fxsave->fop << 16); convert_fxsr_to_user()
95 env[5] = fxsave->foo; convert_fxsr_to_user()
96 env[6] = fxsave->fos; convert_fxsr_to_user()
98 if (__copy_to_user(buf, env, 7 * sizeof(unsigned long))) convert_fxsr_to_user()
118 unsigned long env[7]; convert_fxsr_from_user() local
123 if (copy_from_user( env, buf, 7 * sizeof(long))) convert_fxsr_from_user()
126 fxsave->cwd = (unsigned short)(env[0] & 0xffff); convert_fxsr_from_user()
127 fxsave->swd = (unsigned short)(env[1] & 0xffff); convert_fxsr_from_user()
128 fxsave->twd = twd_i387_to_fxsr((unsigned short)(env[2] & 0xffff)); convert_fxsr_from_user()
129 fxsave->fip = env[3]; convert_fxsr_from_user()
130 fxsave->fop = (unsigned short)((env[4] & 0xffff0000ul) >> 16); convert_fxsr_from_user()
131 fxsave->fcs = (env[4] & 0xffff); convert_fxsr_from_user()
132 fxsave->foo = env[5]; convert_fxsr_from_user()
133 fxsave->fos = env[6]; convert_fxsr_from_user()
/linux-4.1.27/kernel/sched/
H A Dfair.c1185 static void task_numa_assign(struct task_numa_env *env, task_numa_assign() argument
1188 if (env->best_task) task_numa_assign()
1189 put_task_struct(env->best_task); task_numa_assign()
1193 env->best_task = p; task_numa_assign()
1194 env->best_imp = imp; task_numa_assign()
1195 env->best_cpu = env->dst_cpu; task_numa_assign()
1199 struct task_numa_env *env) load_too_imbalanced()
1214 src_capacity = env->src_stats.compute_capacity; load_too_imbalanced()
1215 dst_capacity = env->dst_stats.compute_capacity; load_too_imbalanced()
1225 load_b * dst_capacity * env->imbalance_pct; load_too_imbalanced()
1234 orig_src_load = env->src_stats.load; load_too_imbalanced()
1259 static void task_numa_compare(struct task_numa_env *env, task_numa_compare() argument
1262 struct rq *src_rq = cpu_rq(env->src_cpu); task_numa_compare()
1263 struct rq *dst_rq = cpu_rq(env->dst_cpu); task_numa_compare()
1267 long imp = env->p->numa_group ? groupimp : taskimp; task_numa_compare()
1269 int dist = env->dist; task_numa_compare()
1288 * end try selecting ourselves (current == env->p) as a swap candidate. task_numa_compare()
1290 if (cur == env->p) task_numa_compare()
1302 if (!cpumask_test_cpu(env->src_cpu, tsk_cpus_allowed(cur))) task_numa_compare()
1309 if (cur->numa_group == env->p->numa_group) { task_numa_compare()
1310 imp = taskimp + task_weight(cur, env->src_nid, dist) - task_numa_compare()
1311 task_weight(cur, env->dst_nid, dist); task_numa_compare()
1325 imp += group_weight(cur, env->src_nid, dist) - task_numa_compare()
1326 group_weight(cur, env->dst_nid, dist); task_numa_compare()
1328 imp += task_weight(cur, env->src_nid, dist) - task_numa_compare()
1329 task_weight(cur, env->dst_nid, dist); task_numa_compare()
1333 if (imp <= env->best_imp && moveimp <= env->best_imp) task_numa_compare()
1338 if (env->src_stats.nr_running <= env->src_stats.task_capacity && task_numa_compare()
1339 !env->dst_stats.has_free_capacity) task_numa_compare()
1346 if (imp > env->best_imp && src_rq->nr_running == 1 && task_numa_compare()
1354 load = task_h_load(env->p); task_numa_compare()
1355 dst_load = env->dst_stats.load + load; task_numa_compare()
1356 src_load = env->src_stats.load - load; task_numa_compare()
1358 if (moveimp > imp && moveimp > env->best_imp) { task_numa_compare()
1360 * If the improvement from just moving env->p direction is task_numa_compare()
1365 if (!load_too_imbalanced(src_load, dst_load, env)) { task_numa_compare()
1372 if (imp <= env->best_imp) task_numa_compare()
1381 if (load_too_imbalanced(src_load, dst_load, env)) task_numa_compare()
1389 env->dst_cpu = select_idle_sibling(env->p, env->dst_cpu); task_numa_compare()
1392 task_numa_assign(env, cur, imp); task_numa_compare()
1397 static void task_numa_find_cpu(struct task_numa_env *env, task_numa_find_cpu() argument
1402 for_each_cpu(cpu, cpumask_of_node(env->dst_nid)) { for_each_cpu()
1404 if (!cpumask_test_cpu(cpu, tsk_cpus_allowed(env->p))) for_each_cpu()
1407 env->dst_cpu = cpu; for_each_cpu()
1408 task_numa_compare(env, taskimp, groupimp); for_each_cpu()
1414 struct task_numa_env env = { task_numa_migrate() local
1440 sd = rcu_dereference(per_cpu(sd_numa, env.src_cpu)); task_numa_migrate()
1442 env.imbalance_pct = 100 + (sd->imbalance_pct - 100) / 2; task_numa_migrate()
1456 env.dst_nid = p->numa_preferred_nid; task_numa_migrate()
1457 dist = env.dist = node_distance(env.src_nid, env.dst_nid); task_numa_migrate()
1458 taskweight = task_weight(p, env.src_nid, dist); task_numa_migrate()
1459 groupweight = group_weight(p, env.src_nid, dist); task_numa_migrate()
1460 update_numa_stats(&env.src_stats, env.src_nid); task_numa_migrate()
1461 taskimp = task_weight(p, env.dst_nid, dist) - taskweight; task_numa_migrate()
1462 groupimp = group_weight(p, env.dst_nid, dist) - groupweight; task_numa_migrate()
1463 update_numa_stats(&env.dst_stats, env.dst_nid); task_numa_migrate()
1466 task_numa_find_cpu(&env, taskimp, groupimp); task_numa_migrate()
1475 if (env.best_cpu == -1 || (p->numa_group && task_numa_migrate()
1478 if (nid == env.src_nid || nid == p->numa_preferred_nid) for_each_online_node()
1481 dist = node_distance(env.src_nid, env.dst_nid); for_each_online_node()
1483 dist != env.dist) { for_each_online_node()
1484 taskweight = task_weight(p, env.src_nid, dist); for_each_online_node()
1485 groupweight = group_weight(p, env.src_nid, dist); for_each_online_node()
1494 env.dist = dist; for_each_online_node()
1495 env.dst_nid = nid; for_each_online_node()
1496 update_numa_stats(&env.dst_stats, env.dst_nid); for_each_online_node()
1497 task_numa_find_cpu(&env, taskimp, groupimp); for_each_online_node()
1510 if (env.best_cpu == -1)
1511 nid = env.src_nid;
1513 nid = env.dst_nid;
1516 sched_setnuma(p, env.dst_nid);
1520 if (env.best_cpu == -1)
1529 if (env.best_task == NULL) {
1530 ret = migrate_task_to(p, env.best_cpu);
1532 trace_sched_stick_numa(p, env.src_cpu, env.best_cpu);
1536 ret = migrate_swap(p, env.best_task);
1538 trace_sched_stick_numa(p, env.src_cpu, task_cpu(env.best_task));
1539 put_task_struct(env.best_task);
5442 static int task_hot(struct task_struct *p, struct lb_env *env) task_hot() argument
5446 lockdep_assert_held(&env->src_rq->lock); task_hot()
5457 if (sched_feat(CACHE_HOT_BUDDY) && env->dst_rq->nr_running && task_hot()
5467 delta = rq_clock_task(env->src_rq) - p->se.exec_start; task_hot()
5474 static bool migrate_improves_locality(struct task_struct *p, struct lb_env *env) migrate_improves_locality() argument
5480 !(env->sd->flags & SD_NUMA)) { migrate_improves_locality()
5484 src_nid = cpu_to_node(env->src_cpu); migrate_improves_locality()
5485 dst_nid = cpu_to_node(env->dst_cpu); migrate_improves_locality()
5510 static bool migrate_degrades_locality(struct task_struct *p, struct lb_env *env) migrate_degrades_locality() argument
5518 if (!p->numa_faults || !(env->sd->flags & SD_NUMA)) migrate_degrades_locality()
5521 src_nid = cpu_to_node(env->src_cpu); migrate_degrades_locality()
5522 dst_nid = cpu_to_node(env->dst_cpu); migrate_degrades_locality()
5548 struct lb_env *env) migrate_improves_locality()
5554 struct lb_env *env) migrate_degrades_locality()
5564 int can_migrate_task(struct task_struct *p, struct lb_env *env) can_migrate_task() argument
5568 lockdep_assert_held(&env->src_rq->lock); can_migrate_task()
5577 if (throttled_lb_pair(task_group(p), env->src_cpu, env->dst_cpu)) can_migrate_task()
5580 if (!cpumask_test_cpu(env->dst_cpu, tsk_cpus_allowed(p))) { can_migrate_task()
5585 env->flags |= LBF_SOME_PINNED; can_migrate_task()
5595 if (!env->dst_grpmask || (env->flags & LBF_DST_PINNED)) can_migrate_task()
5598 /* Prevent to re-select dst_cpu via env's cpus */ can_migrate_task()
5599 for_each_cpu_and(cpu, env->dst_grpmask, env->cpus) { can_migrate_task()
5601 env->flags |= LBF_DST_PINNED; can_migrate_task()
5602 env->new_dst_cpu = cpu; can_migrate_task()
5611 env->flags &= ~LBF_ALL_PINNED; can_migrate_task()
5613 if (task_running(env->src_rq, p)) { can_migrate_task()
5624 tsk_cache_hot = task_hot(p, env); can_migrate_task()
5626 tsk_cache_hot = migrate_degrades_locality(p, env); can_migrate_task()
5628 if (migrate_improves_locality(p, env) || !tsk_cache_hot || can_migrate_task()
5629 env->sd->nr_balance_failed > env->sd->cache_nice_tries) { can_migrate_task()
5631 schedstat_inc(env->sd, lb_hot_gained[env->idle]); can_migrate_task()
5642 * detach_task() -- detach the task for the migration specified in env
5644 static void detach_task(struct task_struct *p, struct lb_env *env) detach_task() argument
5646 lockdep_assert_held(&env->src_rq->lock); detach_task()
5648 deactivate_task(env->src_rq, p, 0); detach_task()
5650 set_task_cpu(p, env->dst_cpu); detach_task()
5654 * detach_one_task() -- tries to dequeue exactly one task from env->src_rq, as
5659 static struct task_struct *detach_one_task(struct lb_env *env) detach_one_task() argument
5663 lockdep_assert_held(&env->src_rq->lock); detach_one_task()
5665 list_for_each_entry_safe(p, n, &env->src_rq->cfs_tasks, se.group_node) { detach_one_task()
5666 if (!can_migrate_task(p, env)) detach_one_task()
5669 detach_task(p, env); detach_one_task()
5673 * lb_gained[env->idle] is updated (other is detach_tasks) detach_one_task()
5677 schedstat_inc(env->sd, lb_gained[env->idle]); detach_one_task()
5691 static int detach_tasks(struct lb_env *env) detach_tasks() argument
5693 struct list_head *tasks = &env->src_rq->cfs_tasks; detach_tasks()
5698 lockdep_assert_held(&env->src_rq->lock); detach_tasks()
5700 if (env->imbalance <= 0) detach_tasks()
5706 env->loop++; detach_tasks()
5708 if (env->loop > env->loop_max) detach_tasks()
5712 if (env->loop > env->loop_break) { detach_tasks()
5713 env->loop_break += sched_nr_migrate_break; detach_tasks()
5714 env->flags |= LBF_NEED_BREAK; detach_tasks()
5718 if (!can_migrate_task(p, env)) detach_tasks()
5723 if (sched_feat(LB_MIN) && load < 16 && !env->sd->nr_balance_failed) detach_tasks()
5726 if ((load / 2) > env->imbalance) detach_tasks()
5729 detach_task(p, env); detach_tasks()
5730 list_add(&p->se.group_node, &env->tasks); detach_tasks()
5733 env->imbalance -= load; detach_tasks()
5741 if (env->idle == CPU_NEWLY_IDLE) detach_tasks()
5749 if (env->imbalance <= 0) detach_tasks()
5762 schedstat_add(env->sd, lb_gained[env->idle], detached); detach_tasks()
5795 static void attach_tasks(struct lb_env *env) attach_tasks() argument
5797 struct list_head *tasks = &env->tasks; attach_tasks()
5800 raw_spin_lock(&env->dst_rq->lock); attach_tasks()
5806 attach_task(env->dst_rq, p); attach_tasks()
5809 raw_spin_unlock(&env->dst_rq->lock); attach_tasks()
6206 group_has_capacity(struct lb_env *env, struct sg_lb_stats *sgs) group_has_capacity() argument
6212 (sgs->group_usage * env->sd->imbalance_pct)) group_has_capacity()
6227 group_is_overloaded(struct lb_env *env, struct sg_lb_stats *sgs) group_is_overloaded() argument
6233 (sgs->group_usage * env->sd->imbalance_pct)) group_is_overloaded()
6239 static enum group_type group_classify(struct lb_env *env, group_classify() argument
6254 * @env: The load balancing environment.
6261 static inline void update_sg_lb_stats(struct lb_env *env, update_sg_lb_stats() argument
6271 for_each_cpu_and(i, sched_group_cpus(group), env->cpus) { for_each_cpu_and()
6305 sgs->group_no_capacity = group_is_overloaded(env, sgs);
6306 sgs->group_type = group_classify(env, group, sgs);
6311 * @env: The load balancing environment.
6322 static bool update_sd_pick_busiest(struct lb_env *env, update_sd_pick_busiest() argument
6339 if (!(env->sd->flags & SD_ASYM_PACKING)) update_sd_pick_busiest()
6347 if (sgs->sum_nr_running && env->dst_cpu < group_first_cpu(sg)) { update_sd_pick_busiest()
6390 * @env: The load balancing environment.
6393 static inline void update_sd_lb_stats(struct lb_env *env, struct sd_lb_stats *sds) update_sd_lb_stats() argument
6395 struct sched_domain *child = env->sd->child; update_sd_lb_stats()
6396 struct sched_group *sg = env->sd->groups; update_sd_lb_stats()
6404 load_idx = get_sd_load_idx(env->sd, env->idle); update_sd_lb_stats()
6410 local_group = cpumask_test_cpu(env->dst_cpu, sched_group_cpus(sg)); update_sd_lb_stats()
6415 if (env->idle != CPU_NEWLY_IDLE || update_sd_lb_stats()
6417 update_group_capacity(env->sd, env->dst_cpu); update_sd_lb_stats()
6420 update_sg_lb_stats(env, sg, load_idx, local_group, sgs, update_sd_lb_stats()
6437 group_has_capacity(env, &sds->local_stat) && update_sd_lb_stats()
6443 if (update_sd_pick_busiest(env, sds, sg, sgs)) { update_sd_lb_stats()
6454 } while (sg != env->sd->groups); update_sd_lb_stats()
6456 if (env->sd->flags & SD_NUMA) update_sd_lb_stats()
6457 env->fbq_type = fbq_classify_group(&sds->busiest_stat); update_sd_lb_stats()
6459 if (!env->sd->parent) { update_sd_lb_stats()
6461 if (env->dst_rq->rd->overload != overload) update_sd_lb_stats()
6462 env->dst_rq->rd->overload = overload; update_sd_lb_stats()
6487 * @env: The load balancing environment.
6490 static int check_asym_packing(struct lb_env *env, struct sd_lb_stats *sds) check_asym_packing() argument
6494 if (!(env->sd->flags & SD_ASYM_PACKING)) check_asym_packing()
6501 if (env->dst_cpu > busiest_cpu) check_asym_packing()
6504 env->imbalance = DIV_ROUND_CLOSEST( check_asym_packing()
6515 * @env: The load balancing environment.
6519 void fix_small_imbalance(struct lb_env *env, struct sd_lb_stats *sds) fix_small_imbalance() argument
6530 local->load_per_task = cpu_avg_load_per_task(env->dst_cpu); fix_small_imbalance()
6540 env->imbalance = busiest->load_per_task; fix_small_imbalance()
6578 env->imbalance = busiest->load_per_task; fix_small_imbalance()
6584 * @env: load balance environment
6587 static inline void calculate_imbalance(struct lb_env *env, struct sd_lb_stats *sds) calculate_imbalance() argument
6611 env->imbalance = 0; calculate_imbalance()
6612 return fix_small_imbalance(env, sds); calculate_imbalance()
6639 env->imbalance = min( calculate_imbalance()
6650 if (env->imbalance < busiest->load_per_task) calculate_imbalance()
6651 return fix_small_imbalance(env, sds); calculate_imbalance()
6666 * @env: The load balancing environment.
6673 static struct sched_group *find_busiest_group(struct lb_env *env) find_busiest_group() argument
6684 update_sd_lb_stats(env, &sds); find_busiest_group()
6689 if ((env->idle == CPU_IDLE || env->idle == CPU_NEWLY_IDLE) && find_busiest_group()
6690 check_asym_packing(env, &sds)) find_busiest_group()
6709 if (env->idle == CPU_NEWLY_IDLE && group_has_capacity(env, local) && find_busiest_group()
6727 if (env->idle == CPU_IDLE) { find_busiest_group()
6744 env->sd->imbalance_pct * local->avg_load) find_busiest_group()
6750 calculate_imbalance(env, &sds); find_busiest_group()
6754 env->imbalance = 0; find_busiest_group()
6761 static struct rq *find_busiest_queue(struct lb_env *env, find_busiest_queue() argument
6768 for_each_cpu_and(i, sched_group_cpus(group), env->cpus) { for_each_cpu_and()
6794 if (rt > env->fbq_type) for_each_cpu_and()
6806 if (rq->nr_running == 1 && wl > env->imbalance && for_each_cpu_and()
6807 !check_cpu_capacity(rq, env->sd)) for_each_cpu_and()
6840 static int need_active_balance(struct lb_env *env) need_active_balance() argument
6842 struct sched_domain *sd = env->sd; need_active_balance()
6844 if (env->idle == CPU_NEWLY_IDLE) { need_active_balance()
6851 if ((sd->flags & SD_ASYM_PACKING) && env->src_cpu > env->dst_cpu) need_active_balance()
6861 if ((env->idle != CPU_NOT_IDLE) && need_active_balance()
6862 (env->src_rq->cfs.h_nr_running == 1)) { need_active_balance()
6863 if ((check_cpu_capacity(env->src_rq, sd)) && need_active_balance()
6864 (capacity_of(env->src_cpu)*sd->imbalance_pct < capacity_of(env->dst_cpu)*100)) need_active_balance()
6873 static int should_we_balance(struct lb_env *env) should_we_balance() argument
6875 struct sched_group *sg = env->sd->groups; should_we_balance()
6883 if (env->idle == CPU_NEWLY_IDLE) should_we_balance()
6889 for_each_cpu_and(cpu, sg_cpus, env->cpus) { should_we_balance()
6904 return balance_cpu == env->dst_cpu; should_we_balance()
6922 struct lb_env env = { load_balance() local
6931 .tasks = LIST_HEAD_INIT(env.tasks), load_balance()
6939 env.dst_grpmask = NULL; load_balance()
6946 if (!should_we_balance(&env)) { load_balance()
6951 group = find_busiest_group(&env); load_balance()
6957 busiest = find_busiest_queue(&env, group); load_balance()
6963 BUG_ON(busiest == env.dst_rq); load_balance()
6965 schedstat_add(sd, lb_imbalance[idle], env.imbalance); load_balance()
6967 env.src_cpu = busiest->cpu; load_balance()
6968 env.src_rq = busiest; load_balance()
6978 env.flags |= LBF_ALL_PINNED; load_balance()
6979 env.loop_max = min(sysctl_sched_nr_migrate, busiest->nr_running); load_balance()
6988 cur_ld_moved = detach_tasks(&env); load_balance()
7001 attach_tasks(&env); load_balance()
7007 if (env.flags & LBF_NEED_BREAK) { load_balance()
7008 env.flags &= ~LBF_NEED_BREAK; load_balance()
7031 if ((env.flags & LBF_DST_PINNED) && env.imbalance > 0) { load_balance()
7033 /* Prevent to re-select dst_cpu via env's cpus */ load_balance()
7034 cpumask_clear_cpu(env.dst_cpu, env.cpus); load_balance()
7036 env.dst_rq = cpu_rq(env.new_dst_cpu); load_balance()
7037 env.dst_cpu = env.new_dst_cpu; load_balance()
7038 env.flags &= ~LBF_DST_PINNED; load_balance()
7039 env.loop = 0; load_balance()
7040 env.loop_break = sched_nr_migrate_break; load_balance()
7055 if ((env.flags & LBF_SOME_PINNED) && env.imbalance > 0) load_balance()
7060 if (unlikely(env.flags & LBF_ALL_PINNED)) { load_balance()
7063 env.loop = 0; load_balance()
7064 env.loop_break = sched_nr_migrate_break; load_balance()
7082 if (need_active_balance(&env)) { load_balance()
7093 env.flags |= LBF_ALL_PINNED; load_balance()
7164 if (((env.flags & LBF_ALL_PINNED) && load_balance()
7348 struct lb_env env = { local
7359 p = detach_one_task(&env);
7592 * env->dst_cpu, so we can't know our idle for_each_domain()
1198 load_too_imbalanced(long src_load, long dst_load, struct task_numa_env *env) load_too_imbalanced() argument
5547 migrate_improves_locality(struct task_struct *p, struct lb_env *env) migrate_improves_locality() argument
5553 migrate_degrades_locality(struct task_struct *p, struct lb_env *env) migrate_degrades_locality() argument
/linux-4.1.27/tools/perf/ui/browsers/
H A Dheader.c94 int tui__header_window(struct perf_session_env *env) tui__header_window() argument
103 session = container_of(env, struct perf_session, header.env); tui__header_window()
H A Dhists.c1421 struct perf_session_env *env) perf_evsel__hists_browse()
1559 /* env->arch is NULL for live-mode (i.e. perf top) */ perf_evsel__hists_browse()
1560 if (env->arch) perf_evsel__hists_browse()
1561 tui__header_window(env); perf_evsel__hists_browse()
1712 if (!objdump_path && perf_session_env__lookup_objdump(env)) perf_evsel__hists_browse()
1824 struct perf_session_env *env; member in struct:perf_evsel_menu
1919 menu->env); perf_evsel_menu__run()
1981 struct perf_session_env *env) __perf_evlist__tui_browse_hists()
1995 .env = env, __perf_evlist__tui_browse_hists()
2014 struct perf_session_env *env) perf_evlist__tui_browse_hists()
2024 env); perf_evlist__tui_browse_hists()
2041 hbt, min_pcnt, env);
1416 perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, const char *helpline, bool left_exits, struct hist_browser_timer *hbt, float min_pcnt, struct perf_session_env *env) perf_evsel__hists_browse() argument
1977 __perf_evlist__tui_browse_hists(struct perf_evlist *evlist, int nr_entries, const char *help, struct hist_browser_timer *hbt, float min_pcnt, struct perf_session_env *env) __perf_evlist__tui_browse_hists() argument
2011 perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, struct hist_browser_timer *hbt, float min_pcnt, struct perf_session_env *env) perf_evlist__tui_browse_hists() argument
/linux-4.1.27/arch/mips/include/asm/mach-loongson1/
H A Dprom.h20 /* loongson-specific command line, env and memory initialization */
/linux-4.1.27/drivers/mtd/maps/
H A Dpmcmsp-flash.c56 char *env; init_msp_flash() local
70 for (fcnt = 0; (env = prom_getenv(flash_name)); fcnt++) init_msp_flash()
95 for (pcnt = 0; (env = prom_getenv(part_name)); pcnt++) init_msp_flash()
111 env = prom_getenv(flash_name); init_msp_flash()
113 if (sscanf(env, "%x:%x", &addr, &size) < 2) { init_msp_flash()
155 env = prom_getenv(part_name); init_msp_flash()
157 if (sscanf(env, "%x:%x:%n", &offset, &size, init_msp_flash()
168 msp_parts[i][j].name = env + coff; init_msp_flash()
/linux-4.1.27/arch/mips/ar7/
H A Dprom.c183 static void __init ar7_init_env(struct env_var *env) ar7_init_env() argument
192 for (i = 0; i < MAX_ENTRY; i++, env++) ar7_init_env()
193 if (env->name) ar7_init_env()
194 add_adam2_var(env->name, env->value); ar7_init_env()
/linux-4.1.27/drivers/zorro/
H A Dzorro-driver.c143 static int zorro_uevent(struct device *dev, struct kobj_uevent_env *env) zorro_uevent() argument
154 if (add_uevent_var(env, "ZORRO_ID=%08X", z->id) || zorro_uevent()
155 add_uevent_var(env, "ZORRO_SLOT_NAME=%s", dev_name(dev)) || zorro_uevent()
156 add_uevent_var(env, "ZORRO_SLOT_ADDR=%04X", z->slotaddr) || zorro_uevent()
157 add_uevent_var(env, "MODALIAS=" ZORRO_DEVICE_MODALIAS_FMT, z->id)) zorro_uevent()
/linux-4.1.27/drivers/power/
H A Dpower_supply.h20 extern int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env);
H A Dpower_supply_sysfs.c273 int power_supply_uevent(struct device *dev, struct kobj_uevent_env *env) power_supply_uevent() argument
289 ret = add_uevent_var(env, "POWER_SUPPLY_NAME=%s", psy->desc->name); power_supply_uevent()
326 ret = add_uevent_var(env, "POWER_SUPPLY_%s=%s", attrname, prop_buf); power_supply_uevent()
/linux-4.1.27/arch/powerpc/include/asm/
H A Dtypes.h25 unsigned long env; member in struct:__anon2339
/linux-4.1.27/drivers/staging/lustre/lustre/ptlrpc/
H A Dllog_client.c79 static int llog_client_open(const struct lu_env *env, llog_client_open() argument
145 static int llog_client_destroy(const struct lu_env *env, llog_client_destroy() argument
180 static int llog_client_next_block(const struct lu_env *env, llog_client_next_block() argument
239 static int llog_client_prev_block(const struct lu_env *env, llog_client_prev_block() argument
292 static int llog_client_read_header(const struct lu_env *env, llog_client_read_header() argument
349 static int llog_client_close(const struct lu_env *env, llog_client_close() argument
H A Dptlrpcd.c263 static int ptlrpcd_check(struct lu_env *env, struct ptlrpcd_ctl *pc) ptlrpcd_check() argument
288 * sure that env key the requests depending on really exists. ptlrpcd_check()
290 rc2 = lu_env_refill(env); ptlrpcd_check()
295 * interpreters assume that env is set up), nor repeat ptlrpcd_check()
307 rc |= ptlrpc_check_set(env, set); ptlrpcd_check()
376 struct lu_env env = { .le_ses = NULL }; ptlrpcd() local
399 rc = lu_context_init(&env.le_ctx, ptlrpcd()
420 lu_context_enter(&env.le_ctx); ptlrpcd()
422 ptlrpcd_check(&env, pc), &lwi); ptlrpcd()
423 lu_context_exit(&env.le_ctx); ptlrpcd()
445 lu_context_fini(&env.le_ctx); ptlrpcd()
H A Dservice.c2264 struct lu_env *env; ptlrpc_main() local
2294 OBD_ALLOC_PTR(env); ptlrpc_main()
2295 if (env == NULL) { ptlrpc_main()
2300 rc = lu_context_init(&env->le_ctx, ptlrpc_main()
2305 thread->t_env = env; ptlrpc_main()
2306 env->le_ctx.lc_thread = thread; ptlrpc_main()
2307 env->le_ctx.lc_cookie = 0x6; ptlrpc_main()
2372 lu_context_enter(&env->le_ctx); ptlrpc_main()
2373 env->le_ses = NULL; ptlrpc_main()
2375 lu_context_exit(&env->le_ctx); ptlrpc_main()
2387 lu_context_enter(&env->le_ctx); ptlrpc_main()
2389 lu_context_exit(&env->le_ctx); ptlrpc_main()
2415 if (env != NULL) { ptlrpc_main()
2416 lu_context_fini(&env->le_ctx); ptlrpc_main()
2417 OBD_FREE_PTR(env); ptlrpc_main()
/linux-4.1.27/drivers/xen/xenbus/
H A Dxenbus_probe_backend.c97 struct kobj_uevent_env *env) xenbus_uevent_backend()
111 if (add_uevent_var(env, "MODALIAS=xen-backend:%s", xdev->devicetype)) xenbus_uevent_backend()
115 if (add_uevent_var(env, "XENBUS_TYPE=%s", xdev->devicetype)) xenbus_uevent_backend()
118 if (add_uevent_var(env, "XENBUS_PATH=%s", xdev->nodename)) xenbus_uevent_backend()
121 if (add_uevent_var(env, "XENBUS_BASE_PATH=%s", bus->root)) xenbus_uevent_backend()
127 return drv->uevent(xdev, env); xenbus_uevent_backend()
96 xenbus_uevent_backend(struct device *dev, struct kobj_uevent_env *env) xenbus_uevent_backend() argument
H A Dxenbus_probe_frontend.c79 struct kobj_uevent_env *env) xenbus_uevent_frontend()
83 if (add_uevent_var(env, "MODALIAS=xen:%s", dev->devicetype)) xenbus_uevent_frontend()
78 xenbus_uevent_frontend(struct device *_dev, struct kobj_uevent_env *env) xenbus_uevent_frontend() argument
/linux-4.1.27/drivers/md/bcache/
H A Dsysfs.c196 struct kobj_uevent_env *env; SHOW_LOCKED() local
254 env = kzalloc(sizeof(struct kobj_uevent_env), GFP_KERNEL); SHOW_LOCKED()
255 if (!env) SHOW_LOCKED()
257 add_uevent_var(env, "DRIVER=bcache"); SHOW_LOCKED()
258 add_uevent_var(env, "CACHED_UUID=%pU", dc->sb.uuid), SHOW_LOCKED()
259 add_uevent_var(env, "CACHED_LABEL=%s", buf); SHOW_LOCKED()
261 &disk_to_dev(dc->disk.disk)->kobj, KOBJ_CHANGE, env->envp); SHOW_LOCKED()
262 kfree(env); SHOW_LOCKED()
H A Dsuper.c872 char *env[] = { bch_cached_dev_run() local
881 env[2] = kasprintf(GFP_KERNEL, "CACHED_LABEL=%s", buf); bch_cached_dev_run()
884 kfree(env[1]); bch_cached_dev_run()
885 kfree(env[2]); bch_cached_dev_run()
903 kobject_uevent_env(&disk_to_dev(d->disk)->kobj, KOBJ_CHANGE, env); bch_cached_dev_run()
904 kfree(env[1]); bch_cached_dev_run()
905 kfree(env[2]); bch_cached_dev_run()
/linux-4.1.27/drivers/staging/lustre/lustre/fid/
H A Dfid_request.c145 const struct lu_env *env) seq_client_alloc_super()
169 static int seq_client_alloc_meta(const struct lu_env *env, seq_client_alloc_meta() argument
191 static int seq_client_alloc_seq(const struct lu_env *env, seq_client_alloc_seq() argument
199 rc = seq_client_alloc_meta(env, seq); seq_client_alloc_seq()
253 int seq_client_get_seq(const struct lu_env *env, seq_client_get_seq() argument
269 rc = seq_client_alloc_seq(env, seq, seqnr); seq_client_get_seq()
302 int seq_client_alloc_fid(const struct lu_env *env, seq_client_alloc_fid() argument
332 rc = seq_client_alloc_seq(env, seq, &seqnr); seq_client_alloc_fid()
144 seq_client_alloc_super(struct lu_client_seq *seq, const struct lu_env *env) seq_client_alloc_super() argument
H A Dfid_internal.h48 const struct lu_env *env);
/linux-4.1.27/arch/mips/pnx833x/stb22x/
H A Dboard.c52 static inline unsigned long env_or_default(char *env, unsigned long dfl) env_or_default() argument
54 char *str = prom_getenv(env); env_or_default()
/linux-4.1.27/arch/alpha/include/asm/
H A Derr_ev7.h181 struct ev7_pal_environmental_subpacket env; /* Type 10-16 */ member in union:ev7_pal_subpacket::__anon65
195 struct ev7_pal_environmental_subpacket *env[7]; /* Type 10-16 */ member in struct:ev7_lf_subpackets
/linux-4.1.27/net/atm/
H A Datm_sysfs.c116 static int atm_uevent(struct device *cdev, struct kobj_uevent_env *env) atm_uevent() argument
127 if (add_uevent_var(env, "NAME=%s%d", adev->type, adev->number)) atm_uevent()
/linux-4.1.27/drivers/mmc/core/
H A Dbus.c68 mmc_bus_uevent(struct device *dev, struct kobj_uevent_env *env) mmc_bus_uevent() argument
92 retval = add_uevent_var(env, "MMC_TYPE=%s", type); mmc_bus_uevent()
97 retval = add_uevent_var(env, "MMC_NAME=%s", mmc_card_name(card)); mmc_bus_uevent()
105 retval = add_uevent_var(env, "MODALIAS=mmc:block"); mmc_bus_uevent()
H A Dsdio_bus.c109 sdio_bus_uevent(struct device *dev, struct kobj_uevent_env *env) sdio_bus_uevent() argument
113 if (add_uevent_var(env, sdio_bus_uevent()
117 if (add_uevent_var(env, sdio_bus_uevent()
121 if (add_uevent_var(env, sdio_bus_uevent()
/linux-4.1.27/arch/mips/mti-sead3/
H A Dsead3-setup.c88 /* allow command line/bootloader env to override memory size in DT */ plat_mem_setup()
/linux-4.1.27/arch/powerpc/include/uapi/asm/
H A Dnvram.h20 #define NVRAM_SIG_SYS 0x70 /* system env vars */
/linux-4.1.27/arch/avr32/boards/atngw100/
H A Dflash.c53 .name = "env",
/linux-4.1.27/arch/avr32/boards/atstk1000/
H A Dflash.c53 .name = "env",
/linux-4.1.27/arch/avr32/boards/favr-32/
H A Dflash.c53 .name = "env",
/linux-4.1.27/arch/arm/mach-orion5x/
H A Dboard-mss2.c66 * - Userland modifies U-boot env to tell U-boot to go idle at next boot
/linux-4.1.27/Documentation/networking/
H A Dcxacru-cf.py1 #!/usr/bin/env python
/linux-4.1.27/scripts/
H A Ddecodecode5 # options: set env. variable AFLAGS=options to pass options to "as";
H A Dcheckkconfigsymbols.py1 #!/usr/bin/env python
/linux-4.1.27/arch/sparc/kernel/
H A Dldc.c61 u8 env; member in struct:ldc_packet
442 p->env = lp->cfg.mode; send_rts()
446 ldcdbg(HS, "SEND RTS env[0x%x] seqid[0x%x]\n", send_rts()
447 p->env, p->seqid); send_rts()
462 p->env = lp->cfg.mode; send_rtr()
465 ldcdbg(HS, "SEND RTR env[0x%x] seqid[0x%x]\n", send_rtr()
466 p->env, p->seqid); send_rtr()
481 p->env = 0; send_rdx()
485 ldcdbg(HS, "SEND RDX env[0x%x] seqid[0x%x] ackid[0x%x]\n", send_rdx()
486 p->env, p->seqid, p->u.r.ackid); send_rdx()
678 ldcdbg(HS, "GOT RTS stype[%x] seqid[%x] env[%x]\n", process_rts()
679 p->stype, p->seqid, p->env); process_rts()
683 p->env != lp->cfg.mode) process_rts()
698 ldcdbg(HS, "GOT RTR stype[%x] seqid[%x] env[%x]\n", process_rtr()
699 p->stype, p->seqid, p->env); process_rtr()
702 p->env != lp->cfg.mode) process_rtr()
721 ldcdbg(HS, "GOT RDX stype[%x] seqid[%x] env[%x] ackid[%x]\n", process_rdx()
722 p->stype, p->seqid, p->env, p->u.r.ackid); process_rdx()
1554 p->env = (data_len | write_nonraw()
1564 p->env, write_nonraw()
1716 p->env, read_nonraw()
1753 pkt_len = p->env & LDC_LEN; read_nonraw()
1768 if ((first_frag == NULL && !(p->env & LDC_START)) || read_nonraw()
1769 (first_frag != NULL && (p->env & LDC_START))) { read_nonraw()
1809 if (p->env & LDC_STOP) read_nonraw()
/linux-4.1.27/scripts/kconfig/
H A Dconfdata.c114 char *env, *name; conf_get_default_confname() local
117 env = getenv(SRCTREE); conf_get_default_confname()
118 if (env) { conf_get_default_confname()
119 sprintf(fullname, "%s/%s", env, name); conf_get_default_confname()
749 char *env; conf_write() local
774 env = getenv("KCONFIG_OVERWRITECONFIG"); conf_write()
775 if (!env || !*env) { conf_write()
1135 char *env = getenv("KCONFIG_PROBABILITY"); conf_set_all_new_symbols() local
1137 while( env && *env ) { conf_set_all_new_symbols()
1139 int tmp = strtol( env, &endp, 10 ); conf_set_all_new_symbols()
1147 env = (*endp == ':') ? endp+1 : endp; conf_set_all_new_symbols()
H A Dstreamline_config.pl168 my $env = $1;
170 $source =~ s/\$$env/$ENV{$env}/;
H A Dsymbol.c1325 return "env"; prop_get_type_name()
1346 static void prop_add_env(const char *env) prop_add_env() argument
1356 if (strcmp(sym2->name, env)) for_all_properties()
1363 prop->expr = expr_alloc_symbol(sym_lookup(env, SYMBOL_CONST));
1368 p = getenv(env);
1372 menu_warn(current_entry, "environment variable %s undefined", env);
H A Dgconf.c1447 char *env; main() local
1463 env = getenv(SRCTREE); main()
1464 if (env) main()
1465 glade_file = g_strconcat(env, "/scripts/kconfig/gconf.glade", NULL); main()
/linux-4.1.27/drivers/misc/mic/bus/
H A Dmic_bus.c90 static int mbus_uevent(struct device *dv, struct kobj_uevent_env *env) mbus_uevent() argument
94 return add_uevent_var(env, "MODALIAS=mbus:d%08Xv%08X", mbus_uevent()
/linux-4.1.27/arch/mips/alchemy/
H A Dboard-gpr.c130 * 0x01d00000-0x01d40000 : "yamon env vars"
156 .name = "yamon env vars",
H A Dboard-mtx1.c188 .name = "yamon env",
/linux-4.1.27/arch/mips/mti-malta/
H A Dmalta-memory.c42 pr_warn("Failed to read the 'memsize' env variable.\n"); fw_getmdesc()
50 pr_warn("Failed to read the 'ememsize' env variable.\n"); fw_getmdesc()
/linux-4.1.27/drivers/input/
H A Dinput.c1525 static int input_add_uevent_bm_var(struct kobj_uevent_env *env, input_add_uevent_bm_var() argument
1530 if (add_uevent_var(env, "%s", name)) input_add_uevent_bm_var()
1533 len = input_print_bitmap(&env->buf[env->buflen - 1], input_add_uevent_bm_var()
1534 sizeof(env->buf) - env->buflen, input_add_uevent_bm_var()
1536 if (len >= (sizeof(env->buf) - env->buflen)) input_add_uevent_bm_var()
1539 env->buflen += len; input_add_uevent_bm_var()
1543 static int input_add_uevent_modalias_var(struct kobj_uevent_env *env, input_add_uevent_modalias_var() argument
1548 if (add_uevent_var(env, "MODALIAS=")) input_add_uevent_modalias_var()
1551 len = input_print_modalias(&env->buf[env->buflen - 1], input_add_uevent_modalias_var()
1552 sizeof(env->buf) - env->buflen, input_add_uevent_modalias_var()
1554 if (len >= (sizeof(env->buf) - env->buflen)) input_add_uevent_modalias_var()
1557 env->buflen += len; input_add_uevent_modalias_var()
1563 int err = add_uevent_var(env, fmt, val); \
1570 int err = input_add_uevent_bm_var(env, name, bm, max); \
1577 int err = input_add_uevent_modalias_var(env, dev); \
1582 static int input_dev_uevent(struct device *device, struct kobj_uevent_env *env) input_dev_uevent() argument
/linux-4.1.27/drivers/ide/
H A Dide.c115 static int ide_uevent(struct device *dev, struct kobj_uevent_env *env) ide_uevent() argument
119 add_uevent_var(env, "MEDIA=%s", ide_media_string(drive)); ide_uevent()
120 add_uevent_var(env, "DRIVENAME=%s", drive->name); ide_uevent()
121 add_uevent_var(env, "MODALIAS=ide:m-%s", ide_media_string(drive)); ide_uevent()
/linux-4.1.27/arch/avr32/boards/mimc200/
H A Dflash.c60 .name = "env",
/linux-4.1.27/tools/perf/ui/
H A Dbrowser.h62 int tui__header_window(struct perf_session_env *env);
/linux-4.1.27/drivers/base/
H A Dcore.c299 struct kobj_uevent_env *env) dev_uevent()
312 add_uevent_var(env, "MAJOR=%u", MAJOR(dev->devt)); dev_uevent()
313 add_uevent_var(env, "MINOR=%u", MINOR(dev->devt)); dev_uevent()
316 add_uevent_var(env, "DEVNAME=%s", name); dev_uevent()
318 add_uevent_var(env, "DEVMODE=%#o", mode & 0777); dev_uevent()
320 add_uevent_var(env, "DEVUID=%u", from_kuid(&init_user_ns, uid)); dev_uevent()
322 add_uevent_var(env, "DEVGID=%u", from_kgid(&init_user_ns, gid)); dev_uevent()
328 add_uevent_var(env, "DEVTYPE=%s", dev->type->name); dev_uevent()
331 add_uevent_var(env, "DRIVER=%s", dev->driver->name); dev_uevent()
334 of_device_uevent(dev, env); dev_uevent()
338 retval = dev->bus->uevent(dev, env); dev_uevent()
346 retval = dev->class->dev_uevent(dev, env); dev_uevent()
355 retval = dev->type->uevent(dev, env); dev_uevent()
376 struct kobj_uevent_env *env = NULL; uevent_show() local
397 env = kzalloc(sizeof(struct kobj_uevent_env), GFP_KERNEL); uevent_show()
398 if (!env) uevent_show()
402 retval = kset->uevent_ops->uevent(kset, &dev->kobj, env); uevent_show()
407 for (i = 0; i < env->envp_idx; i++) uevent_show()
408 count += sprintf(&buf[count], "%s\n", env->envp[i]); uevent_show()
410 kfree(env); uevent_show()
298 dev_uevent(struct kset *kset, struct kobject *kobj, struct kobj_uevent_env *env) dev_uevent() argument
H A Dcpu.c310 static int cpu_uevent(struct device *dev, struct kobj_uevent_env *env) cpu_uevent() argument
315 add_uevent_var(env, "MODALIAS=%s", buf); cpu_uevent()
H A Dfirmware_class.c547 static int do_firmware_uevent(struct firmware_priv *fw_priv, struct kobj_uevent_env *env) do_firmware_uevent() argument
549 if (add_uevent_var(env, "FIRMWARE=%s", fw_priv->buf->fw_id)) do_firmware_uevent()
551 if (add_uevent_var(env, "TIMEOUT=%i", loading_timeout)) do_firmware_uevent()
553 if (add_uevent_var(env, "ASYNC=%d", fw_priv->nowait)) do_firmware_uevent()
559 static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env) firmware_uevent() argument
566 err = do_firmware_uevent(fw_priv, env); firmware_uevent()
H A Dplatform.c774 static int platform_uevent(struct device *dev, struct kobj_uevent_env *env) platform_uevent() argument
780 rc = of_device_uevent_modalias(dev, env); platform_uevent()
784 rc = acpi_device_uevent_modalias(dev, env); platform_uevent()
788 add_uevent_var(env, "MODALIAS=%s%s", PLATFORM_MODULE_PREFIX, platform_uevent()
/linux-4.1.27/fs/gfs2/
H A Dsys.c680 struct kobj_uevent_env *env) gfs2_uevent()
686 add_uevent_var(env, "LOCKTABLE=%s", sdp->sd_table_name); gfs2_uevent()
687 add_uevent_var(env, "LOCKPROTO=%s", sdp->sd_proto_name); gfs2_uevent()
689 add_uevent_var(env, "JOURNALID=%d", sdp->sd_lockstruct.ls_jid); gfs2_uevent()
691 add_uevent_var(env, "UUID=%pUB", uuid); gfs2_uevent()
679 gfs2_uevent(struct kset *kset, struct kobject *kobj, struct kobj_uevent_env *env) gfs2_uevent() argument
/linux-4.1.27/drivers/platform/x86/
H A Dwmi.c685 static int wmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env) wmi_dev_uevent() argument
691 if (add_uevent_var(env, "MODALIAS=")) wmi_dev_uevent()
700 strcpy(&env->buf[env->buflen - 1], "wmi:"); wmi_dev_uevent()
701 memcpy(&env->buf[env->buflen - 1 + 4], guid_string, 36); wmi_dev_uevent()
702 env->buflen += 40; wmi_dev_uevent()
/linux-4.1.27/drivers/s390/net/
H A Dqeth_l2_main.c1408 char *env[8]; qeth_bridge_emit_host_event() local
1416 env[i] = str[i]; i++; qeth_bridge_emit_host_event()
1420 env[i] = str[i]; i++; qeth_bridge_emit_host_event()
1425 env[i] = str[i]; i++; qeth_bridge_emit_host_event()
1429 env[i] = str[i]; i++; qeth_bridge_emit_host_event()
1431 env[i] = str[i]; i++; qeth_bridge_emit_host_event()
1434 env[i] = str[i]; i++; qeth_bridge_emit_host_event()
1436 env[i] = str[i]; i++; qeth_bridge_emit_host_event()
1440 env[i] = str[i]; i++; qeth_bridge_emit_host_event()
1444 env[i] = str[i]; i++; qeth_bridge_emit_host_event()
1447 env[i] = NULL; qeth_bridge_emit_host_event()
1448 kobject_uevent_env(&card->gdev->dev.kobj, KOBJ_CHANGE, env); qeth_bridge_emit_host_event()
1466 char *env[] = { qeth_bridge_state_change_worker() local
1491 KOBJ_CHANGE, env); qeth_bridge_state_change_worker()
/linux-4.1.27/drivers/staging/lustre/lustre/mgc/
H A Dmgc_request.c644 static int mgc_llog_init(const struct lu_env *env, struct obd_device *obd) mgc_llog_init() argument
651 rc = llog_setup(env, obd, &obd->obd_olg, LLOG_CONFIG_REPL_CTXT, obd, mgc_llog_init()
665 static int mgc_llog_fini(const struct lu_env *env, struct obd_device *obd) mgc_llog_fini() argument
671 llog_cleanup(env, ctxt); mgc_llog_fini()
970 static int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp, mgc_set_info_async() argument
1047 static int mgc_get_info(const struct lu_env *env, struct obd_export *exp, mgc_get_info() argument
1482 struct lu_env *env; mgc_process_cfg_log() local
1497 OBD_ALLOC_PTR(env); mgc_process_cfg_log()
1498 if (env == NULL) mgc_process_cfg_log()
1501 rc = lu_env_init(env, LCT_MG_THREAD); mgc_process_cfg_log()
1521 rc = class_config_parse_llog(env, ctxt, cld->cld_logname, mgc_process_cfg_log()
1525 __llog_ctxt_put(env, ctxt); mgc_process_cfg_log()
1541 lu_env_fini(env); mgc_process_cfg_log()
1543 OBD_FREE_PTR(env); mgc_process_cfg_log()
/linux-4.1.27/arch/alpha/kernel/
H A Derr_marvel.c27 struct ev7_pal_environmental_subpacket *env; marvel_print_680_frame() local
48 env = lf_subpackets->env[ev7_lf_env_index(ev_packets[i].type)]; marvel_print_680_frame()
49 if (!env) marvel_print_680_frame()
55 env->cabinet, marvel_print_680_frame()
56 env->drawer); marvel_print_680_frame()
60 env->module_type, marvel_print_680_frame()
61 env->unit_id, marvel_print_680_frame()
62 env->condition); marvel_print_680_frame()
76 if (lf_subpackets->env[i]) marvel_process_680_frame()
H A Derr_ev7.c103 lf_subpackets->env[ev7_lf_env_index(subpacket->type)] = ev7_collect_logout_frame_subpackets()
/linux-4.1.27/drivers/acpi/
H A Dscan.c277 struct kobj_uevent_env *env) __acpi_device_uevent_modalias()
287 if (add_uevent_var(env, "MODALIAS=")) __acpi_device_uevent_modalias()
290 len = create_pnp_modalias(adev, &env->buf[env->buflen - 1], __acpi_device_uevent_modalias()
291 sizeof(env->buf) - env->buflen); __acpi_device_uevent_modalias()
295 env->buflen += len; __acpi_device_uevent_modalias()
299 if (len > 0 && add_uevent_var(env, "MODALIAS=")) __acpi_device_uevent_modalias()
302 len = create_of_modalias(adev, &env->buf[env->buflen - 1], __acpi_device_uevent_modalias()
303 sizeof(env->buf) - env->buflen); __acpi_device_uevent_modalias()
307 env->buflen += len; __acpi_device_uevent_modalias()
318 int acpi_device_uevent_modalias(struct device *dev, struct kobj_uevent_env *env) acpi_device_uevent_modalias() argument
320 return __acpi_device_uevent_modalias(acpi_companion_match(dev), env); acpi_device_uevent_modalias()
1127 static int acpi_device_uevent(struct device *dev, struct kobj_uevent_env *env) acpi_device_uevent() argument
1129 return __acpi_device_uevent_modalias(to_acpi_device(dev), env); acpi_device_uevent()
276 __acpi_device_uevent_modalias(struct acpi_device *adev, struct kobj_uevent_env *env) __acpi_device_uevent_modalias() argument
/linux-4.1.27/arch/arm/mach-s3c24xx/
H A Dmach-jive.c94 * 0x00028000-0x0002c000 : uboot env
143 .name = "env",
202 .name = "env",
/linux-4.1.27/drivers/memstick/core/
H A Dmemstick.c63 static int memstick_uevent(struct device *dev, struct kobj_uevent_env *env) memstick_uevent() argument
68 if (add_uevent_var(env, "MEMSTICK_TYPE=%02X", card->id.type)) memstick_uevent()
71 if (add_uevent_var(env, "MEMSTICK_CATEGORY=%02X", card->id.category)) memstick_uevent()
74 if (add_uevent_var(env, "MEMSTICK_CLASS=%02X", card->id.class)) memstick_uevent()
/linux-4.1.27/arch/mips/fw/sni/
H A Dsniprom.c26 * the prom env variable "version" against "2.0008"
/linux-4.1.27/drivers/media/dvb-core/
H A Ddvbdev.c577 static int dvb_uevent(struct device *dev, struct kobj_uevent_env *env) dvb_uevent() argument
581 add_uevent_var(env, "DVB_ADAPTER_NUM=%d", dvbdev->adapter->num); dvb_uevent()
582 add_uevent_var(env, "DVB_DEVICE_TYPE=%s", dnames[dvbdev->type]); dvb_uevent()
583 add_uevent_var(env, "DVB_DEVICE_NUM=%d", dvbdev->id); dvb_uevent()
/linux-4.1.27/arch/mips/sgi-ip22/
H A Dip22-nvram.c109 /* IP22 (Indigo2 aka FullHouse) stores env variables into ip22_nvram_read()
H A Dip22-gio.c198 static int gio_device_uevent(struct device *dev, struct kobj_uevent_env *env) gio_device_uevent() argument
202 add_uevent_var(env, "MODALIAS=gio:%x", gio_dev->id.id); gio_device_uevent()
/linux-4.1.27/arch/cris/include/asm/
H A Deshlibld.h78 char **env, int envc,
/linux-4.1.27/net/wireless/
H A Dsysfs.c83 static int wiphy_uevent(struct device *dev, struct kobj_uevent_env *env) wiphy_uevent() argument
H A Dreg.h35 * regulatory_hint_indoor - hint operation in indoor env. or not
/linux-4.1.27/drivers/isdn/mISDN/
H A Dcore.c151 static int mISDN_uevent(struct device *dev, struct kobj_uevent_env *env) mISDN_uevent() argument
158 if (add_uevent_var(env, "nchans=%d", mdev->nrbchan)) mISDN_uevent()
/linux-4.1.27/drivers/mcb/
H A Dmcb-core.c47 static int mcb_uevent(struct device *dev, struct kobj_uevent_env *env) mcb_uevent() argument
52 ret = add_uevent_var(env, "MODALIAS=mcb:16z%03d", mdev->id); mcb_uevent()
/linux-4.1.27/drivers/misc/
H A Dtifm_core.c62 static int tifm_uevent(struct device *dev, struct kobj_uevent_env *env) tifm_uevent() argument
66 if (add_uevent_var(env, "TIFM_CARD_TYPE=%s", tifm_media_type_name(sock->type, 1))) tifm_uevent()
/linux-4.1.27/drivers/rapidio/
H A Drio-driver.c201 static int rio_uevent(struct device *dev, struct kobj_uevent_env *env) rio_uevent() argument
212 if (add_uevent_var(env, "MODALIAS=rapidio:v%04Xd%04Xav%04Xad%04X", rio_uevent()
/linux-4.1.27/drivers/s390/cio/
H A Dscm.c38 static int scmdev_uevent(struct device *dev, struct kobj_uevent_env *env) scmdev_uevent() argument
40 return add_uevent_var(env, "MODALIAS=scm:scmdev"); scmdev_uevent()
H A Ddevice.c101 static int ccw_uevent(struct device *dev, struct kobj_uevent_env *env) ccw_uevent() argument
109 ret = add_uevent_var(env, "CU_TYPE=%04X", id->cu_type); ccw_uevent()
114 ret = add_uevent_var(env, "CU_MODEL=%02X", id->cu_model); ccw_uevent()
120 ret = add_uevent_var(env, "DEV_TYPE=%04X", id->dev_type); ccw_uevent()
125 ret = add_uevent_var(env, "DEV_MODEL=%02X", id->dev_model); ccw_uevent()
131 ret = add_uevent_var(env, "MODALIAS=%s", modalias_buf); ccw_uevent()
/linux-4.1.27/drivers/fmc/
H A Dfmc-core.c31 static int fmc_uevent(struct device *dev, struct kobj_uevent_env *env) fmc_uevent() argument
36 add_uevent_var(env, "MODALIAS=%s", "fmc"); fmc_uevent()
/linux-4.1.27/drivers/bus/
H A Dmips_cdmm.c68 static int mips_cdmm_uevent(struct device *dev, struct kobj_uevent_env *env) mips_cdmm_uevent() argument
73 retval = add_uevent_var(env, "CDMM_CPU=%u", cdev->cpu); mips_cdmm_uevent()
77 retval = add_uevent_var(env, "CDMM_TYPE=0x%02x", cdev->type); mips_cdmm_uevent()
81 retval = add_uevent_var(env, "CDMM_REV=%u", cdev->rev); mips_cdmm_uevent()
85 retval = add_uevent_var(env, "MODALIAS=mipscdmm:t%02X", cdev->type); mips_cdmm_uevent()
/linux-4.1.27/drivers/bcma/
H A Dmain.c28 static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env);
630 static int bcma_device_uevent(struct device *dev, struct kobj_uevent_env *env) bcma_device_uevent() argument
634 return add_uevent_var(env, bcma_device_uevent()
/linux-4.1.27/drivers/staging/lustre/lustre/fld/
H A Dfld_internal.h181 int fld_write_range(const struct lu_env *env, struct dt_object *dt,
/linux-4.1.27/drivers/crypto/vmx/
H A Dppc-xlate.pl1 #!/usr/bin/env perl
H A Dghashp8-ppc.pl1 #!/usr/bin/env perl
/linux-4.1.27/arch/mips/include/asm/dec/
H A Dprom.h67 #define REX_PROM_GETENV 0x64/4 /* get env. variable */
/linux-4.1.27/arch/mips/mm/
H A Dcache.c94 * case is for exec env/arg pages and those are %99 certainly going to __flush_dcache_page()
/linux-4.1.27/arch/mips/pmcs-msp71xx/
H A Dmsp_usb.c131 * Could this perhaps be integrated into the "features" env var? msp_usb_setup()
/linux-4.1.27/arch/metag/include/asm/
H A Dprocessor.h108 env[0...N] environment variables (pointers)
/linux-4.1.27/drivers/ipack/
H A Dipack.c88 static int ipack_uevent(struct device *dev, struct kobj_uevent_env *env) ipack_uevent() argument
97 if (add_uevent_var(env, ipack_uevent()
/linux-4.1.27/drivers/misc/mei/
H A Dbus.c117 static int mei_cl_uevent(struct device *dev, struct kobj_uevent_env *env) mei_cl_uevent() argument
119 if (add_uevent_var(env, "MODALIAS=mei:%s", dev_name(dev))) mei_cl_uevent()
/linux-4.1.27/drivers/eisa/
H A Deisa-bus.c131 static int eisa_bus_uevent(struct device *dev, struct kobj_uevent_env *env) eisa_bus_uevent() argument
135 add_uevent_var(env, "MODALIAS=" EISA_DEVICE_MODALIAS_FMT, edev->id.sig); eisa_bus_uevent()
/linux-4.1.27/drivers/virtio/
H A Dvirtio.c95 static int virtio_uevent(struct device *_dv, struct kobj_uevent_env *env) virtio_uevent() argument
99 return add_uevent_var(env, "MODALIAS=virtio:d%08Xv%08X", virtio_uevent()
/linux-4.1.27/arch/parisc/include/asm/
H A Dprocessor.h258 | env strings |
270 | env strings
/linux-4.1.27/arch/m68k/68360/
H A Dhead-ram.S242 pea env
258 env: label
H A Dhead-rom.S252 pea env
268 env: label
/linux-4.1.27/tools/perf/
H A Dbuiltin-annotate.c206 ret = perf_session_env__lookup_objdump(&session->header.env); __cmd_annotate()
352 ret = symbol__init(&annotate.session->header.env); cmd_annotate()
H A Dbuiltin-timechart.c1515 tchart->numcpus = ph->env.nr_cpus_avail; process_header()
1522 if (svg_build_topology_map(ph->env.sibling_cores, process_header()
1523 ph->env.nr_sibling_cores, process_header()
1524 ph->env.sibling_threads, process_header()
1525 ph->env.nr_sibling_threads)) process_header()
1612 symbol__init(&session->header.env); __cmd_timechart()
H A Dbuiltin-buildid-cache.c360 if (symbol__init(session ? &session->header.env : NULL) < 0) cmd_buildid_cache()
H A Dbuiltin-mem.c141 if (symbol__init(&session->header.env) < 0) report_raw_events()
H A Dbuiltin-report.c402 &session->header.env); report__browse_hists()
851 if (symbol__init(&session->header.env) < 0) cmd_report()
/linux-4.1.27/drivers/pci/
H A Dpci-driver.c1365 static int pci_uevent(struct device *dev, struct kobj_uevent_env *env) pci_uevent() argument
1374 if (add_uevent_var(env, "PCI_CLASS=%04X", pdev->class)) pci_uevent()
1377 if (add_uevent_var(env, "PCI_ID=%04X:%04X", pdev->vendor, pdev->device)) pci_uevent()
1380 if (add_uevent_var(env, "PCI_SUBSYS_ID=%04X:%04X", pdev->subsystem_vendor, pci_uevent()
1384 if (add_uevent_var(env, "PCI_SLOT_NAME=%s", pci_name(pdev))) pci_uevent()
1387 if (add_uevent_var(env, "MODALIAS=pci:v%08Xd%08Xsv%08Xsd%08Xbc%02Xsc%02Xi%02X", pci_uevent()
/linux-4.1.27/drivers/amba/
H A Dbus.c54 static int amba_uevent(struct device *dev, struct kobj_uevent_env *env) amba_uevent() argument
59 retval = add_uevent_var(env, "AMBA_ID=%08x", pcdev->periphid); amba_uevent()
63 retval = add_uevent_var(env, "MODALIAS=amba:d%08X", pcdev->periphid); amba_uevent()
/linux-4.1.27/drivers/usb/gadget/udc/
H A Dudc-core.c611 static int usb_udc_uevent(struct device *dev, struct kobj_uevent_env *env) usb_udc_uevent() argument
616 ret = add_uevent_var(env, "USB_UDC_NAME=%s", udc->gadget->name); usb_udc_uevent()
623 ret = add_uevent_var(env, "USB_UDC_DRIVER=%s", usb_udc_uevent()
/linux-4.1.27/arch/x86/include/asm/
H A Dfpu-internal.h47 extern void convert_from_fxsr(struct user_i387_ia32_struct *env,
50 const struct user_i387_ia32_struct *env);
/linux-4.1.27/drivers/pcmcia/
H A Dds.c926 static int pcmcia_bus_uevent(struct device *dev, struct kobj_uevent_env *env) pcmcia_bus_uevent() argument
944 if (add_uevent_var(env, "SOCKET_NO=%u", p_dev->socket->sock)) pcmcia_bus_uevent()
947 if (add_uevent_var(env, "DEVICE_NO=%02X", p_dev->device_no)) pcmcia_bus_uevent()
950 if (add_uevent_var(env, "MODALIAS=pcmcia:m%04Xc%04Xf%02Xfn%02Xpfn%02X" pcmcia_bus_uevent()
H A Dcs.c818 struct kobj_uevent_env *env) pcmcia_socket_uevent()
822 if (add_uevent_var(env, "SOCKET_NO=%u", s->sock)) pcmcia_socket_uevent()
817 pcmcia_socket_uevent(struct device *dev, struct kobj_uevent_env *env) pcmcia_socket_uevent() argument
/linux-4.1.27/arch/x86/include/uapi/asm/
H A Dsigcontext.h85 unsigned long _fxsr_env[6]; /* FXSR FPU env is ignored */
/linux-4.1.27/drivers/w1/
H A Dw1.c184 static int w1_uevent(struct device *dev, struct kobj_uevent_env *env);
581 static int w1_uevent(struct device *dev, struct kobj_uevent_env *env) w1_uevent() argument
607 err = add_uevent_var(env, "W1_FID=%02X", sl->reg_num.family); w1_uevent()
611 err = add_uevent_var(env, "W1_SLAVE_ID=%024LX", w1_uevent()
/linux-4.1.27/arch/score/mm/
H A Dcache.c69 * case is for exec env/arg pages and those are %99 certainly going to flush_dcache_page()
/linux-4.1.27/arch/avr32/boards/hammerhead/
H A Dflash.c71 .name = "env",
/linux-4.1.27/net/rfkill/
H A Dcore.c752 static int rfkill_dev_uevent(struct device *dev, struct kobj_uevent_env *env) rfkill_dev_uevent() argument
759 error = add_uevent_var(env, "RFKILL_NAME=%s", rfkill->name); rfkill_dev_uevent()
762 error = add_uevent_var(env, "RFKILL_TYPE=%s", rfkill_dev_uevent()
769 error = add_uevent_var(env, "RFKILL_STATE=%d", rfkill_dev_uevent()
/linux-4.1.27/drivers/infiniband/core/
H A Dsysfs.c463 struct kobj_uevent_env *env) ib_device_uevent()
467 if (add_uevent_var(env, "NAME=%s", dev->name)) ib_device_uevent()
462 ib_device_uevent(struct device *device, struct kobj_uevent_env *env) ib_device_uevent() argument
/linux-4.1.27/drivers/staging/lustre/lustre/lmv/
H A Dlmv_obd.c197 static int lmv_connect(const struct lu_env *env, lmv_connect() argument
1427 static int lmv_statfs(const struct lu_env *env, struct obd_export *exp, lmv_statfs() argument
1448 rc = obd_statfs(env, lmv->tgts[i]->ltd_exp, temp, lmv_statfs()
2325 static int lmv_get_info(const struct lu_env *env, struct obd_export *exp, lmv_get_info() argument
2358 if (!obd_get_info(env, tgt->ltd_exp, keylen, key, lmv_get_info()
2376 rc = obd_get_info(env, lmv->tgts[0]->ltd_exp, keylen, key, lmv_get_info()
2390 static int lmv_set_info_async(const struct lu_env *env, struct obd_export *exp, lmv_set_info_async() argument
2416 err = obd_set_info_async(env, tgt->ltd_exp, lmv_set_info_async()
/linux-4.1.27/drivers/input/serio/
H A Dserio.c915 int err = add_uevent_var(env, fmt, val); \
920 static int serio_uevent(struct device *dev, struct kobj_uevent_env *env) serio_uevent() argument
/linux-4.1.27/drivers/hsi/
H A Dhsi.c46 static int hsi_bus_uevent(struct device *dev, struct kobj_uevent_env *env) hsi_bus_uevent() argument
48 add_uevent_var(env, "MODALIAS=hsi:%s", dev_name(dev)); hsi_bus_uevent()
/linux-4.1.27/arch/powerpc/platforms/ps3/
H A Dsystem-bus.c455 static int ps3_system_bus_uevent(struct device *_dev, struct kobj_uevent_env *env) ps3_system_bus_uevent() argument
459 if (add_uevent_var(env, "MODALIAS=ps3:%d:%d", dev->match_id, ps3_system_bus_uevent()
/linux-4.1.27/fs/dlm/
H A Dlockspace.c228 struct kobj_uevent_env *env) dlm_uevent()
232 add_uevent_var(env, "LOCKSPACE=%s", ls->ls_name); dlm_uevent()
227 dlm_uevent(struct kset *kset, struct kobject *kobj, struct kobj_uevent_env *env) dlm_uevent() argument
/linux-4.1.27/drivers/md/
H A Dbitmap.h230 int cluster_slot; /* Slot offset for clustered env */
/linux-4.1.27/drivers/net/wireless/iwlwifi/dvm/
H A Ducode.c224 IWL_ERR(priv, "failed to send BT env command\n"); iwl_send_bt_env()
/linux-4.1.27/drivers/net/ethernet/brocade/bna/
H A Dbfi.h268 u32 bootenv; /*!< firmware boot env */

Completed in 6373 milliseconds

12