From 62e0cb93e1c19551b628c0d09d6ad8eb289d9a77 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Thu, 26 Jun 2014 21:36:21 +0400 Subject: [PATCH] LU-4975 ofd: documenting the ofd_trans.c Fix up GPL header block to reference proper GPLv2 license URL. Remove mention of contacting Sun, since they don't exist anymore. Add introductory comment block for the ofd_trans.c file and add function comment blocks to all functions in it. Signed-off-by: Mikhail Pershin Change-Id: I3064afb8574f92c093efaa2bcc3178b33d15932d Reviewed-on: http://review.whamcloud.com/10852 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Ned Bass Reviewed-by: Andreas Dilger --- lustre/ofd/ofd_trans.c | 54 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/lustre/ofd/ofd_trans.c b/lustre/ofd/ofd_trans.c index 67cc912..70d5218 100644 --- a/lustre/ofd/ofd_trans.c +++ b/lustre/ofd/ofd_trans.c @@ -15,11 +15,7 @@ * * You should have received a copy of the GNU General Public License * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. + * http://www.gnu.org/licenses/gpl-2.0.html * * GPL HEADER END */ @@ -27,22 +23,37 @@ * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, 2013, Intel Corporation. + * Copyright (c) 2012, 2014 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ * Lustre is a trademark of Sun Microsystems, Inc. * - * lustre/ofd/ofd_recovery.c + * lustre/ofd/ofd_trans.c + * + * This file provides functions for OBD Filter Device (OFD) transaction + * management. * - * Author: Alex Zhuravlev - * Author: Mikhail Pershin + * Author: Alex Zhuravlev + * Author: Mikhail Pershin */ #define DEBUG_SUBSYSTEM S_FILTER #include "ofd_internal.h" +/** + * Create new transaction in OFD. + * + * This function creates a transaction with dt_trans_create() + * and makes it synchronous if required by the export state. + * + * \param[in] env execution environment + * \param[in] ofd OFD device + * + * \retval struct thandle if transaction was created successfully + * \retval ERR_PTR on negative value in case of error + */ struct thandle *ofd_trans_create(const struct lu_env *env, struct ofd_device *ofd) { @@ -61,6 +72,20 @@ struct thandle *ofd_trans_create(const struct lu_env *env, return th; } +/** + * Start transaction in OFD. + * + * This function updates the given \a obj object version and calls + * dt_trans_start(). + * + * \param[in] env execution environment + * \param[in] ofd OFD device + * \param[in] obj OFD object affected by this transaction + * \param[in] th transaction handle + * + * \retval 0 if successful + * \retval negative value in case of error + */ int ofd_trans_start(const struct lu_env *env, struct ofd_device *ofd, struct ofd_object *obj, struct thandle *th) { @@ -71,6 +96,17 @@ int ofd_trans_start(const struct lu_env *env, struct ofd_device *ofd, return dt_trans_start(env, ofd->ofd_osd, th); } +/** + * Stop transaction in OFD. + * + * This function fills thandle::th_result with result of whole operation + * and calls dt_trans_stop(). + * + * \param[in] env execution environment + * \param[in] ofd OFD device + * \param[in] th transaction handle + * \param[in] rc result code of whole operation + */ void ofd_trans_stop(const struct lu_env *env, struct ofd_device *ofd, struct thandle *th, int rc) { -- 1.8.3.1