X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fosc%2Fosc_cl_internal.h;h=3094ca2e707e0a70d2057b0cb6c32ac94670174a;hp=6478c269970d814e1f57702d12f46fda906ea3b5;hb=2d337a3da6bee76d66450fedda8386f9ede035fa;hpb=6fd5e00ff03d41b427eec5d70efaef4bbdd8d59c diff --git a/lustre/osc/osc_cl_internal.h b/lustre/osc/osc_cl_internal.h index 6478c26..3094ca2 100644 --- a/lustre/osc/osc_cl_internal.h +++ b/lustre/osc/osc_cl_internal.h @@ -1,6 +1,4 @@ -/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- - * vim:expandtab:shiftwidth=8:tabstop=8: - * +/* * GPL HEADER START * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,6 +26,8 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2012, Whamcloud, Inc. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -70,11 +70,12 @@ struct osc_io { /** true if this io is lockless. */ int oi_lockless; - struct obdo oi_oa; - struct osc_setattr_cbargs { - int opc_rc; - cfs_completion_t opc_sync; - } oi_setattr_cbarg; + struct obd_info oi_info; + struct obdo oi_oa; + struct osc_async_cbargs { + int opc_rc; + cfs_completion_t opc_sync; + } oi_cbarg; }; /** @@ -100,6 +101,22 @@ struct osc_thread_info { struct cl_page_list oti_plist; }; +/** + * Manage osc_async_page + */ +struct osc_oap_pages { + cfs_list_t oop_pending; + cfs_list_t oop_urgent; + int oop_num_pending; +}; + +static inline void osc_oap_pages_init(struct osc_oap_pages *list) +{ + CFS_INIT_LIST_HEAD(&list->oop_pending); + CFS_INIT_LIST_HEAD(&list->oop_urgent); + list->oop_num_pending = 0; +} + struct osc_object { struct cl_object oo_cl; struct lov_oinfo *oo_oinfo; @@ -125,6 +142,16 @@ struct osc_object { * locked during take-off and landing. */ cfs_spinlock_t oo_seatbelt; + + /** + * used by the osc to keep track of what objects to build into rpcs + */ + struct osc_oap_pages oo_read_pages; + struct osc_oap_pages oo_write_pages; + cfs_list_t oo_ready_item; + cfs_list_t oo_hp_ready_item; + cfs_list_t oo_write_item; + cfs_list_t oo_read_item; }; /* @@ -253,7 +280,11 @@ struct osc_lock { * granted. * Glimpse lock should be destroyed immediately after use. */ - ols_glimpse:1; + ols_glimpse:1, + /** + * For async glimpse lock. + */ + ols_agl:1; /** * IO that owns this lock. This field is used for a dead-lock * avoidance by osc_lock_enqueue_wait(). @@ -357,9 +388,25 @@ void osc_index2policy (ldlm_policy_data_t *policy, const struct cl_object *obj, pgoff_t start, pgoff_t end); int osc_lvb_print (const struct lu_env *env, void *cookie, lu_printer_t p, const struct ost_lvb *lvb); + void osc_io_submit_page(const struct lu_env *env, struct osc_io *oio, struct osc_page *opg, enum cl_req_type crt); +void osc_ap_completion(const struct lu_env *env, struct client_obd *cli, + struct obdo *oa, struct osc_async_page *oap, + int sent, int rc); +int osc_cancel_async_page(const struct lu_env *env, struct osc_page *ops); +int osc_set_async_flags(struct osc_object *obj, struct osc_page *opg, + obd_flag async_flags); +int osc_prep_async_page(struct osc_object *osc, struct osc_page *ops, + cfs_page_t *page, loff_t offset); +int osc_queue_async_io(const struct lu_env *env, struct osc_page *ops); +int osc_teardown_async_page(struct osc_object *obj, + struct osc_page *ops); +int osc_queue_sync_page(const struct lu_env *env, struct osc_page *ops, + int cmd, int brw_flags); +void osc_io_unplug(const struct lu_env *env, struct client_obd *cli, + struct osc_object *osc, pdl_policy_t pol); void osc_object_set_contended (struct osc_object *obj); void osc_object_clear_contended(struct osc_object *obj);