summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
53380e0)
- Fix up GPL header block to reference proper GPLv2 license URL.
- Remove mention of contacting Sun.
- Add introductionary comment block for the lproc_osp.c file.
- Add function comments blocks to all functions in the lproc_osp.c
file
Signed-off-by: Lai Siyao <lai.siyao@intel.com>
Change-Id: If037ab1777b0640e8cd6b66f0a78ca54339907ff
Reviewed-on: http://review.whamcloud.com/10893
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Richard Henwood <richard.henwood@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
*
* You should have received a copy of the GNU General Public License
* version 2 along with this program; If not, see
*
* 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
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2012, 2013, Intel Corporation.
+ * Copyright (c) 2012, 2013, 2014 Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
*/
/*
* This file is part of Lustre, http://www.lustre.org/
*
* lustre/osp/lproc_osp.c
*
*
* lustre/osp/lproc_osp.c
*
- * Lustre OST Proxy Device, procfs functions
+ * Lustre OST Proxy Device (OSP), procfs functions
*
* Author: Alex Zhuravlev <alexey.zhuravlev@intel.com>
*/
*
* Author: Alex Zhuravlev <alexey.zhuravlev@intel.com>
*/
#include "osp_internal.h"
#ifdef LPROCFS
#include "osp_internal.h"
#ifdef LPROCFS
+/**
+ * Show OSP active status
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_active_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
static int osp_active_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
+/**
+ * Activate/Deactivate OSP
+ *
+ * \param[in] file proc file
+ * \param[in] buffer string, which is "1" or "0" to activate/deactivate OSP
+ * \param[in] count \a buffer length
+ * \param[in] off unused for single entry
+ * \retval \a count on success
+ * \retval negative number on error
+ */
static ssize_t
osp_active_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
static ssize_t
osp_active_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
}
LPROC_SEQ_FOPS(osp_active);
}
LPROC_SEQ_FOPS(osp_active);
+/**
+ * Show number of RPCs in flight
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_syn_in_flight_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
static int osp_syn_in_flight_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
}
LPROC_SEQ_FOPS_RO(osp_syn_in_flight);
}
LPROC_SEQ_FOPS_RO(osp_syn_in_flight);
+/**
+ * Show number of RPCs in processing (including uncommitted by OST)
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_syn_in_prog_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
static int osp_syn_in_prog_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
}
LPROC_SEQ_FOPS_RO(osp_syn_in_prog);
}
LPROC_SEQ_FOPS_RO(osp_syn_in_prog);
+/**
+ * Show number of changes to sync
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_syn_changes_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
static int osp_syn_changes_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
return seq_printf(m, "%lu\n", osp->opd_syn_changes);
}
return seq_printf(m, "%lu\n", osp->opd_syn_changes);
}
+/**
+ * Sync changes
+ *
+ * \param[in] file proc file
+ * \param[in] buffer unused because any input will do
+ * \param[in] count \a buffer length
+ * \param[in] off unused for single entry
+ * \retval \a count on success
+ * \retval negative number on error
+ */
static ssize_t osp_syn_changes_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
{
static ssize_t osp_syn_changes_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
{
}
LPROC_SEQ_FOPS(osp_syn_changes);
}
LPROC_SEQ_FOPS(osp_syn_changes);
+/**
+ * Show maximum number of RPCs in flight allowed
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_max_rpcs_in_flight_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
static int osp_max_rpcs_in_flight_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
return seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_flight);
}
return seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_flight);
}
+/**
+ * Change maximum number of RPCs in flight allowed
+ *
+ * \param[in] file proc file
+ * \param[in] buffer string which represents maximum number
+ * \param[in] count \a buffer length
+ * \param[in] off unused for single entry
+ * \retval \a count on success
+ * \retval negative number on error
+ */
static ssize_t
osp_max_rpcs_in_flight_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
static ssize_t
osp_max_rpcs_in_flight_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
}
LPROC_SEQ_FOPS(osp_max_rpcs_in_flight);
}
LPROC_SEQ_FOPS(osp_max_rpcs_in_flight);
+/**
+ * Show maximum number of RPCs in processing allowed
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_max_rpcs_in_prog_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
static int osp_max_rpcs_in_prog_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
return seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_progress);
}
return seq_printf(m, "%u\n", osp->opd_syn_max_rpc_in_progress);
}
+/**
+ * Change maximum number of RPCs in processing allowed
+ *
+ * \param[in] file proc file
+ * \param[in] buffer string which represents maximum number
+ * \param[in] count \a buffer length
+ * \param[in] off unused for single entry
+ * \retval \a count on success
+ * \retval negative number on error
+ */
static ssize_t
osp_max_rpcs_in_prog_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
static ssize_t
osp_max_rpcs_in_prog_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
}
LPROC_SEQ_FOPS(osp_max_rpcs_in_prog);
}
LPROC_SEQ_FOPS(osp_max_rpcs_in_prog);
+/**
+ * Show number of objects to precreate next time
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_create_count_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
static int osp_create_count_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
return seq_printf(m, "%d\n", osp->opd_pre_grow_count);
}
return seq_printf(m, "%d\n", osp->opd_pre_grow_count);
}
+/**
+ * Change number of objects to precreate next time
+ *
+ * \param[in] file proc file
+ * \param[in] buffer string which represents number of objects to precreate
+ * \param[in] count \a buffer length
+ * \param[in] off unused for single entry
+ * \retval \a count on success
+ * \retval negative number on error
+ */
static ssize_t
osp_create_count_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
static ssize_t
osp_create_count_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
}
LPROC_SEQ_FOPS(osp_create_count);
}
LPROC_SEQ_FOPS(osp_create_count);
+/**
+ * Show maximum number of objects to precreate
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_max_create_count_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
static int osp_max_create_count_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
return seq_printf(m, "%d\n", osp->opd_pre_max_grow_count);
}
return seq_printf(m, "%d\n", osp->opd_pre_max_grow_count);
}
+/**
+ * Change maximum number of objects to precreate
+ *
+ * \param[in] file proc file
+ * \param[in] buffer string which represents maximum number
+ * \param[in] count \a buffer length
+ * \param[in] off unused for single entry
+ * \retval \a count on success
+ * \retval negative number on error
+ */
static ssize_t
osp_max_create_count_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
static ssize_t
osp_max_create_count_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
}
LPROC_SEQ_FOPS(osp_max_create_count);
}
LPROC_SEQ_FOPS(osp_max_create_count);
+/**
+ * Show last id to assign in creation
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_prealloc_next_id_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
static int osp_prealloc_next_id_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
}
LPROC_SEQ_FOPS_RO(osp_prealloc_next_id);
}
LPROC_SEQ_FOPS_RO(osp_prealloc_next_id);
+/**
+ * Show last created id OST reported
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_prealloc_last_id_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
static int osp_prealloc_last_id_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
}
LPROC_SEQ_FOPS_RO(osp_prealloc_last_id);
}
LPROC_SEQ_FOPS_RO(osp_prealloc_last_id);
+/**
+ * Show next FID sequence to precreate
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_prealloc_next_seq_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
static int osp_prealloc_next_seq_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
}
LPROC_SEQ_FOPS_RO(osp_prealloc_next_seq);
}
LPROC_SEQ_FOPS_RO(osp_prealloc_next_seq);
+/**
+ * Show last created FID sequence OST reported
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_prealloc_last_seq_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
static int osp_prealloc_last_seq_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
}
LPROC_SEQ_FOPS_RO(osp_prealloc_last_seq);
}
LPROC_SEQ_FOPS_RO(osp_prealloc_last_seq);
+/**
+ * Show the number of ids reserved by declare
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_prealloc_reserved_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
static int osp_prealloc_reserved_seq_show(struct seq_file *m, void *data)
{
struct obd_device *obd = m->private;
}
LPROC_SEQ_FOPS_RO(osp_prealloc_reserved);
}
LPROC_SEQ_FOPS_RO(osp_prealloc_reserved);
+/**
+ * Show interval (in seconds) to update statfs data
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_maxage_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
static int osp_maxage_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
return seq_printf(m, "%u\n", osp->opd_statfs_maxage);
}
return seq_printf(m, "%u\n", osp->opd_statfs_maxage);
}
+/**
+ * Change interval to update statfs data
+ *
+ * \param[in] file proc file
+ * \param[in] buffer string which represents statfs interval (in seconds)
+ * \param[in] count \a buffer length
+ * \param[in] off unused for single entry
+ * \retval \a count on success
+ * \retval negative number on error
+ */
static ssize_t
osp_maxage_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
static ssize_t
osp_maxage_seq_write(struct file *file, const char *buffer,
size_t count, loff_t *off)
}
LPROC_SEQ_FOPS(osp_maxage);
}
LPROC_SEQ_FOPS(osp_maxage);
+/**
+ * Show current precreation status: output 0 means success, otherwise negative
+ * number is printed
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_pre_status_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
static int osp_pre_status_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
}
LPROC_SEQ_FOPS_RO(osp_pre_status);
}
LPROC_SEQ_FOPS_RO(osp_pre_status);
+/**
+ * Show the number of RPCs in processing (including uncommitted by OST) plus
+ * changes to sync, i.e. this is the total number of changes OST needs to apply
+ * and commit.
+ *
+ * This counter is used to determine if OST has space returned. A zero value
+ * indicates that OST storage space consumed by destroyed objects has been freed
+ * on disk, the associated llog records have been cleared, and no synchronous
+ * RPC are being processed.
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_destroys_in_flight_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
static int osp_destroys_in_flight_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
if (osp == NULL)
return -EINVAL;
if (osp == NULL)
return -EINVAL;
- /*
- * This counter used to determine if OST has space returned.
- * Now we need to wait for the following:
- * - sync changes are zero - no llog records
- * - sync in progress are zero - no RPCs in flight
- */
return seq_printf(m, "%lu\n",
osp->opd_syn_rpc_in_progress + osp->opd_syn_changes);
}
LPROC_SEQ_FOPS_RO(osp_destroys_in_flight);
return seq_printf(m, "%lu\n",
osp->opd_syn_rpc_in_progress + osp->opd_syn_changes);
}
LPROC_SEQ_FOPS_RO(osp_destroys_in_flight);
+/**
+ * Show changes synced from previous mount
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_old_sync_processed_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
static int osp_old_sync_processed_seq_show(struct seq_file *m, void *data)
{
struct obd_device *dev = m->private;
}
LPROC_SEQ_FOPS_RO(osp_old_sync_processed);
}
LPROC_SEQ_FOPS_RO(osp_old_sync_processed);
+/**
+ * Show maximum number of RPCs in flight
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int
osp_lfsck_max_rpcs_in_flight_seq_show(struct seq_file *m, void *data)
{
static int
osp_lfsck_max_rpcs_in_flight_seq_show(struct seq_file *m, void *data)
{
return seq_printf(m, "%u\n", max);
}
return seq_printf(m, "%u\n", max);
}
+/**
+ * Change maximum number of RPCs in flight
+ *
+ * \param[in] file proc file
+ * \param[in] buffer string which represents maximum number of RPCs in flight
+ * \param[in] count \a buffer length
+ * \param[in] off unused for single entry
+ * \retval \a count on success
+ * \retval negative number on error
+ */
static ssize_t
osp_lfsck_max_rpcs_in_flight_seq_write(struct file *file,
const char __user *buffer,
static ssize_t
osp_lfsck_max_rpcs_in_flight_seq_write(struct file *file,
const char __user *buffer,
LPROC_SEQ_FOPS_RO_TYPE(osp, server_uuid);
LPROC_SEQ_FOPS_RO_TYPE(osp, conn_uuid);
LPROC_SEQ_FOPS_RO_TYPE(osp, server_uuid);
LPROC_SEQ_FOPS_RO_TYPE(osp, conn_uuid);
+/**
+ * Show maximum pages per bulk RPC
+ *
+ * \param[in] m seq_file handle
+ * \param[in] data unused for single entry
+ * \retval 0 on success
+ * \retval negative number on error
+ */
static int osp_max_pages_per_rpc_seq_show(struct seq_file *m, void *v)
{
return lprocfs_obd_max_pages_per_rpc_seq_show(m, m->private);
static int osp_max_pages_per_rpc_seq_show(struct seq_file *m, void *v)
{
return lprocfs_obd_max_pages_per_rpc_seq_show(m, m->private);
+/**
+ * Initialize OSP lprocfs
+ *
+ * param[in] osp OSP device
+ */
void osp_lprocfs_init(struct osp_device *osp)
{
struct obd_device *obd = osp->opd_obd;
void osp_lprocfs_init(struct osp_device *osp)
{
struct obd_device *obd = osp->opd_obd;