- /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
- * Copyright (C) 2001 Cluster File Systems, Inc. <braam@clusterfs.com>
- *
- * This file is part of Lustre, http://www.lustre.org.
- *
- * Lustre is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
- *
- * Lustre 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 for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Lustre; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * lustre VFS/process permission interface
- */
-
- #ifndef __LVFS_H__
- #define __LVFS_H__
+/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
+ * vim:expandtab:shiftwidth=8:tabstop=8:
+ *
+ * Copyright (C) 2001 Cluster File Systems, Inc. <braam@clusterfs.com>
+ *
+ * This file is part of Lustre, http://www.lustre.org.
+ *
+ * Lustre is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * Lustre 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 for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Lustre; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * lustre VFS/process permission interface
+ */
+
+#ifndef __LVFS_H__
+#define __LVFS_H__
#include <libcfs/kp30.h>
#include <linux/lustre_ucache.h>
return dchild;
}
+/* Look up an entry by inode number. */
+/* this function ONLY returns valid dget'd dentries with an initialized inode
+ or errors */
+static inline struct dentry * ll_fid2dentry(struct dentry *parent,
+ __u64 ino, __u32 generation)
+{
+ char fid_name[32];
+ struct inode *inode;
+ struct dentry *result;
+
+ if (ino == 0)
+ RETURN(ERR_PTR(-ESTALE));
+
+ snprintf(fid_name, sizeof(fid_name), "0x%lx", (unsigned long)ino);
+
+ /* under ext3 this is neither supposed to return bad inodes
+ nor NULL inodes. */
+ result = ll_lookup_one_len(fid_name, parent, strlen(fid_name));
+ if (IS_ERR(result))
+ RETURN(result);
+
+ inode = result->d_inode;
+ if (!inode)
+ RETURN(ERR_PTR(-ENOENT));
+
+ if (inode->i_generation == 0 || inode->i_nlink == 0) {
+ LCONSOLE_WARN("Found inode with zero generation or link -- this"
+ " may indicate disk corruption (inode: %lu, link:"
+ " %lu, count: %d)\n", inode->i_ino,
+ (unsigned long)inode->i_nlink,
+ atomic_read(&inode->i_count));
+ dput(result);
+ RETURN(ERR_PTR(-ENOENT));
+ }
+
+ if (generation && inode->i_generation != generation) {
+ /* we didn't find the right inode.. */
+ CDEBUG(D_INODE, "found wrong generation: inode %lu, link: %lu, "
+ "count: %d, generation %u/%u\n", inode->i_ino,
+ (unsigned long)inode->i_nlink,
+ atomic_read(&inode->i_count), inode->i_generation,
+ generation);
+ dput(result);
+ RETURN(ERR_PTR(-ENOENT));
+ }
+
+ RETURN(result);
+}
+
static inline void ll_sleep(int t)
{
set_current_state(TASK_INTERRUPTIBLE);
*/
#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
+#define EXPORT_SYMTAB
#endif
#define DEBUG_SUBSYSTEM S_MGS
struct mgs_open_llog* find_mgs_open_llog(struct obd_device *obd, char *name)
{
- struct mgs_obd *mgs= &obd->u.mgs;
+ struct mgs_obd *mgs = &obd->u.mgs;
struct list_head *tmp;
struct mgs_open_llog *mol;
- char fsname[40];
+ char fsname[64];
char *p;
p = strrchr(name, '/');
return NULL;
}
+struct mgs_open_llog* create_mgs_open_llog(struct obd_device *obd, char *name)
+{
+ struct mgs_obd *mgs = &obd->u.mgs;
+ struct mgs_open_llog *mol, *tmp;
+ char *p;
+ int rc;
+
+ OBD_ALLOC(mol, sizeof(*mol));
+ if (!mol) {
+ CERROR("can not allocate memory for mgs_open_llog.\n");
+ return NULL;
+ }
+
+ p = strrchr(name, '/');
+ if (p != NULL)
+ strncpy(mol->mol_fsname, name, p - name);
+ else {
+ CERROR("logname need to include fsname.\n");
+ goto cleanup;
+ }
+
+ rc = mgs_load_system_db(obd, name, &mol->mol_system_db);
+ if (rc)
+ goto cleanup;
+
+ mol->mol_refs = 1;
+
+ spin_lock_init(&mol->mol_lock);
+
+ spin_lock(&mgs->mgs_open_llogs_lock);
+
+ tmp = find_mgs_open_llog(obd, name);
+ if(tmp) {
+ OBD_FREE(mol->mol_system_db, sizeof(struct system_db));
+ OBD_FREE(mol, sizeof(*mol));
+ mol = tmp;
+ } else
+ list_add(&mol->mol_list, &mgs->mgs_open_llogs);
+
+ spin_unlock(&mgs->mgs_open_llogs_lock);
+
+ return mol;
+
+cleanup:
+ OBD_FREE(mol, sizeof(*mol));
+ return NULL;
+}
+
+struct mgs_open_llog* open_mgs_open_llog(struct obd_device *obd, char *name)
+{
+ struct mgs_open_llog *mol;
+
+ mol = find_mgs_open_llog(obd, name);
+ if (!mol) {
+ mol = create_mgs_open_llog(obd, name);
+ return mol;
+ }
+
+ spin_lock(&mol->mol_lock);
+ mol->mol_refs++;
+ spin_unlock(&mol->mol_lock);
+
+ return mol;
+}
+
static int mgs_start_record(struct obd_device *obd,
struct llog_handle *llh, char *name)
{
static int mgs_do_record(struct obd_device *obd, struct llog_handle *llh,
void *cfg_buf)
{
-
struct lvfs_run_ctxt saved;
struct llog_rec_hdr rec;
int rc = 0;
RETURN(rc);
}
-static int mgs_llog_lvfs_write_blob(struct obd_device *obd, struct l_file *file,
- struct llog_rec_hdr *rec, void *buf, loff_t off)
-{
- int rc;
- struct llog_rec_tail end;
- loff_t saved_off = file->f_pos;
- int buflen = rec->lrh_len;
-
- ENTRY;
- file->f_pos = off;
-
- if (!buf) {
- rc = fsfilt_write_record(obd, file, rec, buflen,&file->f_pos,0);
- if (rc) {
- CERROR("error writing log record: rc %d\n", rc);
- goto out;
- }
- GOTO(out, rc = 0);
- }
-
- /* the buf case */
- rec->lrh_len = sizeof(*rec) + buflen + sizeof(end);
- rc = fsfilt_write_record(obd, file, rec, sizeof(*rec), &file->f_pos, 0);
- if (rc) {
- CERROR("error writing log hdr: rc %d\n", rc);
- goto out;
- }
-
- rc = fsfilt_write_record(obd, file, buf, buflen, &file->f_pos, 0);
- if (rc) {
- CERROR("error writing log buffer: rc %d\n", rc);
- goto out;
- }
-
- end.lrt_len = rec->lrh_len;
- end.lrt_index = rec->lrh_index;
- rc = fsfilt_write_record(obd, file, &end, sizeof(end), &file->f_pos, 0);
- if (rc) {
- CERROR("error writing log tail: rc %d\n", rc);
- goto out;
- }
-
- rc = 0;
- out:
- if (saved_off > file->f_pos)
- file->f_pos = saved_off;
- LASSERT(rc <= 0);
- RETURN(rc);
-}
-
-static int mgs_llog_lvfs_read_blob(struct obd_device *obd, struct l_file *file,
- void *buf, int size, loff_t off)
-{
- loff_t offset = off;
- int rc;
- ENTRY;
-
- rc = fsfilt_read_record(obd, file, buf, size, &offset);
- if (rc) {
- CERROR("error reading log record: rc %d\n", rc);
- RETURN(rc);
- }
- RETURN(0);
-}
-
static int mgs_llog_lvfs_read_header(struct llog_handle *handle)
{
struct obd_device *obd;
RETURN(LLOG_EEMPTY);
}
- rc = mgs_llog_lvfs_read_blob(obd, handle->lgh_file, handle->lgh_hdr,
+ rc = llog_lvfs_read_blob(obd, handle->lgh_file, handle->lgh_hdr,
LLOG_CHUNK_SIZE, 0);
if (rc) {
CERROR("error reading log header from %.*s\n",
RETURN(rc);
}
-/* returns negative in on error; 0 if success && reccookie == 0; 1 otherwise */
-/* appends if idx == -1, otherwise overwrites record idx. */
-static int mgs_llog_lvfs_write_rec(struct llog_handle *loghandle,
- struct llog_rec_hdr *rec,
- struct llog_cookie *reccookie, int cookiecount,
- void *buf, int idx)
+static int mgs_llog_lvfs_write_blob(struct obd_device *obd, struct l_file *file,
+ struct llog_rec_hdr *rec, void *buf, loff_t off)
{
- struct llog_log_hdr *llh;
- int reclen = rec->lrh_len, index, rc;
- struct llog_rec_tail *lrt;
- struct obd_device *obd;
- struct file *file;
- size_t left;
- ENTRY;
-
- llh = loghandle->lgh_hdr;
- file = loghandle->lgh_file;
- obd = loghandle->lgh_ctxt->loc_exp->exp_obd;
-
- /* record length should not bigger than LLOG_CHUNK_SIZE */
- if (buf)
- rc = (reclen > LLOG_CHUNK_SIZE - sizeof(struct llog_rec_hdr) -
- sizeof(struct llog_rec_tail)) ? -E2BIG : 0;
- else
- rc = (reclen > LLOG_CHUNK_SIZE) ? -E2BIG : 0;
- if (rc)
- RETURN(rc);
-
- if (idx != -1) {
- loff_t saved_offset;
-
- /* no header: only allowed to insert record 1 */
- if (idx != 1 && !file->f_dentry->d_inode->i_size) {
- CERROR("idx != -1 in empty log\n");
- LBUG();
- }
-
- if (idx && llh->llh_size && llh->llh_size != reclen)
- RETURN(-EINVAL);
+ int rc;
+ struct llog_rec_tail end;
+ loff_t saved_off = file->f_pos;
+ int buflen = rec->lrh_len;
- rc = mgs_llog_lvfs_write_blob(obd, file, &llh->llh_hdr, NULL, 0);
- /* we are done if we only write the header or on error */
- if (rc || idx == 0)
- RETURN(rc);
+ ENTRY;
+ file->f_pos = off;
- saved_offset = sizeof(*llh) + (idx-1)*rec->lrh_len;
- rc = mgs_llog_lvfs_write_blob(obd, file, rec, buf, saved_offset);
- if (rc == 0 && reccookie) {
- reccookie->lgc_lgl = loghandle->lgh_id;
- reccookie->lgc_index = idx;
- rc = 1;
+ if (!buf) {
+ rc = fsfilt_write_record(obd, file, rec, buflen,&file->f_pos,0);
+ if (rc) {
+ CERROR("error writing log record: rc %d\n", rc);
+ goto out;
}
- RETURN(rc);
+ GOTO(out, rc = 0);
}
- /* Make sure that records don't cross a chunk boundary, so we can
- * process them page-at-a-time if needed. If it will cross a chunk
- * boundary, write in a fake (but referenced) entry to pad the chunk.
- *
- * We know that llog_current_log() will return a loghandle that is
- * big enough to hold reclen, so all we care about is padding here.
- */
- left = LLOG_CHUNK_SIZE - (file->f_pos & (LLOG_CHUNK_SIZE - 1));
- if (buf)
- reclen = sizeof(*rec) + rec->lrh_len +
- sizeof(struct llog_rec_tail);
-
- /* NOTE: padding is a record, but no bit is set */
- if (left != 0 && left != reclen &&
- left < (reclen + LLOG_MIN_REC_SIZE)) {
- loghandle->lgh_last_idx++;
- rc = mgs_llog_lvfs_pad(obd, file, left, loghandle->lgh_last_idx);
- if (rc)
- RETURN(rc);
- /* if it's the last idx in log file, then return -ENOSPC */
- if (loghandle->lgh_last_idx == LLOG_BITMAP_SIZE(llh) - 1)
- RETURN(-ENOSPC);
+ /* the buf case */
+ rec->lrh_len = sizeof(*rec) + buflen + sizeof(end);
+ rc = fsfilt_write_record(obd, file, rec, sizeof(*rec), &file->f_pos, 0);
+ if (rc) {
+ CERROR("error writing log hdr: rc %d\n", rc);
+ goto out;
}
- loghandle->lgh_last_idx++;
- index = loghandle->lgh_last_idx;
- LASSERT(index < LLOG_BITMAP_SIZE(llh));
- rec->lrh_index = index;
- if (buf == NULL) {
- lrt = (struct llog_rec_tail *)
- ((char *)rec + rec->lrh_len - sizeof(*lrt));
- lrt->lrt_len = rec->lrh_len;
- lrt->lrt_index = rec->lrh_index;
+ rc = fsfilt_write_record(obd, file, buf, buflen, &file->f_pos, 0);
+ if (rc) {
+ CERROR("error writing log buffer: rc %d\n", rc);
+ goto out;
}
- if (ext2_set_bit(index, llh->llh_bitmap)) {
- CERROR("argh, index %u already set in log bitmap?\n", index);
- LBUG(); /* should never happen */
+
+ end.lrt_len = rec->lrh_len;
+ end.lrt_index = rec->lrh_index;
+ rc = fsfilt_write_record(obd, file, &end, sizeof(end), &file->f_pos, 0);
+ if (rc) {
+ CERROR("error writing log tail: rc %d\n", rc);
+ goto out;
}
- llh->llh_count++;
- llh->llh_tail.lrt_index = index;
- rc = mgs_llog_lvfs_write_blob(obd, file, &llh->llh_hdr, NULL, 0);
- if (rc)
- RETURN(rc);
+ rc = 0;
+ out:
+ if (saved_off > file->f_pos)
+ file->f_pos = saved_off;
+ LASSERT(rc <= 0);
+ RETURN(rc);
+}
- rc = mgs_llog_lvfs_write_blob(obd, file, rec, buf, file->f_pos);
- if (rc)
- RETURN(rc);
+static int mgs_llog_lvfs_read_blob(struct obd_device *obd, struct l_file *file,
+ void *buf, int size, loff_t off)
+{
+ loff_t offset = off;
+ int rc;
+ ENTRY;
- CDEBUG(D_HA, "added record "LPX64": idx: %u, %u bytes\n",
- loghandle->lgh_id.lgl_oid, index, rec->lrh_len);
- if (rc == 0 && reccookie) {
- reccookie->lgc_lgl = loghandle->lgh_id;
- reccookie->lgc_index = index;
- if ((rec->lrh_type == MDS_UNLINK_REC) ||
- (rec->lrh_type == MDS_SETATTR_REC))
- reccookie->lgc_subsys = LLOG_MDS_OST_ORIG_CTXT;
- else if (rec->lrh_type == OST_SZ_REC)
- reccookie->lgc_subsys = LLOG_SIZE_ORIG_CTXT;
- else if (rec->lrh_type == OST_RAID1_REC)
- reccookie->lgc_subsys = LLOG_RD1_ORIG_CTXT;
- else
- reccookie->lgc_subsys = -1;
- rc = 1;
+ rc = fsfilt_read_record(obd, file, buf, size, &offset);
+ if (rc) {
+ CERROR("error reading log record: rc %d\n", rc);
+ RETURN(rc);
}
- if (rc == 0 && rec->lrh_type == LLOG_GEN_REC)
- rc = 1;
-
- RETURN(rc);
+ RETURN(0);
}
/* We can skip reading at least as many log blocks as the number of
~(LLOG_CHUNK_SIZE - 1);
}
-
-/* sets:
- * - cur_offset to the furthest point read in the log file
- * - cur_idx to the log index preceeding cur_offset
- * returns -EIO/-EINVAL on error
- */
-static int mgs_llog_lvfs_next_block(struct llog_handle *loghandle, int *cur_idx,
- int next_idx, __u64 *cur_offset, void *buf,
- int len)
+static struct dentry *
+mgs_lvfs_logid2dentry(struct obd_device *obd, struct dentry *parent,
+ struct llog_logid *logid)
{
- int rc;
- ENTRY;
-
- if (len == 0 || len & (LLOG_CHUNK_SIZE - 1))
- RETURN(-EINVAL);
-
- CDEBUG(D_OTHER, "looking for log index %u (cur idx %u off "LPU64")\n",
- next_idx, *cur_idx, *cur_offset);
-
- while (*cur_offset < loghandle->lgh_file->f_dentry->d_inode->i_size) {
- struct llog_rec_hdr *rec;
- struct llog_rec_tail *tail;
- loff_t ppos;
-
- llog_skip_over(cur_offset, *cur_idx, next_idx);
-
- ppos = *cur_offset;
- rc = fsfilt_read_record(loghandle->lgh_ctxt->loc_exp->exp_obd,
- loghandle->lgh_file, buf, len,
- &ppos);
-
- if (rc) {
- CERROR("Cant read llog block at log id "LPU64
- "/%u offset "LPU64"\n",
- loghandle->lgh_id.lgl_oid,
- loghandle->lgh_id.lgl_ogen,
- *cur_offset);
- RETURN(rc);
- }
-
- /* put number of bytes read into rc to make code simpler */
- rc = ppos - *cur_offset;
- *cur_offset = ppos;
-
- if (rc == 0) /* end of file, nothing to do */
- RETURN(0);
-
- if (rc < sizeof(*tail)) {
- CERROR("Invalid llog block at log id "LPU64"/%u offset "
- LPU64"\n", loghandle->lgh_id.lgl_oid,
- loghandle->lgh_id.lgl_ogen, *cur_offset);
- RETURN(-EINVAL);
- }
-
- rec = buf;
- tail = (struct llog_rec_tail *)((char *)buf + rc -
- sizeof(struct llog_rec_tail));
-
- if (LLOG_REC_HDR_NEEDS_SWABBING(rec)) {
- lustre_swab_llog_rec(rec, tail);
- }
+ struct mgs_obd *mgs = &obd->u.mgs;
+ struct ll_fid fid;
+ fid.id = logid->lgl_oid;
+ fid.generation = logid->lgl_ogen;
- *cur_idx = tail->lrt_index;
+ CDEBUG(D_DENTRY, "--> mgs_logid2dentry: ino/gen %lu/%u, sb %p\n",
+ fid.id, fid.generation, mgs->mgs_sb);
- /* this shouldn't happen */
- if (tail->lrt_index == 0) {
- CERROR("Invalid llog tail at log id "LPU64"/%u offset "
- LPU64"\n", loghandle->lgh_id.lgl_oid,
- loghandle->lgh_id.lgl_ogen, *cur_offset);
- RETURN(-EINVAL);
- }
- if (tail->lrt_index < next_idx)
- continue;
-
- /* sanity check that the start of the new buffer is no farther
- * than the record that we wanted. This shouldn't happen. */
- if (rec->lrh_index > next_idx) {
- CERROR("missed desired record? %u > %u\n",
- rec->lrh_index, next_idx);
- RETURN(-ENOENT);
- }
- RETURN(0);
- }
- RETURN(-EIO);
+ return ll_fid2dentry(parent, fid.id, fid.generation);
}
static struct file *llog_filp_open(char *name, int flags, int mode)
/* This is a callback from the llog_* functions.
* Assumes caller has already pushed us into the kernel context. */
-static int mgs_llog_lvfs_create(struct llog_ctxt *ctxt, struct llog_handle **res,
- struct llog_logid *logid, char *name)
+static int mgs_llog_lvfs_create(struct llog_ctxt *ctxt,
+ struct llog_handle **res,
+ struct llog_logid *logid, char *name)
{
struct llog_handle *handle;
struct obd_device *obd;
struct l_dentry *dchild = NULL;
- struct obdo *oa = NULL;
int rc = 0, cleanup_phase = 1;
int open_flags = O_RDWR | O_CREAT | O_LARGEFILE;
ENTRY;
obd = ctxt->loc_exp->exp_obd;
if (logid != NULL) {
- dchild = obd_lvfs_fid2dentry(ctxt->loc_exp, logid->lgl_oid,
- logid->lgl_ogen, logid->lgl_ogr);
+ struct mgs_open_llog *mol = find_mgs_open_llog(obd, name);
+ if (!mol) {
+ CERROR("can not find mgs_open_llog: %s\n", name);
+ GOTO(cleanup, -EINVAL);
+ }
+
+ dchild = mgs_logid2dentry(obd, mol->mol_dentry, logid);
if (IS_ERR(dchild)) {
rc = PTR_ERR(dchild);
}
handle->lgh_file = l_dentry_open(&obd->obd_lvfs_ctxt, dchild,
- O_RDWR | O_LARGEFILE);
+ O_RDWR | O_LARGEFILE);
if (IS_ERR(handle->lgh_file)) {
rc = PTR_ERR(handle->lgh_file);
CERROR("error opening logfile "LPX64"0x%x: rc %d\n",
handle->lgh_file->f_dentry->d_inode->i_ino;
handle->lgh_id.lgl_ogen =
handle->lgh_file->f_dentry->d_inode->i_generation;
-
- } else {
- oa = obdo_alloc();
- if (oa == NULL)
- GOTO(cleanup, rc = -ENOMEM);
- /* XXX get some filter group constants */
- oa->o_gr = 1;
- oa->o_valid = OBD_MD_FLGENER | OBD_MD_FLGROUP;
- rc = obd_create(ctxt->loc_exp, oa, NULL, NULL);
- if (rc)
- GOTO(cleanup, rc);
-
- dchild = obd_lvfs_fid2dentry(ctxt->loc_exp, oa->o_id,
- oa->o_generation, oa->o_gr);
- if (IS_ERR(dchild))
- GOTO(cleanup, rc = PTR_ERR(dchild));
- cleanup_phase = 2;
- handle->lgh_file = l_dentry_open(&obd->obd_lvfs_ctxt, dchild,
- open_flags);
- if (IS_ERR(handle->lgh_file))
- GOTO(cleanup, rc = PTR_ERR(handle->lgh_file));
-
- handle->lgh_id.lgl_ogr = oa->o_gr;
- handle->lgh_id.lgl_oid = oa->o_id;
- handle->lgh_id.lgl_ogen = oa->o_generation;
+ rc = open_mgs_open_llog(obd, name);
+ if (rc) {
+ CERROR("can not open mgs_open_llog (%s): rc %d\n",
+ name, rc);
+ GOTO(cleanup, rc);
+ }
+ } else {
+ CERROR("No llog id and llog name be specified.\n");
+ GOTO(cleanup, rc = -EINVAL);
}
handle->lgh_ctxt = ctxt;
- finish:
- if (oa)
- obdo_free(oa);
+
+finish:
RETURN(rc);
cleanup:
switch (cleanup_phase) {
goto finish;
}
-static int mgs_llog_lvfs_close(struct llog_handle *handle)
-{
- int rc;
- ENTRY;
-
- rc = filp_close(handle->lgh_file, 0);
- if (rc)
- CERROR("error closing log: rc %d\n", rc);
- RETURN(rc);
-}
static int mgs_llog_lvfs_destroy(struct llog_handle *handle)
{
}
struct llog_operations mgs_llog_lvfs_ops = {
- lop_write_rec: mgs_llog_lvfs_write_rec,
- lop_next_block: mgs_llog_lvfs_next_block,
- lop_read_header: mgs_llog_lvfs_read_header,
lop_create: mgs_llog_lvfs_create,
- lop_destroy: mgs_llog_lvfs_destroy,
- lop_close: mgs_llog_lvfs_close,
+ lop_read_header: mgs_llog_lvfs_read_header,
+ lop_write_rec: llog_lvfs_write_rec,
+ lop_next_block: llog_lvfs_next_block,
+ lop_destroy: llog_lvfs_destroy,
+ lop_close: llog_lvfs_close,
// lop_cancel: llog_lvfs_cancel,
};
}
static int mgs_llog_lvfs_write_rec(struct llog_handle *loghandle,
- struct llog_rec_hdr *rec,
- struct llog_cookie *reccookie, int cookiecount,
- void *buf, int idx)
+ struct llog_rec_hdr *rec,
+ struct llog_cookie *reccookie, int cookiecount,
+ void *buf, int idx)
{
LBUG();
return 0;
}
struct llog_operations mgs_llog_lvfs_ops = {
- lop_write_rec: mgs_llog_lvfs_write_rec,
- lop_next_block: mgs_llog_lvfs_next_block,
- lop_read_header: mgs_llog_lvfs_read_header,
+ lop_write_rec: llog_lvfs_ops.lop_write_rec,
+ lop_next_block: llog_lvfs_ops.lop_next_block,
+ lop_read_header: llog_lvfs_ops.lop_read_header,
lop_create: mgs_llog_lvfs_create,
lop_destroy: mgs_llog_lvfs_destroy,
lop_close: mgs_llog_lvfs_close,