1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2005 Cluster File Systems, Inc.
6 * This file is part of the Lustre file system, http://www.lustre.org
7 * Lustre is a trademark of Cluster File Systems, Inc.
9 * You may have signed or agreed to another license before downloading
10 * this software. If so, you are bound by the terms and conditions
11 * of that agreement, and the following does not apply to you. See the
12 * LICENSE file included with this distribution for more information.
14 * If you did not agree to a different license, then this copy of Lustre
15 * is open source software; you can redistribute it and/or modify it
16 * under the terms of version 2 of the GNU General Public License as
17 * published by the Free Software Foundation.
19 * In either case, Lustre is distributed in the hope that it will be
20 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
21 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * license text for more details.
25 void commit_add(struct )
27 struct obd_import *import = commit_uuid2import(rec-> uuid);
30 CERROR("unaware of OST UUID %s - dorpping\n", rec-> uuid);
35 spin_lock(&import->llcconf_lock);
36 list_add(&rec-> &import);
37 spin_unlock(&import->llcconf_lock);
42 void commit_confd_conf_import(struct obd_import *import,
43 struct llog_commit_confirm_daemon *lccd)
45 struct list_head *tmp, *save;
48 list_for_each_safe(&import->import_cc_list, tmp, save) {
49 struct llog_canceld_ctxt *cd;
51 if (atomic_read(import->import_cc_count) <=
52 lccd->llcconf_lowwater)
55 cd = list_entry(tmp, struct llog_canceld_ctxt *, llcconf_entry);
56 atomic_dec(&import->import_cc_count);
57 commit_confd_add_and_fire(cd);
64 int commit_confd_main(void *data)
66 struct llog_commit_confirm_daemon *lccd = data;
69 /* something has happened */
72 if (lccd->flags & LCCD_STOP)
76 /* lock llccd imporlist */
77 spin_lock(&lccd->llcconf_lock);
78 list_for_each_safe(&lccd->llcconf_list, ) {
79 struct obd_import *import;
80 import = list_entry(&lccd->llcconf_list,
84 spin_unlock(&lccd->llcconf_lock);
85 if (atomic_read(import->import_cc_count) >
86 lccd->llcconf_highwater)
87 commit_confd_conf_import(import);
89 spin_lock(&lccd->llcconf_lock);
92 spin_unlock(&lccd->llcconf_lock);
96 lccd->flags = LCCD_STOPPED;