X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Flu_target.h;h=3192adf5a6a37176407f71b5ccf9e49c6e6d9b48;hb=9b922184db95a042f465612baeb5924f19d2ae7a;hp=09c98a6d4827308975bfc358fcc37e83b6550f54;hpb=5ae89cf509f30f00fb6c2bfb58c85b66a16a9f54;p=fs%2Flustre-release.git diff --git a/lustre/include/lu_target.h b/lustre/include/lu_target.h index 09c98a6..3192adf 100644 --- a/lustre/include/lu_target.h +++ b/lustre/include/lu_target.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. @@ -26,8 +24,10 @@ * GPL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2011, 2012, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -52,27 +52,40 @@ struct lu_target { /** Server last transaction number */ __u64 lut_last_transno; /** Lock protecting last transaction number */ - cfs_spinlock_t lut_translock; - /** Lock protecting client bitmap */ - cfs_spinlock_t lut_client_bitmap_lock; - /** Bitmap of known clients */ - unsigned long *lut_client_bitmap; - /** Number of mounts */ - __u64 lut_mount_count; + spinlock_t lut_translock; + /** Lock protecting client bitmap */ + spinlock_t lut_client_bitmap_lock; + /** Bitmap of known clients */ + unsigned long *lut_client_bitmap; }; -typedef void (*lut_cb_t)(struct lu_target *lut, __u64 transno, +typedef void (*tgt_cb_t)(struct lu_target *lut, __u64 transno, void *data, int err); -struct lut_commit_cb { - lut_cb_t lut_cb_func; - void *lut_cb_data; +struct tgt_commit_cb { + tgt_cb_t tgt_cb_func; + void *tgt_cb_data; }; -void lut_boot_epoch_update(struct lu_target *); -void lut_cb_last_committed(struct lu_target *, __u64, void *, int); -void lut_cb_client(struct lu_target *, __u64, void *, int); -int lut_init(const struct lu_env *, struct lu_target *, - struct obd_device *, struct dt_device *); -void lut_fini(const struct lu_env *, struct lu_target *); -void lut_client_free(struct obd_export *); +void tgt_boot_epoch_update(struct lu_target *lut); +int tgt_last_commit_cb_add(struct thandle *th, struct lu_target *lut, + struct obd_export *exp, __u64 transno); +int tgt_new_client_cb_add(struct thandle *th, struct obd_export *exp); +int tgt_init(const struct lu_env *env, struct lu_target *lut, + struct obd_device *obd, struct dt_device *dt); +void tgt_fini(const struct lu_env *env, struct lu_target *lut); +int tgt_client_alloc(struct obd_export *exp); +void tgt_client_free(struct obd_export *exp); +int tgt_client_del(const struct lu_env *env, struct obd_export *exp); +int tgt_client_add(const struct lu_env *env, struct obd_export *exp, int); +int tgt_client_new(const struct lu_env *env, struct obd_export *exp); +int tgt_client_data_read(const struct lu_env *env, struct lu_target *tg, + struct lsd_client_data *lcd, loff_t *off, int index); +int tgt_client_data_write(const struct lu_env *env, struct lu_target *tg, + struct lsd_client_data *lcd, loff_t *off, struct thandle *th); +int tgt_server_data_read(const struct lu_env *env, struct lu_target *tg); +int tgt_server_data_write(const struct lu_env *env, struct lu_target *tg, + struct thandle *th); +int tgt_server_data_update(const struct lu_env *env, struct lu_target *tg, int sync); +int tgt_truncate_last_rcvd(const struct lu_env *env, struct lu_target *tg, loff_t off); + #endif /* __LUSTRE_LU_TARGET_H */