-static struct llog_handle *filter_log_create(struct obd_device *obd);
-
-/* This is a callback from the llog_* functions.
- * Assumes caller has already pushed us into the kernel context. */
-static int filter_log_close(struct llog_handle *cathandle,
- struct llog_handle *loghandle)
-{
- struct llog_object_hdr *llh = loghandle->lgh_hdr;
- struct file *file = loghandle->lgh_file;
- struct dentry *dparent = NULL, *dchild = NULL;
- struct lustre_handle parent_lockh;
- struct llog_logid *lgl = &loghandle->lgh_cookie.lgc_lgl;
- int rc;
- ENTRY;
-
- /* If we are going to delete this log, grab a ref before we close
- * it so we don't have to immediately do another lookup. */
- if (llh->llh_hdr.lth_type != LLOG_CATALOG_MAGIC && llh->llh_count == 0){
- CDEBUG(D_INODE, "deleting log file "LPX64":%x\n",
- lgl->lgl_oid, lgl->lgl_ogen);
- dparent = filter_parent_lock(loghandle->lgh_obd, S_IFREG,
- lgl->lgl_oid,LCK_PW,&parent_lockh);
- if (IS_ERR(dparent)) {
- rc = PTR_ERR(dparent);
- CERROR("error locking parent, orphan log %*s: rc %d\n",
- file->f_dentry->d_name.len,
- file->f_dentry->d_name.name, rc);
- RETURN(rc);
- } else {
- dchild = dget(file->f_dentry);
- llog_delete_log(cathandle, loghandle);
- }
- } else {
- CDEBUG(D_INODE, "closing log file "LPX64":%x\n",
- lgl->lgl_oid, lgl->lgl_ogen);
- }
-
- rc = filp_close(file, 0);
-
- llog_free_handle(loghandle); /* also removes loghandle from list */
-
- if (dchild != NULL) {
- int err = vfs_unlink(dparent->d_inode, dchild);
- if (err) {
- CERROR("error unlinking empty log %*s: rc %d\n",
- dchild->d_name.len, dchild->d_name.name, err);
- if (!rc)
- rc = err;
- }
- f_dput(dchild);
- ldlm_lock_decref(&parent_lockh, LCK_PW);
- }
- RETURN(rc);
-}
-
-/* This is a callback from the llog_* functions.
- * Assumes caller has already pushed us into the kernel context. */
-static struct llog_handle *filter_log_open(struct obd_device *obd,
- struct llog_cookie *logcookie)