diff -uNr fistgen-0.0.6.1.pristine/fistgen.h fistgen-0.0.6.1.wls/fistgen.h --- fistgen-0.0.6.1.pristine/fistgen.h Wed Jan 29 20:12:50 2003 +++ fistgen-0.0.6.1.wls/fistgen.h Thu Apr 17 17:59:26 2003 @@ -21,7 +21,7 @@ #define MAX_ENCODING_BLOCKSIZE 4096 /* in bytes */ #define MAX_FILE_FORMATS 10 #define MAX_IOCTLS 10 -#define MAX_RULES 20 +#define MAX_RULES 40 #define MAX_FSNAME_LEN 80 #define MAX_BUF_LEN 512 #define MAX_FUNCARGS 10 diff -uNr fistgen-0.0.6.1.pristine/templates/Linux-2.4/attach.c fistgen-0.0.6.1.wls/templates/Linux-2.4/attach.c --- fistgen-0.0.6.1.pristine/templates/Linux-2.4/attach.c Fri Dec 27 15:19:03 2002 +++ fistgen-0.0.6.1.wls/templates/Linux-2.4/attach.c Thu Apr 17 21:54:12 2003 @@ -356,6 +356,8 @@ print_entry_location(); + FIST_OP_STATFS_PRECALL; + buf->f_type = WRAPFS_SUPER_MAGIC; buf->f_bsize = PAGE_SIZE / sizeof(long); buf->f_bfree = 0; @@ -372,6 +374,8 @@ read_unlock(&(stopd(sb)->attachlock)); + FIST_OP_STATFS_POSTCALL; + print_exit_status(err); return err; } diff -uNr fistgen-0.0.6.1.pristine/templates/Linux-2.4/file.c fistgen-0.0.6.1.wls/templates/Linux-2.4/file.c --- fistgen-0.0.6.1.pristine/templates/Linux-2.4/file.c Mon Jan 20 18:01:20 2003 +++ fistgen-0.0.6.1.wls/templates/Linux-2.4/file.c Thu Apr 17 19:36:20 2003 @@ -141,13 +141,17 @@ int err = -EINVAL; file_t *hidden_file; loff_t pos = *ppos; + const char *name; print_entry_location(); hidden_file = ftohf(file); /* CPW: Moved to after print_entry_location */ + name = file->f_dentry->d_name.name; /* WLS strcpy needed? */ if (!hidden_file->f_op || !hidden_file->f_op->read) goto out; + FIST_OP_READ_PRECALL; + err = hidden_file->f_op->read(hidden_file, buf, count, &pos); if (err >= 0) { @@ -156,6 +160,8 @@ hidden_file->f_dentry->d_inode); } + FIST_OP_READ_POSTCALL; + // MAJOR HACK /* * because pread() does not have any way to tell us that it is @@ -188,15 +194,19 @@ inode_t *inode; inode_t *hidden_inode; loff_t pos = *ppos; + const char *name; print_entry_location(); hidden_file = ftohf(file); /* CPW: Moved to after print_entry_location */ + name = file->f_dentry->d_name.name; /* WLS strcpy needed? */ inode = file->f_dentry->d_inode; hidden_inode = itohi(inode); if (!hidden_file->f_op || !hidden_file->f_op->write) goto out; + FIST_OP_WRITE_PRECALL; + /* adjust for append -- seek to the end of the file */ if (file->f_flags & O_APPEND) pos = inode->i_size; @@ -210,6 +220,8 @@ if (err >= 0) fist_copy_attr_times(inode, hidden_inode); + FIST_OP_WRITE_POSTCALL; + /* * XXX: MAJOR HACK * @@ -293,13 +305,17 @@ #if defined(FIST_FILTER_NAME) || defined(FIST_FILTER_SCA) struct wrapfs_getdents_callback buf; #endif /* FIST_FILTER_NAME || FIST_FILTER_SCA */ + const char *name; print_entry_location(); hidden_file = ftohf(file); /* CPW: Moved to after print_entry_location */ inode = file->f_dentry->d_inode; + name = file->f_dentry->d_name.name; /* WLS strcpy needed? */ fist_checkinode(inode, "wrapfs_readdir"); + FIST_OP_READDIR_PRECALL; + #if defined(FIST_FILTER_NAME) || defined(FIST_FILTER_SCA) /* prepare for callback */ buf.dirent = dirent; @@ -314,6 +330,8 @@ if (err > 0) fist_copy_attr_atime(inode, hidden_file->f_dentry->d_inode); + FIST_OP_READDIR_POSTCALL; + fist_checkinode(inode, "post wrapfs_readdir"); print_exit_status(err); return err; diff -uNr fistgen-0.0.6.1.pristine/templates/Linux-2.4/inode.c fistgen-0.0.6.1.wls/templates/Linux-2.4/inode.c --- fistgen-0.0.6.1.pristine/templates/Linux-2.4/inode.c Fri Dec 27 15:19:04 2002 +++ fistgen-0.0.6.1.wls/templates/Linux-2.4/inode.c Thu Apr 17 21:36:40 2003 @@ -29,12 +29,16 @@ int err; dentry_t *hidden_dentry; dentry_t *hidden_dir_dentry; + const char *name; print_entry_location(); hidden_dentry = wrapfs_hidden_dentry(dentry); /* CPW: Moved below print_entry_location */ + name = dentry->d_name.name; ASSERT(hidden_dentry != NULL); fist_checkinode(dir, "wrapfs_create"); + FIST_OP_CREATE_PRECALL; + hidden_dir_dentry = lock_parent(hidden_dentry); err = PTR_ERR(hidden_dir_dentry); if (IS_ERR(hidden_dir_dentry)) @@ -45,6 +49,8 @@ if (err) goto out_lock; + FIST_OP_CREATE_POSTCALL; + err = wrapfs_interpose(hidden_dentry, dentry, dir->i_sb, 0); if (err) goto out_lock; @@ -241,14 +247,19 @@ dentry_t *hidden_old_dentry; dentry_t *hidden_new_dentry; dentry_t *hidden_dir_dentry; + /* WLS: How to handle the fact that link has an old and new name? */ + const char *name; print_entry_location(); hidden_old_dentry = wrapfs_hidden_dentry(old_dentry); /* CPW: Moved below print_entry_location */ hidden_new_dentry = wrapfs_hidden_dentry(new_dentry); + name = new_dentry->d_name.name; /* WLS Likewise, how to handle other dentry? */ fist_checkinode(dir, "wrapfs_link-dir"); fist_checkinode(old_dentry->d_inode, "wrapfs_link-oldinode"); + FIST_OP_LINK_PRECALL; + dget(hidden_old_dentry); dget(hidden_new_dentry); hidden_dir_dentry = lock_parent(hidden_new_dentry); @@ -277,6 +288,8 @@ if (err || !hidden_new_dentry->d_inode) goto out_lock; + FIST_OP_LINK_POSTCALL; + err = wrapfs_interpose(hidden_new_dentry, new_dentry, dir->i_sb, 0); if (err) goto out_lock; @@ -304,11 +317,13 @@ inode_t *hidden_dir; dentry_t *hidden_dentry; dentry_t *hidden_dir_dentry; + const char *name; print_entry_location(); hidden_dir = itohi(dir); /* CPW: Moved below print_entry_location */ hidden_dentry = wrapfs_hidden_dentry(dentry); + name = dentry->d_name.name; ASSERT(hidden_dentry != NULL); fist_checkinode(dir, "wrapfs_unlink-dir"); @@ -316,6 +331,8 @@ dget(dentry); hidden_dir_dentry = lock_parent(hidden_dentry); + FIST_OP_UNLINK_PRECALL; + #ifdef FIST_FILTER_SCA /* first unlink the index file */ if (dentry->d_inode) { @@ -345,6 +362,8 @@ if (!err) /* vfs_unlink does that */ d_delete(hidden_dentry); + FIST_OP_UNLINK_POSTCALL; + out_lock: fist_copy_attr_times(dir, hidden_dir); /* propagate number of hard-links */ @@ -375,6 +394,7 @@ int err; dentry_t *hidden_dentry; dentry_t *hidden_dir_dentry; + const char *name; #ifdef FIST_FILTER_NAME char *encoded_symname; unsigned int encoded_symlen; @@ -382,11 +402,14 @@ print_entry_location(); hidden_dentry = wrapfs_hidden_dentry(dentry); /* CPW: Moved below print_entry_location */ + name = dentry->d_name.name; fist_checkinode(dir, "wrapfs_symlink-dir"); dget(hidden_dentry); hidden_dir_dentry = lock_parent(hidden_dentry); + FIST_OP_SYMLINK_PRECALL; + #ifndef FIST_FILTER_NAME err = vfs_symlink(hidden_dir_dentry->d_inode, hidden_dentry, @@ -407,6 +430,8 @@ if (err) goto out_lock; + FIST_OP_SYMLINK_POSTCALL; + fist_copy_attr_timesizes(dir, hidden_dir_dentry->d_inode); fist_checkinode(dir, "post wrapfs_symlink-dir"); @@ -427,13 +452,17 @@ int err; dentry_t *hidden_dentry; dentry_t *hidden_dir_dentry; + const char *name; print_entry_location(); hidden_dentry = wrapfs_hidden_dentry(dentry); /* CPW: Moved below print_entry_location */ + name = dentry->d_name.name; fist_checkinode(dir, "wrapfs_mkdir-dir"); hidden_dir_dentry = lock_parent(hidden_dentry); + FIST_OP_MKDIR_PRECALL; + err = vfs_mkdir(hidden_dir_dentry->d_inode, hidden_dentry, mode); @@ -444,6 +473,8 @@ if (err) goto out; + FIST_OP_MKDIR_POSTCALL; + fist_copy_attr_timesizes(dir, hidden_dir_dentry->d_inode); /* update number of links on parent directory */ dir->i_nlink = hidden_dir_dentry->d_inode->i_nlink; @@ -466,14 +497,18 @@ int err = 0; dentry_t *hidden_dentry; dentry_t *hidden_dir_dentry; + const char *name; print_entry_location(); hidden_dentry = wrapfs_hidden_dentry(dentry); /* CPW: Moved below print_entry_location */ + name = dentry->d_name.name; fist_checkinode(dir, "wrapfs_rmdir-dir"); dget(dentry); hidden_dir_dentry = lock_parent(hidden_dentry); + FIST_OP_RMDIR_PRECALL; + /* avoid destroying the hidden inode if the file is in use */ dget(hidden_dentry); err = vfs_rmdir(hidden_dir_dentry->d_inode, hidden_dentry); @@ -482,6 +517,8 @@ if (!err) /* vfs_rmdir does that */ d_delete(hidden_dentry); + FIST_OP_RMDIR_POSTCALL; + out_lock: fist_copy_attr_times(dir, hidden_dir_dentry->d_inode); /* copy the nlink count for our dentry and our parent's dentry */ @@ -547,15 +584,19 @@ dentry_t *hidden_new_dentry; dentry_t *hidden_old_dir_dentry; dentry_t *hidden_new_dir_dentry; + const char *name; print_entry_location(); hidden_old_dentry = wrapfs_hidden_dentry(old_dentry);/* CPW: Moved below print_entry_location */ hidden_new_dentry = wrapfs_hidden_dentry(new_dentry); + name = old_dentry->d_name.name; /* WLS How to handle two dentry function? */ fist_checkinode(old_dir, "wrapfs_rename-old_dir"); fist_checkinode(new_dir, "wrapfs_rename-new_dir"); + FIST_OP_RENAME_PRECALL; + dget(hidden_old_dentry); dget(hidden_new_dentry); hidden_old_dir_dentry = get_parent(hidden_old_dentry); @@ -581,6 +622,8 @@ if (err) goto out_lock; + FIST_OP_RENAME_POSTCALL; + 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); @@ -603,6 +646,7 @@ { int err; dentry_t *hidden_dentry; + const char *name; #ifdef FIST_FILTER_NAME char *decoded_name, *hidden_buf; mm_segment_t old_fs; @@ -610,6 +654,7 @@ print_entry_location(); hidden_dentry = wrapfs_hidden_dentry(dentry);/* CPW: Moved below print_entry_location */ + name = dentry->d_name.name; fist_print_dentry("wrapfs_readlink IN", dentry); if (!hidden_dentry->d_inode->i_op || @@ -618,6 +663,8 @@ goto out; } + FIST_OP_READLINK_PRECALL; + #ifndef FIST_FILTER_NAME err = hidden_dentry->d_inode->i_op->readlink(hidden_dentry, buf, @@ -654,6 +701,8 @@ kfree(hidden_buf); #endif /* FIST_FILTER_NAME */ + FIST_OP_READLINK_POSTCALL; + out: print_exit_status(err); return err; @@ -987,15 +1036,19 @@ { int err = 0; dentry_t *hidden_dentry; + const char *name; inode_t *inode; inode_t *hidden_inode; print_entry_location(); hidden_dentry = wrapfs_hidden_dentry(dentry); + name = dentry->d_name.name; inode = dentry->d_inode; hidden_inode = itohi(inode); fist_checkinode(inode, "wrapfs_setattr"); + FIST_OP_SETATTR_PRECALL; + #ifdef FIST_FILTER_SCA if (ia->ia_valid & ATTR_SIZE) { dentry->d_inode->i_size = ia->ia_size; @@ -1015,6 +1068,8 @@ #endif /* not FIST_FILTER_SCA */ err = notify_change(hidden_dentry, ia); + FIST_OP_SETATTR_POSTCALL; + #if defined(FIST_FILTER_DATA) || defined(FIST_FILTER_SCA) out: #endif /* FIST_FILTER_DATA || FIST_FILTER_SCA */ @@ -1035,6 +1090,19 @@ STATIC int wrapfs_getattr(dentry_t *dentry, struct iattr *ia) { + /* + * Kinda pointless at the moment as wrapfs_getattr's disabled, but... + */ + const char *name; + + name = dentry->d_name.name; + + FIST_OP_GETATTR_PRECALL; + + + + FIST_OP_GETATTR_POSTCALL; + return -ENOSYS; } #endif /* NOT_USED_YET */ diff -uNr fistgen-0.0.6.1.pristine/templates/Linux-2.4/super.c fistgen-0.0.6.1.wls/templates/Linux-2.4/super.c --- fistgen-0.0.6.1.pristine/templates/Linux-2.4/super.c Sun Feb 9 23:35:11 2003 +++ fistgen-0.0.6.1.wls/templates/Linux-2.4/super.c Thu Apr 17 21:56:18 2003 @@ -178,9 +178,14 @@ super_block_t *hidden_sb; print_entry_location(); + + FIST_OP_STATFS_PRECALL; + hidden_sb = stohs(sb); err = vfs_statfs(hidden_sb, buf); + FIST_OP_STATFS_POSTCALL; + print_exit_status(err); return err; }