1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2 * vim:expandtab:shiftwidth=8:tabstop=8:
4 * Copyright (C) 2001 Cluster File Systems, Inc. <info@clusterfs.com>
6 * This file is part of Lustre, http://www.lustre.org.
8 * Lustre is free software; you can redistribute it and/or
9 * modify it under the terms of version 2 of the GNU General Public
10 * License as published by the Free Software Foundation.
12 * Lustre is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Lustre; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Generic infrastructure for managing a collection of logs.
23 * These logs are used for:
25 * - orphan recovery: OST adds record on create
26 * - mtime/size consistency: the OST adds a record on first write
27 * - open/unlinked objects: OST adds a record on destroy
29 * - mds unlink log: the MDS adds an entry upon delete
31 * - raid1 replication log between OST's
32 * - MDS replication logs
38 #include <linux/lustre_idl.h>
40 struct obd_trans_info;
44 /* In-memory descriptor for a log object or log catalog */
46 struct list_head lgh_list;
47 struct llog_cookie lgh_cookie;
48 struct semaphore lgh_lock;
49 struct obd_device *lgh_obd;
51 struct file *lgh_file;
52 struct obd_uuid *lgh_tgtuuid;
53 struct llog_handle *lgh_current;
54 struct llog_handle *(*lgh_log_create)(struct obd_device *obd);
55 struct llog_handle *(*lgh_log_open)(struct obd_device *obd,
56 struct llog_cookie *logcookie);
57 int (*lgh_log_close)(struct llog_handle *cathandle,
58 struct llog_handle *loghandle);
62 extern int llog_add_record(struct llog_handle *cathandle,
63 struct llog_trans_hdr *rec,
64 struct llog_cookie *logcookies);
66 extern int llog_cancel_records(struct llog_handle *cathandle, int count,
67 struct llog_cookie *cookies);
69 extern struct llog_handle *llog_alloc_handle(void);
70 extern void llog_free_handle(struct llog_handle *handle);
71 extern int llog_init_catalog(struct llog_handle *cathandle,
72 struct obd_uuid *tgtuuid);
73 extern int llog_delete_log(struct llog_handle *cathandle,
74 struct llog_handle *loghandle);
75 extern int llog_close_log(struct llog_handle *cathandle,
76 struct llog_handle *loghandle);
77 extern struct llog_handle *llog_new_log(struct llog_handle *cathandle,
78 struct obd_uuid *tgtuuid);