Skip to content
Snippets Groups Projects
Commit f202fafd authored by Yury Umanets's avatar Yury Umanets
Browse files

- removed old trash which probably was committed along with copyrighting effort.

parent 4b531a51
No related branches found
No related tags found
No related merge requests found
/* -*- 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.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License version 2 for more details (a copy is included
* in the LICENSE file that accompanied this code).
*
* 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.
*
* GPL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved
* Use is subject to license terms.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*
* lustre/include/lustre_commit_confd.h
*
* Structures relating to the log commit thread.
*/
#ifndef _LUSTRE_COMMIT_CONFD_H
#define _LUSTRE_COMMIT_CONFD_H
#include <lustre_log.h>
struct llog_canceld_ctxt {
struct list_head llcd_list; /* free or pending struct list */
struct llog_ctxt *llcd_ctxt;
struct llog_commit_master *llcd_lcm;
int llcd_size;
int llcd_cookiebytes;
struct llog_cookie llcd_cookies[0];
};
struct llog_commit_master {
struct list_head lcm_thread_busy; /* list of busy daemons */
struct list_head lcm_thread_idle; /* list of idle daemons */
spinlock_t lcm_thread_lock; /* protects thread_list */
atomic_t lcm_thread_numidle;/* number of idle threads */
atomic_t lcm_thread_total; /* total number of threads */
int lcm_thread_max; /* <= num_osts normally */
int lcm_flags;
cfs_waitq_t lcm_waitq;
struct list_head lcm_llcd_pending; /* llog_canceld_ctxt to send */
struct list_head lcm_llcd_resend; /* try to resend this data */
struct list_head lcm_llcd_free; /* free llog_canceld_ctxt */
spinlock_t lcm_llcd_lock; /* protects llcd_free */
atomic_t lcm_llcd_numfree; /* items on llcd_free */
int lcm_llcd_minfree; /* min free on llcd_free */
int lcm_llcd_maxfree; /* max free on llcd_free */
};
#define LLOG_LCM_FL_EXIT 0x01
#define LLOG_LCM_FL_EXIT_FORCE 0x02
/* the thread data that collects local commits and makes rpc's */
struct llog_commit_daemon {
struct list_head lcd_lcm_list; /* list of daemon threads */
struct list_head lcd_llcd_list; /* list of pending RPCs */
struct llog_commit_master *lcd_lcm; /* pointer back to parent */
int lcd_index; /* the index of the llog daemon */
};
/* ptlrpc/recov_thread.c */
int llog_start_commit_thread(struct llog_commit_master *);
int llog_init_commit_master(struct llog_commit_master *);
int llog_cleanup_commit_master(struct llog_commit_master *lcm, int force);
#endif /* _LUSTRE_COMMIT_CONFD_H */
/* -*- 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.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 only,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License version 2 for more details (a copy is included
* in the LICENSE file that accompanied this code).
*
* 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.
*
* GPL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved
* Use is subject to license terms.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
* Lustre is a trademark of Sun Microsystems, Inc.
*/
void commit_add(struct )
{
struct obd_import *import = commit_uuid2import(rec-> uuid);
if (!import) {
CERROR("unaware of OST UUID %s - dorpping\n", rec-> uuid);
EXIT;
return;
}
spin_lock(&import->llcconf_lock);
list_add(&rec-> &import);
spin_unlock(&import->llcconf_lock);
EXIT;
return;
}
void commit_confd_conf_import(struct obd_import *import,
struct llog_commit_confirm_daemon *lccd)
{
struct list_head *tmp, *save;
list_for_each_safe(&import->import_cc_list, tmp, save) {
struct llog_canceld_ctxt *cd;
if (atomic_read(import->import_cc_count) <=
lccd->llcconf_lowwater)
break;
cd = list_entry(tmp, struct llog_canceld_ctxt *, llcconf_entry);
atomic_dec(&import->import_cc_count);
commit_confd_add_and_fire(cd);
}
EXIT;
return;
}
int commit_confd_main(void *data)
{
struct llog_commit_confirm_daemon *lccd = data;
while (1) {
/* something has happened */
event_wait();
if (lccd->flags & LCCD_STOP)
break;
/* lock llccd imporlist */
spin_lock(&lccd->llcconf_lock);
list_for_each_safe(&lccd->llcconf_list, ) {
struct obd_import *import;
import = list_entry(&lccd->llcconf_list,
struct obd_import,
import_entry);
get_import(import);
spin_unlock(&lccd->llcconf_lock);
if (atomic_read(import->import_cc_count) >
lccd->llcconf_highwater)
commit_confd_conf_import(import);
put_import(import);
spin_lock(&lccd->llcconf_lock);
}
spin_unlock(&lccd->llcconf_lock);
}
lccd->flags = LCCD_STOPPED;
RETURN(0);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment