+ check_mini_fo_dentry(dentry);
+ if(dtost(dentry) == MODIFIED || dtost(dentry) == CREATED || dtost(dentry) == DEL_REWRITTEN)
+ return 1;
+ check_mini_fo_dentry(dentry);
+ if(dtost(dentry) == MODIFIED || dtost(dentry) == CREATED || dtost(dentry) == DEL_REWRITTEN)
+ return 1;
+ * dentry, what is required for many create like options.
+ * It will create the storage structure if necessary.
+ */
+ * dentry, what is required for many create like options.
+ * It will create the storage structure if necessary.
+ */
+ if(dtost(dentry->d_parent) == UNMODIFIED) {
+ /* build sto struct */
+ err = build_sto_structure(dentry->d_parent->d_parent, dentry->d_parent);
+ if(dtost(dentry->d_parent) == UNMODIFIED) {
+ /* build sto struct */
+ err = build_sto_structure(dentry->d_parent->d_parent, dentry->d_parent);
+ dtost(dentry->d_parent) != MODIFIED) {
+ printk(KERN_CRIT "mini_fo: get_neg_sto_dentry: ERROR building sto structure.\n");
+ err = -1;
+ goto out;
+ dtost(dentry->d_parent) != MODIFIED) {
+ printk(KERN_CRIT "mini_fo: get_neg_sto_dentry: ERROR building sto structure.\n");
+ err = -1;
+ goto out;
+ ASSERT(dentry != NULL);
+ ASSERT(dtopd(dentry) != NULL);
+ ASSERT((dtohd(dentry) != NULL) || (dtohd2(dentry) != NULL));
+ ASSERT(dentry != NULL);
+ ASSERT(dtopd(dentry) != NULL);
+ ASSERT((dtohd(dentry) != NULL) || (dtohd2(dentry) != NULL));
+/* if(dtost(dentry) == MODIFIED) { */
+/* ASSERT(dentry->d_inode != NULL); */
+/* ASSERT(dtohd(dentry) != NULL); */
+/* if(dtost(dentry) == MODIFIED) { */
+/* ASSERT(dentry->d_inode != NULL); */
+/* ASSERT(dtohd(dentry) != NULL); */
+ * if(S_ISDIR(file->f_dentry->d_inode->i_mode)) {}
+ */
+ ASSERT((ftohf(file) != NULL) || (ftohf2(file) != NULL));
+ * if(S_ISDIR(file->f_dentry->d_inode->i_mode)) {}
+ */
+ ASSERT((ftohf(file) != NULL) || (ftohf2(file) != NULL));
+ * will walk a base path as provided by get_mini_fo_bpath and return
+ * the (hopefully ;-) ) positive dentry of the renamed base dir.
+ *
+ * This does some work of path_init.
+ */
+ * will walk a base path as provided by get_mini_fo_bpath and return
+ * the (hopefully ;-) ) positive dentry of the renamed base dir.
+ *
+ * This does some work of path_init.
+ */
+ * read_lock(¤t->fs->lock); */
+ mnt = mntget(stopd(sb)->hidden_mnt);
+ /* read_unlock(¤t->fs->lock); */
+ * read_lock(¤t->fs->lock); */
+ mnt = mntget(stopd(sb)->hidden_mnt);
+ /* read_unlock(¤t->fs->lock); */
+ err = vfs_path_lookup(mnt->mnt_root, mnt, bpath+1, 0, &nd);
+
+ /* validate */
+ err = vfs_path_lookup(mnt->mnt_root, mnt, bpath+1, 0, &nd);
+
+ /* validate */
+ if(!dentry || !dtohd(dentry)) {
+ printk(KERN_CRIT "mini_fo: get_mini_fo_bpath: invalid dentry passed.\n");
+ return -1;
+ if(!dentry || !dtohd(dentry)) {
+ printk(KERN_CRIT "mini_fo: get_mini_fo_bpath: invalid dentry passed.\n");
+ return -1;
-+ bytes = src_file->f_op->read(src_file, buf, len,
++ bytes = src_file->f_op->read(src_file, buf, len,
-+ tmp = tgt_file->f_op->write(tgt_file, buf, bytes,
++ tmp = tgt_file->f_op->write(tgt_file, buf, bytes,
+ kmalloc(sizeof(struct ndl_entry), GFP_KERNEL);
+ if(!tmp_entry) {
+ printk(KERN_CRIT "mini_fo: ndl_add_entry: out of mem.\n");
+ kmalloc(sizeof(struct ndl_entry), GFP_KERNEL);
+ if(!tmp_entry) {
+ printk(KERN_CRIT "mini_fo: ndl_add_entry: out of mem.\n");
+ * hidden_storage dentries are set to NULL. We need to
+ * create the negative dentry before we create the storage
+ * file.
+ * hidden_storage dentries are set to NULL. We need to
+ * create the negative dentry before we create the storage
+ * file.
+ /* everything ok! */
+ if(!dtohd2(dentry)->d_inode) {
+ printk(KERN_CRIT "mini_fo: build_sto_structure: failed to create storage dir [2].\n");
+ /* everything ok! */
+ if(!dtohd2(dentry)->d_inode) {
+ printk(KERN_CRIT "mini_fo: build_sto_structure: failed to create storage dir [2].\n");
+ itopd(dentry->d_inode)->deleted_list_size = -1;
+ itopd(dentry->d_inode)->renamed_list_size = -1;
+ meta_build_lists(dentry);
+ itopd(dentry->d_inode)->deleted_list_size = -1;
+ itopd(dentry->d_inode)->renamed_list_size = -1;
+ meta_build_lists(dentry);
+ hidden_sto_dir_dentry->d_inode);
+ dir->d_inode->i_nlink++;
+ /* was: unlock_dir(hidden_sto_dir_dentry); */
+ hidden_sto_dir_dentry->d_inode);
+ dir->d_inode->i_nlink++;
+ /* was: unlock_dir(hidden_sto_dir_dentry); */
+
+ * inode.c: rename_reg_file renamed to rename_nondir, as it
+ doesn't matter as long it't not a dir. Removed all
+
+ * inode.c: rename_reg_file renamed to rename_nondir, as it
+ doesn't matter as long it't not a dir. Removed all
+
+ * inode.c: implemented mini_fo_getattr, that was required for
+ 2.6 because inode_revalidate has been remove there, and the
+
+ * inode.c: implemented mini_fo_getattr, that was required for
+ 2.6 because inode_revalidate has been remove there, and the
+ * Rewrote mini_fo rename and split it into several
+ subfunctions, that handle the different types
+ seperately. Rewrote the regular file function aswell, as it
+ * Rewrote mini_fo rename and split it into several
+ subfunctions, that handle the different types
+ seperately. Rewrote the regular file function aswell, as it
+ files. mini_fo_rename still isn't implemented properly, renaming
+ of device files, symlinks etc. results in a empty regular file
+ instead of the proper type.
+ files. mini_fo_rename still isn't implemented properly, renaming
+ of device files, symlinks etc. results in a empty regular file
+ instead of the proper type.
+ * Directory renaming suddenly works! What a surprise! I guess
+ this is because renaming is implemented as making a copy and
+ removing the original. Still this might not work
+ * Directory renaming suddenly works! What a surprise! I guess
+ this is because renaming is implemented as making a copy and
+ removing the original. Still this might not work
+ * Makefile fix, fist_ioctl was built against wrong sources if ARCH=um
+
+ * Fixed a bug in dentry.c, mini_fo_d_hash. In state 4 =
+ * Makefile fix, fist_ioctl was built against wrong sources if ARCH=um
+
+ * Fixed a bug in dentry.c, mini_fo_d_hash. In state 4 =
+2004-10-24 Gleb Natapov <gleb@nbase.co.il>
+
+ * Fix: owner and group where not correctly copied from base to
+2004-10-24 Gleb Natapov <gleb@nbase.co.il>
+
+ * Fix: owner and group where not correctly copied from base to
+
+
+2004-10-05 Gleb Natapov <gleb@nbase.co.il>
+
+ * Implementation of fsync, fasync and lock mini_fo functions.
+
+
+2004-10-05 Gleb Natapov <gleb@nbase.co.il>
+
+ * Implementation of fsync, fasync and lock mini_fo functions.
+
+2004-09-28 Gleb Natapov <gleb@nbase.co.il>
+
+ * Implementation of mini_fo_mknod and mini_fo_rename, support
+ for device files.
+
+2004-09-28 Gleb Natapov <gleb@nbase.co.il>
+
+ * Implementation of mini_fo_mknod and mini_fo_rename, support
+ for device files.
Index: linux-2.6.23/fs/mini_fo/dentry.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
Index: linux-2.6.23/fs/mini_fo/dentry.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+ hidden_sto_dentry->d_op &&
+ hidden_sto_dentry->d_op->d_revalidate) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ hidden_sto_dentry->d_op &&
+ hidden_sto_dentry->d_op->d_revalidate) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ hidden_file->f_pos = file->f_pos;
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ hidden_file->f_pos = file->f_pos;
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ * - be able to call wol functions in order to avoid listing deleted
+ * base files.
+ * - if we're reading a directory which is in state 1, we need to
+ * - be able to call wol functions in order to avoid listing deleted
+ * base files.
+ * - if we're reading a directory which is in state 1, we need to
+ * have been copied to userspace,to detect files existing in base
+ * and storage and not list them twice.
+ */
+ * have been copied to userspace,to detect files existing in base
+ * and storage and not list them twice.
+ */
+ /* check if file has been deleted */
+ if(meta_check_d_entry(file->f_dentry, name, namlen))
+ return 0;
+ /* check if file has been deleted */
+ if(meta_check_d_entry(file->f_dentry, name, namlen))
+ return 0;
+ /* do duplicate checking */
+ if(ndl_check_entry(&ftopd(file)->rd, name, namlen))
+ return 0;
+ /* do duplicate checking */
+ if(ndl_check_entry(&ftopd(file)->rd, name, namlen))
+ return 0;
+ hidden_sto_file = ftohf2(file);
+ err = vfs_readdir(hidden_sto_file, mini_fo_filldir, dirent);
+ file->f_pos = hidden_sto_file->f_pos;
+ hidden_sto_file = ftohf2(file);
+ err = vfs_readdir(hidden_sto_file, mini_fo_filldir, dirent);
+ file->f_pos = hidden_sto_file->f_pos;
+ hidden_file = ftohf(file);
+ err = vfs_readdir(hidden_file, mini_fo_filldir, dirent);
+ file->f_pos = hidden_file->f_pos;
+ hidden_file = ftohf(file);
+ err = vfs_readdir(hidden_file, mini_fo_filldir, dirent);
+ file->f_pos = hidden_file->f_pos;
+ check_mini_fo_file(file);
+
+ /* mk: we don't do any state checking here, as its not worth the time.
+ check_mini_fo_file(file);
+
+ /* mk: we don't do any state checking here, as its not worth the time.
+ if((hidden_file = ftohf2(file)) != NULL) {
+ err2 = hidden_file->f_op->fasync(fd, hidden_file, flag);
+ }
+ if((hidden_file = ftohf2(file)) != NULL) {
+ err2 = hidden_file->f_op->fasync(fd, hidden_file, flag);
+ }
+ /* this can be set up safely without fear of spaghetti
+ * interposing as it is only used for copying times */
+ hidden_dir_dentry = hidden_dentry->d_parent;
+ kfree(bpath);
+ }
+ else if(hidden_dir_dentry && hidden_dir_dentry->d_inode)
+ /* this can be set up safely without fear of spaghetti
+ * interposing as it is only used for copying times */
+ hidden_dir_dentry = hidden_dentry->d_parent;
+ kfree(bpath);
+ }
+ else if(hidden_dir_dentry && hidden_dir_dentry->d_inode)
+ lookup_one_len(name, hidden_dir_dentry, namelen);
+ else
+ hidden_dentry = NULL;
+
+ if(hidden_sto_dir_dentry && hidden_sto_dir_dentry->d_inode)
+ lookup_one_len(name, hidden_dir_dentry, namelen);
+ else
+ hidden_dentry = NULL;
+
+ if(hidden_sto_dir_dentry && hidden_sto_dir_dentry->d_inode)
+ lookup_one_len(name, hidden_sto_dir_dentry, namelen);
+ else
+ hidden_sto_dentry = NULL;
+
+ /* catch error in lookup */
+ if (IS_ERR(hidden_dentry) || IS_ERR(hidden_sto_dentry)) {
+ lookup_one_len(name, hidden_sto_dir_dentry, namelen);
+ else
+ hidden_sto_dentry = NULL;
+
+ /* catch error in lookup */
+ if (IS_ERR(hidden_dentry) || IS_ERR(hidden_sto_dentry)) {
+ /* allocate dentry private data */
+ __dtopd(dentry) = (struct mini_fo_dentry_info *)
+ kmalloc(sizeof(struct mini_fo_dentry_info), GFP_KERNEL);
+ /* allocate dentry private data */
+ __dtopd(dentry) = (struct mini_fo_dentry_info *)
+ kmalloc(sizeof(struct mini_fo_dentry_info), GFP_KERNEL);
+ /* state 1, file has been modified */
+ if(hidden_dentry && hidden_sto_dentry &&
+ hidden_dentry->d_inode && hidden_sto_dentry->d_inode && !del_flag) {
+ /* state 1, file has been modified */
+ if(hidden_dentry && hidden_sto_dentry &&
+ hidden_dentry->d_inode && hidden_sto_dentry->d_inode && !del_flag) {
+
+ /* state 4, file has deleted and created again. */
+ if(hidden_dentry && hidden_sto_dentry &&
+
+ /* state 4, file has deleted and created again. */
+ if(hidden_dentry && hidden_sto_dentry &&
+ hidden_sto_dentry->d_inode && del_flag) {
+
+ fist_copy_attr_atime(dir, hidden_sto_dir_dentry->d_inode);
+ hidden_sto_dentry->d_inode && del_flag) {
+
+ fist_copy_attr_atime(dir, hidden_sto_dir_dentry->d_inode);
+ }
+ /* state 5, file has been deleted in base */
+ if(hidden_dentry && hidden_sto_dentry &&
+ }
+ /* state 5, file has been deleted in base */
+ if(hidden_dentry && hidden_sto_dentry &&
+ !hidden_sto_dentry->d_inode && del_flag) {
+
+ /* check which parents atime we need for updating */
+ if(hidden_sto_dir_dentry->d_inode)
+ !hidden_sto_dentry->d_inode && del_flag) {
+
+ /* check which parents atime we need for updating */
+ if(hidden_sto_dir_dentry->d_inode)
+ out_lock:
+ /* was: unlock_dir(hidden_sto_dir_dentry); */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+ out_lock:
+ /* was: unlock_dir(hidden_sto_dir_dentry); */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+ strlen(META_FILENAME));
+ if(meta_dentry->d_inode) {
+ err = vfs_unlink(hidden_sto_dentry->d_inode, meta_dentry);
+ strlen(META_FILENAME));
+ if(meta_dentry->d_inode) {
+ err = vfs_unlink(hidden_sto_dentry->d_inode, meta_dentry);
-+ /* ok, add deleted file to META */
-+ meta_add_d_entry(dentry->d_parent,
-+ dentry->d_name.name,
++ /* ok, add deleted file to META */
++ meta_add_d_entry(dentry->d_parent,
++ dentry->d_name.name,
+ }
+ else if(dtopd(dentry)->state == UNMODIFIED) {
+ /* XXX: simply adding it to the delete list here is fscking dangerous!
+ }
+ else if(dtopd(dentry)->state == UNMODIFIED) {
+ /* XXX: simply adding it to the delete list here is fscking dangerous!
+ /* dput base dentry, this will relase the inode and free the
+ * dentry, as we will never need it again. */
+ dput(dtohd(dentry));
+ /* dput base dentry, this will relase the inode and free the
+ * dentry, as we will never need it again. */
+ dput(dtohd(dentry));
+ strlen(META_FILENAME));
+ if(meta_dentry->d_inode) {
+ /* is this necessary? dget(meta_dentry); */
+ strlen(META_FILENAME));
+ if(meta_dentry->d_inode) {
+ /* is this necessary? dget(meta_dentry); */
+ strlen(META_FILENAME));
+ if(meta_dentry->d_inode) {
+ /* is this necessary? dget(meta_dentry); */
+ strlen(META_FILENAME));
+ if(meta_dentry->d_inode) {
+ /* is this necessary? dget(meta_dentry); */
+ if(S_ISDIR(old_dentry->d_inode->i_mode))
+ return rename_directory(old_dir, old_dentry, new_dir, new_dentry);
+ return rename_nondir(old_dir, old_dentry, new_dir, new_dentry);
+ if(S_ISDIR(old_dentry->d_inode->i_mode))
+ return rename_directory(old_dir, old_dentry, new_dir, new_dentry);
+ return rename_nondir(old_dir, old_dentry, new_dir, new_dentry);
+ /* state = UNMODIFIED */
+ if(dtopd(old_dentry)->state == UNMODIFIED) {
+ err = dir_unmod_to_mod(old_dentry);
+ /* state = UNMODIFIED */
+ if(dtopd(old_dentry)->state == UNMODIFIED) {
+ err = dir_unmod_to_mod(old_dentry);
+ old_dentry->d_name.name,
+ old_dentry->d_name.len);
+ if(bpath) {
+ old_dentry->d_name.name,
+ old_dentry->d_name.len);
+ if(bpath) {
+ old_dentry->d_name.name,
+ old_dentry->d_name.len);
+ old_dentry->d_name.name,
+ old_dentry->d_name.len);
+ goto out;
+ /* put it on rename list */
+ err = get_mini_fo_bpath(old_dentry,
+ goto out;
+ /* put it on rename list */
+ err = get_mini_fo_bpath(old_dentry,
+ goto out;
+ err = meta_add_r_entry(new_dentry->d_parent,
+ bpath, bpath_len,
+ new_dentry->d_name.name,
+ new_dentry->d_name.len);
+ goto out;
+ err = meta_add_r_entry(new_dentry->d_parent,
+ bpath, bpath_len,
+ new_dentry->d_name.name,
+ new_dentry->d_name.len);
+ if(dtopd(new_dentry)->state == DELETED) {
+ dtopd(old_dentry)->state = DEL_REWRITTEN;
+ dtohd(old_dentry) = NULL;
+ if(dtopd(new_dentry)->state == DELETED) {
+ dtopd(old_dentry)->state = DEL_REWRITTEN;
+ dtohd(old_dentry) = NULL;
+ else if(dtopd(new_dentry)->state == NON_EXISTANT) {
+ dtopd(old_dentry)->state = CREATED;
+ /* steal new dentry's neg. base dentry */
+ dtohd(old_dentry) = dtohd(new_dentry);
+ dtohd(new_dentry) = NULL;
+ }
+ else if(dtopd(new_dentry)->state == NON_EXISTANT) {
+ dtopd(old_dentry)->state = CREATED;
+ /* steal new dentry's neg. base dentry */
+ dtohd(old_dentry) = dtohd(new_dentry);
+ dtohd(new_dentry) = NULL;
+ }
+ if(dtopd(new_dentry)->state == UNMODIFIED ||
+ dtopd(new_dentry)->state == NON_EXISTANT) {
+ err = get_neg_sto_dentry(new_dentry);
+ if(err)
+ goto out;
+ }
+ if(dtopd(new_dentry)->state == UNMODIFIED ||
+ dtopd(new_dentry)->state == NON_EXISTANT) {
+ err = get_neg_sto_dentry(new_dentry);
+ if(err)
+ goto out;
+ }
+ /* now move sto file */
+ hidden_old_dentry = dtohd2(old_dentry);
+ hidden_new_dentry = dtohd2(new_dentry);
+ /* now move sto file */
+ hidden_old_dentry = dtohd2(old_dentry);
+ hidden_new_dentry = dtohd2(new_dentry);
+ hidden_old_dir_dentry = dget(hidden_old_dentry->d_parent);
+ hidden_new_dir_dentry = dget(hidden_new_dentry->d_parent);
+ double_lock(hidden_old_dir_dentry, hidden_new_dir_dentry);
+ hidden_old_dir_dentry = dget(hidden_old_dentry->d_parent);
+ hidden_new_dir_dentry = dget(hidden_new_dentry->d_parent);
+ double_lock(hidden_old_dir_dentry, hidden_new_dir_dentry);
+ err = vfs_rename(hidden_old_dir_dentry->d_inode, hidden_old_dentry,
+ hidden_new_dir_dentry->d_inode, hidden_new_dentry);
+ if(err)
+ goto out_lock;
+ err = vfs_rename(hidden_old_dir_dentry->d_inode, hidden_old_dentry,
+ hidden_new_dir_dentry->d_inode, hidden_new_dentry);
+ if(err)
+ goto out_lock;
+ fist_copy_attr_all(new_dir, hidden_new_dir_dentry->d_inode);
+ if (new_dir != old_dir)
+ fist_copy_attr_all(new_dir, hidden_new_dir_dentry->d_inode);
+ if (new_dir != old_dir)
+ out_lock:
+ /* double_unlock will dput the new/old parent dentries
+ * whose refcnts were incremented via get_parent above. */
+ double_unlock(hidden_old_dir_dentry, hidden_new_dir_dentry);
+ dput(hidden_new_dentry);
+ dput(hidden_old_dentry);
+ out_lock:
+ /* double_unlock will dput the new/old parent dentries
+ * whose refcnts were incremented via get_parent above. */
+ double_unlock(hidden_old_dir_dentry, hidden_new_dir_dentry);
+ dput(hidden_new_dentry);
+ dput(hidden_old_dentry);
+ dentry_t *hidden_old_dentry;
+ dentry_t *hidden_new_dentry;
+ dentry_t *hidden_old_dir_dentry;
+ dentry_t *hidden_old_dentry;
+ dentry_t *hidden_new_dentry;
+ dentry_t *hidden_old_dir_dentry;
+ * Dr. dcache.c:345 if it gets dput twice... */
+ dtohd(new_dentry) = NULL;
+ dtopd(old_dentry)->state = CREATED;
+ * Dr. dcache.c:345 if it gets dput twice... */
+ dtohd(new_dentry) = NULL;
+ dtopd(old_dentry)->state = CREATED;
+ dtopd(old_dentry)->state = DEL_REWRITTEN;
+ }
+ else { /* not possible, uhh, ahh */
+ dtopd(old_dentry)->state = DEL_REWRITTEN;
+ }
+ else { /* not possible, uhh, ahh */
+ /* now we definitely have a sto file */
+ hidden_old_dentry = dtohd2(old_dentry);
+ hidden_new_dentry = dtohd2(new_dentry);
+
+ dget(hidden_old_dentry);
+ dget(hidden_new_dentry);
+ /* now we definitely have a sto file */
+ hidden_old_dentry = dtohd2(old_dentry);
+ hidden_new_dentry = dtohd2(new_dentry);
+
+ dget(hidden_old_dentry);
+ dget(hidden_new_dentry);
+ hidden_old_dir_dentry = dget(hidden_old_dentry->d_parent);
+ hidden_new_dir_dentry = dget(hidden_new_dentry->d_parent);
+ double_lock(hidden_old_dir_dentry, hidden_new_dir_dentry);
+
+ hidden_old_dir_dentry = dget(hidden_old_dentry->d_parent);
+ hidden_new_dir_dentry = dget(hidden_new_dentry->d_parent);
+ double_lock(hidden_old_dir_dentry, hidden_new_dir_dentry);
+
+ goto out_lock;
+
+ fist_copy_attr_all(new_dir, hidden_new_dir_dentry->d_inode);
+ if (new_dir != old_dir)
+ fist_copy_attr_all(old_dir, hidden_old_dir_dentry->d_inode);
+ goto out_lock;
+
+ fist_copy_attr_all(new_dir, hidden_new_dir_dentry->d_inode);
+ if (new_dir != old_dir)
+ fist_copy_attr_all(old_dir, hidden_old_dir_dentry->d_inode);
+ * whose refcnts were incremented via get_parent above.
+ */
+ double_unlock(hidden_old_dir_dentry, hidden_new_dir_dentry);
+ dput(hidden_new_dentry);
+ dput(hidden_old_dentry);
+ * whose refcnts were incremented via get_parent above.
+ */
+ double_unlock(hidden_old_dir_dentry, hidden_new_dir_dentry);
+ dput(hidden_new_dentry);
+ dput(hidden_old_dentry);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ err = permission(hidden_inode, mask, nd);
+#else
+ err = permission(hidden_inode, mask);
+#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ err = permission(hidden_inode, mask, nd);
+#else
+ err = permission(hidden_inode, mask);
+#endif
+ if(!is_mini_fo_existant(dentry)) {
+ printk(KERN_CRIT "mini_fo_setattr: ERROR, invalid state detected [1].\n");
+ goto out;
+ if(!is_mini_fo_existant(dentry)) {
+ printk(KERN_CRIT "mini_fo_setattr: ERROR, invalid state detected [1].\n");
+ goto out;
+ !(ia->ia_size == 0 && (ia->ia_valid & ATTR_SIZE))) {
+ err = nondir_unmod_to_mod(dentry, 1);
+ } else
+ !(ia->ia_size == 0 && (ia->ia_valid & ATTR_SIZE))) {
+ err = nondir_unmod_to_mod(dentry, 1);
+ } else
+ ASSERT(dtohd2(dentry));
+ ASSERT(itopd(dentry->d_inode));
+ ASSERT(itohi2(dentry->d_inode));
+ ASSERT(dtohd2(dentry));
+ ASSERT(itopd(dentry->d_inode));
+ ASSERT(itohi2(dentry->d_inode));
+ err = notify_change(dtohd2(dentry), ia);
+ fist_copy_attr_all(dentry->d_inode, itohi2(dentry->d_inode));
+ out:
+ err = notify_change(dtohd2(dentry), ia);
+ fist_copy_attr_all(dentry->d_inode, itohi2(dentry->d_inode));
+ out:
+#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,21) \
+ && LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,23)) \
+ || LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
+#if ((LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,21) \
+ && LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,23)) \
+ || LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
-+ hidden_root = nd.path.dentry;
-+ stopd(sb)->base_dir_dentry = nd.path.dentry;
-+ stopd(sb)->hidden_mnt = nd.path.mnt;
++ hidden_root = nd.dentry;
++ stopd(sb)->base_dir_dentry = nd.dentry;
++ stopd(sb)->hidden_mnt = nd.mnt;
+
+ } else if(!strncmp("sto=", options, 4)) {
+ /* parse the storage dir */
+
+ } else if(!strncmp("sto=", options, 4)) {
+ /* parse the storage dir */
-+ hidden_root2 = nd2.path.dentry;
-+ stopd(sb)->storage_dir_dentry = nd2.path.dentry;
-+ stopd(sb)->hidden_mnt2 = nd2.path.mnt;
++ hidden_root2 = nd2.dentry;
++ stopd(sb)->storage_dir_dentry = nd2.dentry;
++ stopd(sb)->hidden_mnt2 = nd2.mnt;
+ kmalloc(sizeof(struct mini_fo_dentry_info), GFP_KERNEL);
+ if (!dtopd(sb->s_root)) {
+ err = -ENOMEM;
+ kmalloc(sizeof(struct mini_fo_dentry_info), GFP_KERNEL);
+ if (!dtopd(sb->s_root)) {
+ err = -ENOMEM;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+static int mini_fo_get_sb(struct file_system_type *fs_type,
+ int flags, const char *dev_name,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+static int mini_fo_get_sb(struct file_system_type *fs_type,
+ int flags, const char *dev_name,
+{
+ return get_sb_nodev(fs_type, flags, raw_data, mini_fo_read_super, mnt);
+}
+#else
+static struct super_block *mini_fo_get_sb(struct file_system_type *fs_type,
+ int flags, const char *dev_name,
+{
+ return get_sb_nodev(fs_type, flags, raw_data, mini_fo_read_super, mnt);
+}
+#else
+static struct super_block *mini_fo_get_sb(struct file_system_type *fs_type,
+ int flags, const char *dev_name,
+{
+ return get_sb_nodev(fs_type, flags, raw_data, mini_fo_read_super);
+}
+{
+ return get_sb_nodev(fs_type, flags, raw_data, mini_fo_read_super);
+}
+ /* might there be a META-file? */
+ if(dtohd2(dentry) && dtohd2(dentry)->d_inode) {
+ meta_dentry = lookup_one_len(META_FILENAME,
+ /* might there be a META-file? */
+ if(dtohd2(dentry) && dtohd2(dentry)->d_inode) {
+ meta_dentry = lookup_one_len(META_FILENAME,
+ /* $%& err, is this correct? */
+ meta_mnt = stopd(dentry->d_inode->i_sb)->hidden_mnt2;
+ mntget(meta_mnt);
+ /* $%& err, is this correct? */
+ meta_mnt = stopd(dentry->d_inode->i_sb)->hidden_mnt2;
+ mntget(meta_mnt);
+
+ /* open META-file for reading */
+ meta_file = dentry_open(meta_dentry, meta_mnt, 0x0);
+
+ /* open META-file for reading */
+ meta_file = dentry_open(meta_dentry, meta_mnt, 0x0);
+ dir_name = strchr(old_path, ' ') + 1;
+ old_len = dir_name - old_path - 1;
+ new_len = ((int) entry) + len - ((int ) dir_name);
+ dir_name = strchr(old_path, ' ') + 1;
+ old_len = dir_name - old_path - 1;
+ new_len = ((int) entry) + len - ((int ) dir_name);
+ if(!inode || !itopd(inode)) {
+ printk(KERN_CRIT "mini_fo: __meta_put_d_list: \
+ invalid inode passed.\n");
+ return -1;
+ }
+ inode_info = itopd(inode);
+ if(!inode || !itopd(inode)) {
+ printk(KERN_CRIT "mini_fo: __meta_put_d_list: \
+ invalid inode passed.\n");
+ return -1;
+ }
+ inode_info = itopd(inode);
+ if(!inode || !itopd(inode)) {
+ printk(KERN_CRIT "mini_fo: meta_put_r_list: invalid inode.\n");
+ return -1;
+ }
+ inode_info = itopd(inode);
+ if(!inode || !itopd(inode)) {
+ printk(KERN_CRIT "mini_fo: meta_put_r_list: invalid inode.\n");
+ return -1;
+ }
+ inode_info = itopd(inode);
+ int err = 0;
+ err = meta_list_add_d_entry(dentry, name, len);
+ err |= meta_write_d_entry(dentry,name,len);
+ int err = 0;
+ err = meta_list_add_d_entry(dentry, name, len);
+ err |= meta_write_d_entry(dentry,name,len);
+ kmalloc(sizeof(struct deleted_entry), GFP_KERNEL);
+ del_entry->name = (char*) kmalloc(len, GFP_KERNEL);
+ if(!del_entry || !del_entry->name) {
+ kmalloc(sizeof(struct deleted_entry), GFP_KERNEL);
+ del_entry->name = (char*) kmalloc(len, GFP_KERNEL);
+ if(!del_entry || !del_entry->name) {
-+int meta_add_r_entry(dentry_t *dentry,
-+ const char *old_name, int old_len,
++int meta_add_r_entry(dentry_t *dentry,
++ const char *old_name, int old_len,
-+int meta_list_add_r_entry(dentry_t *dentry,
-+ const char *old_name, int old_len,
++int meta_list_add_r_entry(dentry_t *dentry,
++ const char *old_name, int old_len,
+ const char *new_name, int new_len)
+{
+ struct renamed_entry *ren_entry;
+ const char *new_name, int new_len)
+{
+ struct renamed_entry *ren_entry;
+ kmalloc(sizeof(struct renamed_entry), GFP_KERNEL);
+ ren_entry->old_name = (char*) kmalloc(old_len, GFP_KERNEL);
+ ren_entry->new_name = (char*) kmalloc(new_len, GFP_KERNEL);
+ kmalloc(sizeof(struct renamed_entry), GFP_KERNEL);
+ ren_entry->old_name = (char*) kmalloc(old_len, GFP_KERNEL);
+ ren_entry->new_name = (char*) kmalloc(new_len, GFP_KERNEL);
+int meta_list_remove_r_entry(dentry_t *dentry, const char *name, int len)
+{
+ if(!dentry || !dentry->d_inode) {
+int meta_list_remove_r_entry(dentry_t *dentry, const char *name, int len)
+{
+ if(!dentry || !dentry->d_inode) {
+ "mini_fo: __meta_list_remove_r_entry: \
+ invalid inode passed.\n");
+ inode_info = itopd(inode);
+ "mini_fo: __meta_list_remove_r_entry: \
+ invalid inode passed.\n");
+ inode_info = itopd(inode);
+ list_for_each(tmp, &inode_info->renamed_list) {
+ ren_entry = list_entry(tmp, struct renamed_entry, list);
+ if(ren_entry->new_len != len)
+ continue;
+ list_for_each(tmp, &inode_info->renamed_list) {
+ ren_entry = list_entry(tmp, struct renamed_entry, list);
+ if(ren_entry->new_len != len)
+ continue;
+ if(!strncmp(ren_entry->new_name, name, len)) {
+ list_del(tmp);
+ kfree(ren_entry->new_name);
+ if(!strncmp(ren_entry->new_name, name, len)) {
+ list_del(tmp);
+ kfree(ren_entry->new_name);
+ dtohd2(dentry), strlen (META_FILENAME));
+
+ /* We need to create a META-file */
+ if(!meta_dentry->d_inode) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ vfs_create(dtohd2(dentry)->d_inode,
+ dtohd2(dentry), strlen (META_FILENAME));
+
+ /* We need to create a META-file */
+ if(!meta_dentry->d_inode) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ vfs_create(dtohd2(dentry)->d_inode,
-+ bytes = meta_file->f_op->write(meta_file, buf, len+3,
++ bytes = meta_file->f_op->write(meta_file, buf, len+3,
-+int meta_write_r_entry(dentry_t *dentry,
-+ const char *old_name, int old_len,
-+ const char *new_name, int new_len)
++int meta_write_r_entry(dentry_t *dentry,
++ const char *old_name, int old_len,
++ const char *new_name, int new_len)
+ strlen (META_FILENAME));
+ if(!meta_dentry->d_inode) {
+ /* We need to create a META-file */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ strlen (META_FILENAME));
+ if(!meta_dentry->d_inode) {
+ /* We need to create a META-file */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ if(!dentry || !dentry->d_inode) {
+ printk(KERN_CRIT "mini_fo: meta_sync_d_list: \
+ invalid inode passed.\n");
+ if(!dentry || !dentry->d_inode) {
+ printk(KERN_CRIT "mini_fo: meta_sync_d_list: \
+ invalid inode passed.\n");
+ /* ok, there is something to sync */
+
+ /* build the storage structure? */
+ /* ok, there is something to sync */
+
+ /* build the storage structure? */
+ strlen(META_FILENAME));
+ if(!meta_dentry->d_inode) {
+ /* We need to create a META-file */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ strlen(META_FILENAME));
+ if(!meta_dentry->d_inode) {
+ /* We need to create a META-file */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ printk(KERN_CRIT "mini_fo: meta_sync_d_list: \
+ ERROR opening meta file.\n");
+ /* we don't mntget so we dont't mntput (for now)
+ printk(KERN_CRIT "mini_fo: meta_sync_d_list: \
+ ERROR opening meta file.\n");
+ /* we don't mntget so we dont't mntput (for now)
+ /* here we go... */
+ list_for_each(tmp, &inode_info->deleted_list) {
+ del_entry = list_entry(tmp, struct deleted_entry, list);
+ /* here we go... */
+ list_for_each(tmp, &inode_info->deleted_list) {
+ del_entry = list_entry(tmp, struct deleted_entry, list);
+ /* size: len for name, 1 for \n and 2 for "D " */
+ buf = (char *) kmalloc(del_entry->len+3, GFP_KERNEL);
+ if (!buf) {
+ /* size: len for name, 1 for \n and 2 for "D " */
+ buf = (char *) kmalloc(del_entry->len+3, GFP_KERNEL);
+ if (!buf) {
+ buf[0] = 'D';
+ buf[1] = ' ';
+ strncpy(buf+2, del_entry->name, del_entry->len);
+ buf[del_entry->len+2] = '\n';
+ buf[0] = 'D';
+ buf[1] = ' ';
+ strncpy(buf+2, del_entry->name, del_entry->len);
+ buf[del_entry->len+2] = '\n';
+ int bytes, err, buf_len;
+ struct vfsmount *meta_mnt;
+ char *buf;
+ int bytes, err, buf_len;
+ struct vfsmount *meta_mnt;
+ char *buf;
+ if(!dentry || !dentry->d_inode) {
+ printk(KERN_CRIT "mini_fo: meta_sync_r_list: \
+ invalid dentry passed.\n");
+ if(!dentry || !dentry->d_inode) {
+ printk(KERN_CRIT "mini_fo: meta_sync_r_list: \
+ invalid dentry passed.\n");
+ /* ok, there is something to sync */
+
+ /* build the storage structure? */
+ /* ok, there is something to sync */
+
+ /* build the storage structure? */
+ strlen(META_FILENAME));
+ if(!meta_dentry->d_inode) {
+ /* We need to create a META-file */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ strlen(META_FILENAME));
+ if(!meta_dentry->d_inode) {
+ /* We need to create a META-file */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ printk(KERN_CRIT "mini_fo: meta_sync_r_list: \
+ ERROR opening meta file.\n");
+ /* we don't mntget so we dont't mntput (for now)
+ printk(KERN_CRIT "mini_fo: meta_sync_r_list: \
+ ERROR opening meta file.\n");
+ /* we don't mntget so we dont't mntput (for now)
+ /* here we go... */
+ list_for_each(tmp, &inode_info->renamed_list) {
+ ren_entry = list_entry(tmp, struct renamed_entry, list);
+ /* here we go... */
+ list_for_each(tmp, &inode_info->renamed_list) {
+ ren_entry = list_entry(tmp, struct renamed_entry, list);
+ * 2 for "R ", old_len+new_len for names, 1 blank+1 \n */
+ buf_len = ren_entry->old_len + ren_entry->new_len + 4;
+ buf = (char *) kmalloc(buf_len, GFP_KERNEL);
+ * 2 for "R ", old_len+new_len for names, 1 blank+1 \n */
+ buf_len = ren_entry->old_len + ren_entry->new_len + 4;
+ buf = (char *) kmalloc(buf_len, GFP_KERNEL);
+ buf[1] = ' ';
+ strncpy(buf + 2, ren_entry->old_name, ren_entry->old_len);
+ buf[ren_entry->old_len + 2] = ' ';
+ buf[1] = ' ';
+ strncpy(buf + 2, ren_entry->old_name, ren_entry->old_len);
+ buf[ren_entry->old_len + 2] = ' ';
+ ren_entry->new_name, ren_entry->new_len);
+ buf[buf_len - 1] = '\n';
+ ren_entry->new_name, ren_entry->new_len);
+ buf[buf_len - 1] = '\n';
+ buf_len, &meta_file->f_pos);
+ if(bytes != buf_len) {
+ printk(KERN_CRIT "mini_fo: meta_sync_r_list: \
+ ERROR writing.\n");
+ err |= -1;
+ buf_len, &meta_file->f_pos);
+ if(bytes != buf_len) {
+ printk(KERN_CRIT "mini_fo: meta_sync_r_list: \
+ ERROR writing.\n");
+ err |= -1;
+{
+ if(!dentry || !dentry->d_inode)
+ printk(KERN_CRIT "mini_fo: meta_check_d_dentry: \
+ invalid dentry passed.\n");
+{
+ if(!dentry || !dentry->d_inode)
+ printk(KERN_CRIT "mini_fo: meta_check_d_dentry: \
+ invalid dentry passed.\n");
+ del_entry = list_entry(tmp, struct deleted_entry, list);
+ if(del_entry->len != len)
+ continue;
+ del_entry = list_entry(tmp, struct deleted_entry, list);
+ if(del_entry->len != len)
+ continue;
+ * check if file has been renamed and return path to orig. base dir.
+ * Implements no error return values so far, what of course sucks.
+ * String is null terminated.'
+ */
+ * check if file has been renamed and return path to orig. base dir.
+ * Implements no error return values so far, what of course sucks.
+ * String is null terminated.'
+ */
+{
+ if(!dentry || !dentry->d_inode) {
+ printk(KERN_CRIT "mini_fo: meta_check_r_dentry: \
+ invalid dentry passed.\n");
+ return NULL;
+ }
+{
+ if(!dentry || !dentry->d_inode) {
+ printk(KERN_CRIT "mini_fo: meta_check_r_dentry: \
+ invalid dentry passed.\n");
+ return NULL;
+ }
+ if(!inode || !itopd(inode)) {
+ printk(KERN_CRIT "mini_fo: meta_check_r_dentry: \
+ invalid inode passed.\n");
+ return NULL;
+ }
+ inode_info = itopd(inode);
+ if(!inode || !itopd(inode)) {
+ printk(KERN_CRIT "mini_fo: meta_check_r_dentry: \
+ invalid inode passed.\n");
+ return NULL;
+ }
+ inode_info = itopd(inode);
+ list_for_each(tmp, &inode_info->renamed_list) {
+ ren_entry = list_entry(tmp, struct renamed_entry, list);
+ if(ren_entry->new_len != len)
+ continue;
+ list_for_each(tmp, &inode_info->renamed_list) {
+ ren_entry = list_entry(tmp, struct renamed_entry, list);
+ if(ren_entry->new_len != len)
+ continue;
+{
+ if(!dentry || !dentry->d_inode) {
+ printk(KERN_CRIT "mini_fo: meta_check_r_dentry [2]: \
+ invalid dentry passed.\n");
+ return -1;
+ }
+{
+ if(!dentry || !dentry->d_inode) {
+ printk(KERN_CRIT "mini_fo: meta_check_r_dentry [2]: \
+ invalid dentry passed.\n");
+ return -1;
+ }
+ if(!inode || !itopd(inode)) {
+ printk(KERN_CRIT "mini_fo: meta_check_r_dentry [2]: \
+ invalid inode passed.\n");
+ return -1;
+ }
+ inode_info = itopd(inode);
+ if(!inode || !itopd(inode)) {
+ printk(KERN_CRIT "mini_fo: meta_check_r_dentry [2]: \
+ invalid inode passed.\n");
+ return -1;
+ }
+ inode_info = itopd(inode);
+ list_for_each(tmp, &inode_info->renamed_list) {
+ ren_entry = list_entry(tmp, struct renamed_entry, list);
+ if(ren_entry->new_len != len)
+ continue;
+ list_for_each(tmp, &inode_info->renamed_list) {
+ ren_entry = list_entry(tmp, struct renamed_entry, list);
+ if(ren_entry->new_len != len)
+ continue;
+# define __ftopd(file) ((file)->private_data)
+/* file TO hidden_file */
+# define ftohf(file) ((ftopd(file))->wfi_file)
+# define __ftopd(file) ((file)->private_data)
+/* file TO hidden_file */
+# define ftohf(file) ((ftopd(file))->wfi_file)
+
+/* inode TO private_data */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+
+/* inode TO private_data */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,18)
+/* misc stuff */
+extern int mini_fo_tri_interpose(dentry_t *hidden_dentry,
+ dentry_t *hidden_sto_dentry,
+/* misc stuff */
+extern int mini_fo_tri_interpose(dentry_t *hidden_dentry,
+ dentry_t *hidden_sto_dentry,
+ super_block_t *sb, int flag);
+
+extern int mini_fo_cp_cont(dentry_t *tgt_dentry, struct vfsmount *tgt_mnt,
+ super_block_t *sb, int flag);
+
+extern int mini_fo_cp_cont(dentry_t *tgt_dentry, struct vfsmount *tgt_mnt,
+extern int __meta_put_lists(inode_t *inode);
+
+extern int meta_add_d_entry(dentry_t *dentry, const char *name, int len);
+extern int __meta_put_lists(inode_t *inode);
+
+extern int meta_add_d_entry(dentry_t *dentry, const char *name, int len);
-+extern int meta_add_r_entry(dentry_t *dentry,
-+ const char *old_name, int old_len,
++extern int meta_add_r_entry(dentry_t *dentry,
++ const char *old_name, int old_len,
+ const char *new_name, int new_len);
+
+extern int meta_remove_r_entry(dentry_t *dentry, const char *name, int len);
+ const char *new_name, int new_len);
+
+extern int meta_remove_r_entry(dentry_t *dentry, const char *name, int len);
-+extern int meta_list_add_r_entry(dentry_t *dentry,
-+ const char *old_name, int old_len,
++extern int meta_list_add_r_entry(dentry_t *dentry,
++ const char *old_name, int old_len,
+ const char *name, int len);
+
+extern int meta_write_d_entry(dentry_t *dentry, const char *name, int len);
+ const char *name, int len);
+
+extern int meta_write_d_entry(dentry_t *dentry, const char *name, int len);
-+extern int meta_write_r_entry(dentry_t *dentry,
-+ const char *old_name, int old_len,
++extern int meta_write_r_entry(dentry_t *dentry,
++ const char *old_name, int old_len,
+ const char *new_name, int new_len);
+
+extern int meta_sync_lists(dentry_t *dentry);
+ const char *new_name, int new_len);
+
+extern int meta_sync_lists(dentry_t *dentry);
+/* ndl stuff */
+extern int ndl_add_entry(struct readdir_data *rd, const char *name, int len);
+extern void ndl_put_list(struct readdir_data *rd);
+/* ndl stuff */
+extern int ndl_add_entry(struct readdir_data *rd, const char *name, int len);
+extern void ndl_put_list(struct readdir_data *rd);
+ echo "entry: $ENTRY"
+ META_FILE=`echo $ENTRY | cut -d ' ' -f 1`
+ OLD_B_DIR=`echo $ENTRY | cut -d ' ' -f 2 | sed -e 's/\///'`
+ echo "entry: $ENTRY"
+ META_FILE=`echo $ENTRY | cut -d ' ' -f 1`
+ OLD_B_DIR=`echo $ENTRY | cut -d ' ' -f 2 | sed -e 's/\///'`
+
+# delete all whiteouted files from base
+echo -e "\nDeleting whiteout'ed files from base file system..."
+
+# delete all whiteouted files from base
+echo -e "\nDeleting whiteout'ed files from base file system..."
+ META_FILE=`echo $ENTRY | cut -d ' ' -f 1`
+ DEL_NAME=`echo $ENTRY | cut -d ' ' -f 2`
+ DEL_FILE=`echo $META_FILE | sed -e "s/$META_NAME/$DEL_NAME/" | sed -e 's/^\.\///'`
+ META_FILE=`echo $ENTRY | cut -d ' ' -f 1`
+ DEL_NAME=`echo $ENTRY | cut -d ' ' -f 2`
+ DEL_FILE=`echo $META_FILE | sed -e "s/$META_NAME/$DEL_NAME/" | sed -e 's/^\.\///'`
+will use a storage directory called "sto-<base_dir_name>" in $STO_DIR,
+and mount point "mini_fo-<base_dir_dir>" in $MNT_DIR.
+
+will use a storage directory called "sto-<base_dir_name>" in $STO_DIR,
+and mount point "mini_fo-<base_dir_dir>" in $MNT_DIR.
+
+- made parsing of mount options more stable
+- New format of mount options! (See README)
+- I can't reproduce the unknown panic with 2.4.25 anymore, so I'll
+- made parsing of mount options more stable
+- New format of mount options! (See README)
+- I can't reproduce the unknown panic with 2.4.25 anymore, so I'll
-+- renaming device files, pipes, sockets, etc.
-+- creating, renaming, deleting of special files
++- renaming device files, pipes, sockets, etc.
++- creating, renaming, deleting of special files
+ dtohd(dentry)->d_inode->i_mode,
+ dtohd(dentry)->d_inode->i_rdev);
+ }
+ dtohd(dentry)->d_inode->i_mode,
+ dtohd(dentry)->d_inode->i_rdev);
+ }
+ else if(S_ISREG(dentry->d_inode->i_mode)) {
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ else if(S_ISREG(dentry->d_inode->i_mode)) {
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+ tgt_mnt = stopd(dentry->d_inode->i_sb)->hidden_mnt2;
+ src_dentry = dtohd(dentry);
+ src_mnt = stopd(dentry->d_inode->i_sb)->hidden_mnt;
+ tgt_mnt = stopd(dentry->d_inode->i_sb)->hidden_mnt2;
+ src_dentry = dtohd(dentry);
+ src_mnt = stopd(dentry->d_inode->i_sb)->hidden_mnt;
+{
+ int err = 0;
+
+ inode_t *hidden_sto_dir_inode;
+ dentry_t *hidden_sto_dir_dentry;
+ dentry_t *hidden_sto_dentry;
+{
+ int err = 0;
+
+ inode_t *hidden_sto_dir_inode;
+ dentry_t *hidden_sto_dir_dentry;
+ dentry_t *hidden_sto_dentry;
+ * CREATED */
+ if(!(dtost(dentry) == CREATED || (dtost(dentry) == DEL_REWRITTEN)) ||
+ S_ISDIR(dentry->d_inode->i_mode)) {
+ * CREATED */
+ if(!(dtost(dentry) == CREATED || (dtost(dentry) == DEL_REWRITTEN)) ||
+ S_ISDIR(dentry->d_inode->i_mode)) {
+ /* was: hidden_sto_dir_dentry = lock_parent(hidden_sto_dentry);*/
+ hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
+
+ /* was: hidden_sto_dir_dentry = lock_parent(hidden_sto_dentry);*/
+ hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
+
+ /* avoid destroying the hidden inode if the file is in use */
+ dget(hidden_sto_dentry);
+ err = vfs_unlink(hidden_sto_dir_inode, hidden_sto_dentry);
+ dput(hidden_sto_dentry);
+ if(!err)
+ d_delete(hidden_sto_dentry);
+ /* avoid destroying the hidden inode if the file is in use */
+ dget(hidden_sto_dentry);
+ err = vfs_unlink(hidden_sto_dir_inode, hidden_sto_dentry);
+ dput(hidden_sto_dentry);
+ if(!err)
+ d_delete(hidden_sto_dentry);
+ /* propagate number of hard-links */
+ dentry->d_inode->i_nlink = itohi2(dentry->d_inode)->i_nlink;
+ /* propagate number of hard-links */
+ dentry->d_inode->i_nlink = itohi2(dentry->d_inode)->i_nlink;
+ /* was: unlock_dir(hidden_sto_dir_dentry); */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+ mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
+ /* was: unlock_dir(hidden_sto_dir_dentry); */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+ mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
+ dentry_t *hidden_sto_dentry;
+ inode_t *hidden_sto_dir_inode;
+ dentry_t *hidden_sto_dir_dentry;
+ dentry_t *hidden_sto_dentry;
+ inode_t *hidden_sto_dir_inode;
+ dentry_t *hidden_sto_dir_dentry;
+ /* was hidden_sto_dir_dentry = lock_parent(hidden_sto_dentry); */
+ hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
+
+ /* was hidden_sto_dir_dentry = lock_parent(hidden_sto_dentry); */
+ hidden_sto_dir_dentry = dget(hidden_sto_dentry->d_parent);
+
+ /* avoid destroying the hidden inode if the file is in use */
+ dget(hidden_sto_dentry);
+ err = vfs_unlink(hidden_sto_dir_inode, hidden_sto_dentry);
+ dput(hidden_sto_dentry);
+ if(!err)
+ d_delete(hidden_sto_dentry);
+ /* avoid destroying the hidden inode if the file is in use */
+ dget(hidden_sto_dentry);
+ err = vfs_unlink(hidden_sto_dir_inode, hidden_sto_dentry);
+ dput(hidden_sto_dentry);
+ if(!err)
+ d_delete(hidden_sto_dentry);
+ /* propagate number of hard-links */
+ dentry->d_inode->i_nlink = itohi2(dentry->d_inode)->i_nlink;
+ /* propagate number of hard-links */
+ dentry->d_inode->i_nlink = itohi2(dentry->d_inode)->i_nlink;
+ /* dput base dentry, this will relase the inode and free the
+ * dentry, as we will never need it again. */
+ dput(dtohd(dentry));
+ /* dput base dentry, this will relase the inode and free the
+ * dentry, as we will never need it again. */
+ dput(dtohd(dentry));
+ /* was: unlock_dir(hidden_sto_dir_dentry); */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+ mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
+ /* was: unlock_dir(hidden_sto_dir_dentry); */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)
+ mutex_unlock(&hidden_sto_dir_dentry->d_inode->i_mutex);
+ /* next we have to get a negative dentry for the storage file */
+ err = get_neg_sto_dentry(dentry);
+
+ if(err)
+ /* next we have to get a negative dentry for the storage file */
+ err = get_neg_sto_dentry(dentry);
+
+ if(err)
+ /* dput base dentry, this will relase the inode and free the
+ * dentry, as we will never need it again. */
+ dput(dtohd(dentry));
+ dtohd(dentry) = NULL;
+ dtost(dentry) = DELETED;
+ /* dput base dentry, this will relase the inode and free the
+ * dentry, as we will never need it again. */
+ dput(dtohd(dentry));
+ dtohd(dentry) = NULL;
+ dtost(dentry) = DELETED;
+ /* I don't think ->a_ops is ever allowed to be NULL */
+ inode->i_mapping->a_ops = &mini_fo_empty_aops;
+}
+ /* I don't think ->a_ops is ever allowed to be NULL */
+ inode->i_mapping->a_ops = &mini_fo_empty_aops;
+}
+#if defined(FIST_DEBUG) || defined(FIST_FILTER_SCA)
+ write_inode: mini_fo_write_inode,
+#endif /* defined(FIST_DEBUG) || defined(FIST_FILTER_SCA) */
+#if defined(FIST_DEBUG) || defined(FIST_FILTER_SCA)
+ write_inode: mini_fo_write_inode,
+#endif /* defined(FIST_DEBUG) || defined(FIST_FILTER_SCA) */