remaining modifying VFS ops.
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $DragonFly: src/sys/kern/vfs_jops.c,v 1.4 2004/12/30 21:41:04 dillon Exp $
+ * $DragonFly: src/sys/kern/vfs_jops.c,v 1.5 2004/12/31 23:48:08 dillon Exp $
*/
/*
* Each mount point may have zero or more independantly configured journals
static void jrecord_write_vattr(struct jrecord *jrec, struct vattr *vat);
+static int journal_setattr(struct vop_setattr_args *ap);
+static int journal_write(struct vop_write_args *ap);
+static int journal_fsync(struct vop_fsync_args *ap);
+static int journal_putpages(struct vop_putpages_args *ap);
+static int journal_setacl(struct vop_setacl_args *ap);
+static int journal_setextattr(struct vop_setextattr_args *ap);
+static int journal_ncreate(struct vop_ncreate_args *ap);
+static int journal_nmknod(struct vop_nmknod_args *ap);
+static int journal_nlink(struct vop_nlink_args *ap);
+static int journal_nsymlink(struct vop_nsymlink_args *ap);
+static int journal_nwhiteout(struct vop_nwhiteout_args *ap);
+static int journal_nremove(struct vop_nremove_args *ap);
static int journal_nmkdir(struct vop_nmkdir_args *ap);
+static int journal_nrmdir(struct vop_nrmdir_args *ap);
+static int journal_nrename(struct vop_nrename_args *ap);
static struct vnodeopv_entry_desc journal_vnodeop_entries[] = {
{ &vop_default_desc, vop_journal_operate_ap },
{ &vop_mountctl_desc, (void *)journal_mountctl },
+ { &vop_setattr_desc, (void *)journal_setattr },
+ { &vop_write_desc, (void *)journal_write },
+ { &vop_fsync_desc, (void *)journal_fsync },
+ { &vop_putpages_desc, (void *)journal_putpages },
+ { &vop_setacl_desc, (void *)journal_setacl },
+ { &vop_setextattr_desc, (void *)journal_setextattr },
+ { &vop_ncreate_desc, (void *)journal_ncreate },
+ { &vop_nmknod_desc, (void *)journal_nmknod },
+ { &vop_nlink_desc, (void *)journal_nlink },
+ { &vop_nsymlink_desc, (void *)journal_nsymlink },
+ { &vop_nwhiteout_desc, (void *)journal_nwhiteout },
+ { &vop_nremove_desc, (void *)journal_nremove },
{ &vop_nmkdir_desc, (void *)journal_nmkdir },
+ { &vop_nrmdir_desc, (void *)journal_nrmdir },
+ { &vop_nrename_desc, (void *)journal_nrename },
{ NULL, NULL }
};
* XXX notification on failure
* XXX two-way acknowledgement stream in the return direction / xindex
*/
+ printf("write @%d,%d\n", jo->fifo.rindex & jo->fifo.mask, bytes);
bytes = res;
error = fp_write(jo->fp,
jo->fifo.membase + (jo->fifo.rindex & jo->fifo.mask),
/************************************************************************
* JOURNAL VNOPS *
- ************************************************************************/
+ ************************************************************************
+ *
+ * These are function shims replacing the normal filesystem ops. We become
+ * responsible for calling the underlying filesystem ops. We have the choice
+ * of executing the underlying op first and then generating the journal entry,
+ * or starting the journal entry, executing the underlying op, and then
+ * either completing or aborting it.
+ *
+ * The journal is supposed to be a high-level entity, which generally means
+ * identifying files by name rather then by inode. Supplying both allows
+ * the journal to be used both for inode-number-compatible 'mirrors' and
+ * for simple filesystem replication.
+ *
+ * Writes are particularly difficult to deal with because a single write may
+ * represent a hundred megabyte buffer or more, and both writes and truncations
+ * require the 'old' data to be written out as well as the new data if the
+ * log is reversable. Other issues:
+ *
+ * - How to deal with operations on unlinked files (no path available),
+ * but which may still be filesystem visible due to hard links.
+ *
+ * - How to deal with modifications made via a memory map.
+ *
+ * - Future cache coherency support will require cache coherency API calls
+ * both prior to and after the call to the underlying VFS.
+ *
+ * ALSO NOTE: We do not have to shim compatibility VOPs like MKDIR which have
+ * new VFS equivalents (NMKDIR).
+ */
+
+static
+int
+journal_setattr(struct vop_setattr_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_SETATTR);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_write(struct vop_write_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_WRITE);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_fsync(struct vop_fsync_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ /* XXX synchronize pending journal records */
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_putpages(struct vop_putpages_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_PUTPAGES);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_setacl(struct vop_setacl_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_SETACL);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_setextattr(struct vop_setextattr_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_SETEXTATTR);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_ncreate(struct vop_ncreate_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_CREATE);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_nmknod(struct vop_nmknod_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_MKNOD);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_nlink(struct vop_nlink_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_LINK);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_nsymlink(struct vop_nsymlink_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_SYMLINK);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_nwhiteout(struct vop_nwhiteout_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_WHITEOUT);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_nremove(struct vop_nremove_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_REMOVE);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
static
int
return (error);
}
+
+static
+int
+journal_nrmdir(struct vop_nrmdir_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_RMDIR);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_nrename(struct vop_nrename_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_RENAME);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $DragonFly: src/sys/kern/vfs_journal.c,v 1.4 2004/12/30 21:41:04 dillon Exp $
+ * $DragonFly: src/sys/kern/vfs_journal.c,v 1.5 2004/12/31 23:48:08 dillon Exp $
*/
/*
* Each mount point may have zero or more independantly configured journals
static void jrecord_write_vattr(struct jrecord *jrec, struct vattr *vat);
+static int journal_setattr(struct vop_setattr_args *ap);
+static int journal_write(struct vop_write_args *ap);
+static int journal_fsync(struct vop_fsync_args *ap);
+static int journal_putpages(struct vop_putpages_args *ap);
+static int journal_setacl(struct vop_setacl_args *ap);
+static int journal_setextattr(struct vop_setextattr_args *ap);
+static int journal_ncreate(struct vop_ncreate_args *ap);
+static int journal_nmknod(struct vop_nmknod_args *ap);
+static int journal_nlink(struct vop_nlink_args *ap);
+static int journal_nsymlink(struct vop_nsymlink_args *ap);
+static int journal_nwhiteout(struct vop_nwhiteout_args *ap);
+static int journal_nremove(struct vop_nremove_args *ap);
static int journal_nmkdir(struct vop_nmkdir_args *ap);
+static int journal_nrmdir(struct vop_nrmdir_args *ap);
+static int journal_nrename(struct vop_nrename_args *ap);
static struct vnodeopv_entry_desc journal_vnodeop_entries[] = {
{ &vop_default_desc, vop_journal_operate_ap },
{ &vop_mountctl_desc, (void *)journal_mountctl },
+ { &vop_setattr_desc, (void *)journal_setattr },
+ { &vop_write_desc, (void *)journal_write },
+ { &vop_fsync_desc, (void *)journal_fsync },
+ { &vop_putpages_desc, (void *)journal_putpages },
+ { &vop_setacl_desc, (void *)journal_setacl },
+ { &vop_setextattr_desc, (void *)journal_setextattr },
+ { &vop_ncreate_desc, (void *)journal_ncreate },
+ { &vop_nmknod_desc, (void *)journal_nmknod },
+ { &vop_nlink_desc, (void *)journal_nlink },
+ { &vop_nsymlink_desc, (void *)journal_nsymlink },
+ { &vop_nwhiteout_desc, (void *)journal_nwhiteout },
+ { &vop_nremove_desc, (void *)journal_nremove },
{ &vop_nmkdir_desc, (void *)journal_nmkdir },
+ { &vop_nrmdir_desc, (void *)journal_nrmdir },
+ { &vop_nrename_desc, (void *)journal_nrename },
{ NULL, NULL }
};
* XXX notification on failure
* XXX two-way acknowledgement stream in the return direction / xindex
*/
+ printf("write @%d,%d\n", jo->fifo.rindex & jo->fifo.mask, bytes);
bytes = res;
error = fp_write(jo->fp,
jo->fifo.membase + (jo->fifo.rindex & jo->fifo.mask),
/************************************************************************
* JOURNAL VNOPS *
- ************************************************************************/
+ ************************************************************************
+ *
+ * These are function shims replacing the normal filesystem ops. We become
+ * responsible for calling the underlying filesystem ops. We have the choice
+ * of executing the underlying op first and then generating the journal entry,
+ * or starting the journal entry, executing the underlying op, and then
+ * either completing or aborting it.
+ *
+ * The journal is supposed to be a high-level entity, which generally means
+ * identifying files by name rather then by inode. Supplying both allows
+ * the journal to be used both for inode-number-compatible 'mirrors' and
+ * for simple filesystem replication.
+ *
+ * Writes are particularly difficult to deal with because a single write may
+ * represent a hundred megabyte buffer or more, and both writes and truncations
+ * require the 'old' data to be written out as well as the new data if the
+ * log is reversable. Other issues:
+ *
+ * - How to deal with operations on unlinked files (no path available),
+ * but which may still be filesystem visible due to hard links.
+ *
+ * - How to deal with modifications made via a memory map.
+ *
+ * - Future cache coherency support will require cache coherency API calls
+ * both prior to and after the call to the underlying VFS.
+ *
+ * ALSO NOTE: We do not have to shim compatibility VOPs like MKDIR which have
+ * new VFS equivalents (NMKDIR).
+ */
+
+static
+int
+journal_setattr(struct vop_setattr_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_SETATTR);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_write(struct vop_write_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_WRITE);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_fsync(struct vop_fsync_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ /* XXX synchronize pending journal records */
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_putpages(struct vop_putpages_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_PUTPAGES);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_setacl(struct vop_setacl_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_SETACL);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_setextattr(struct vop_setextattr_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_SETEXTATTR);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_ncreate(struct vop_ncreate_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_CREATE);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_nmknod(struct vop_nmknod_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_MKNOD);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_nlink(struct vop_nlink_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_LINK);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_nsymlink(struct vop_nsymlink_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_SYMLINK);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_nwhiteout(struct vop_nwhiteout_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_WHITEOUT);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_nremove(struct vop_nremove_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_REMOVE);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
static
int
return (error);
}
+
+static
+int
+journal_nrmdir(struct vop_nrmdir_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_RMDIR);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
+static
+int
+journal_nrename(struct vop_nrename_args *ap)
+{
+ struct mount *mp;
+ struct journal *jo;
+ struct jrecord jrec;
+ void *save; /* warning, save pointers do not always remain valid */
+ int error;
+
+ error = vop_journal_operate_ap(&ap->a_head);
+ mp = ap->a_head.a_ops->vv_mount;
+ if (error == 0) {
+ TAILQ_FOREACH(jo, &mp->mnt_jlist, jentry) {
+ jrecord_init(jo, &jrec, -1);
+ save = jrecord_push(&jrec, JTYPE_RENAME);
+ jrecord_pop(&jrec, save);
+ jrecord_done(&jrec, 0);
+ }
+ }
+ return (error);
+}
+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $DragonFly: src/sys/sys/mountctl.h,v 1.3 2004/12/30 21:41:06 dillon Exp $
+ * $DragonFly: src/sys/sys/mountctl.h,v 1.4 2004/12/31 23:48:06 dillon Exp $
*/
/*
#define JTYPE_UNDO (JMASK_NESTED|0x0004)
#define JTYPE_AUDIT (JMASK_NESTED|0x0005)
-#define JTYPE_MKDIR (JMASK_NESTED|0x0006)
+#define JTYPE_SETATTR (JMASK_NESTED|0x0010)
+#define JTYPE_WRITE (JMASK_NESTED|0x0011)
+#define JTYPE_PUTPAGES (JMASK_NESTED|0x0012)
+#define JTYPE_SETACL (JMASK_NESTED|0x0013)
+#define JTYPE_SETEXTATTR (JMASK_NESTED|0x0014)
+#define JTYPE_CREATE (JMASK_NESTED|0x0015)
+#define JTYPE_MKNOD (JMASK_NESTED|0x0016)
+#define JTYPE_LINK (JMASK_NESTED|0x0017)
+#define JTYPE_SYMLINK (JMASK_NESTED|0x0018)
+#define JTYPE_WHITEOUT (JMASK_NESTED|0x0019)
+#define JTYPE_REMOVE (JMASK_NESTED|0x001A)
+#define JTYPE_MKDIR (JMASK_NESTED|0x001B)
+#define JTYPE_RMDIR (JMASK_NESTED|0x001C)
+#define JTYPE_RENAME (JMASK_NESTED|0x001D)
/*
* Low level record types