diff -NurpP --minimal linux-2.6.17-vs2.0.2-rc23/fs/jfs/Makefile linux-2.6.17-vs2.0.2-rc23.0.1/fs/jfs/Makefile --- linux-2.6.17-vs2.0.2-rc23/fs/jfs/Makefile 2006-06-18 05:28:30 +0200 +++ linux-2.6.17-vs2.0.2-rc23.0.1/fs/jfs/Makefile 2006-06-18 16:01:22 +0200 @@ -8,7 +8,8 @@ jfs-y := super.o file.o inode.o namei jfs_xtree.o jfs_imap.o jfs_debug.o jfs_dmap.o \ jfs_unicode.o jfs_dtree.o jfs_inode.o \ jfs_extent.o symlink.o jfs_metapage.o \ - jfs_logmgr.o jfs_txnmgr.o jfs_uniupr.o resize.o xattr.o + jfs_logmgr.o jfs_txnmgr.o jfs_uniupr.o \ + resize.o xattr.o ioctl.o jfs-$(CONFIG_JFS_POSIX_ACL) += acl.o diff -NurpP --minimal linux-2.6.17-vs2.0.2-rc23/fs/jfs/file.c linux-2.6.17-vs2.0.2-rc23.0.1/fs/jfs/file.c --- linux-2.6.17-vs2.0.2-rc23/fs/jfs/file.c 2006-06-18 05:28:30 +0200 +++ linux-2.6.17-vs2.0.2-rc23.0.1/fs/jfs/file.c 2006-06-18 15:44:41 +0200 @@ -98,6 +98,7 @@ struct inode_operations jfs_file_inode_o .setattr = jfs_setattr, .permission = jfs_permission, #endif + .sync_flags = jfs_sync_flags, }; const struct file_operations jfs_file_operations = { @@ -113,4 +114,5 @@ const struct file_operations jfs_file_op .sendfile = generic_file_sendfile, .fsync = jfs_fsync, .release = jfs_release, + .ioctl = jfs_ioctl, }; diff -NurpP --minimal linux-2.6.17-vs2.0.2-rc23/fs/jfs/inode.c linux-2.6.17-vs2.0.2-rc23.0.1/fs/jfs/inode.c --- linux-2.6.17-vs2.0.2-rc23/fs/jfs/inode.c 2006-06-18 05:28:30 +0200 +++ linux-2.6.17-vs2.0.2-rc23.0.1/fs/jfs/inode.c 2006-06-18 15:42:00 +0200 @@ -56,6 +56,7 @@ void jfs_read_inode(struct inode *inode) inode->i_op = &jfs_file_inode_operations; init_special_inode(inode, inode->i_mode, inode->i_rdev); } + jfs_set_inode_flags(inode); } /* diff -NurpP --minimal linux-2.6.17-vs2.0.2-rc23/fs/jfs/jfs_inode.c linux-2.6.17-vs2.0.2-rc23.0.1/fs/jfs/jfs_inode.c --- linux-2.6.17-vs2.0.2-rc23/fs/jfs/jfs_inode.c 2006-06-18 05:28:30 +0200 +++ linux-2.6.17-vs2.0.2-rc23.0.1/fs/jfs/jfs_inode.c 2006-06-18 15:42:00 +0200 @@ -27,6 +27,66 @@ #include "jfs_dinode.h" #include "jfs_debug.h" + +void jfs_set_inode_flags(struct inode *inode) +{ + unsigned int flags = JFS_IP(inode)->mode2; + + inode->i_flags &= ~(S_IMMUTABLE | S_IUNLINK | S_BARRIER | + S_SYNC | S_APPEND | S_NOATIME | S_DIRSYNC); + + if (flags & JFS_IMMUTABLE_FL) + inode->i_flags |= S_IMMUTABLE; + if (flags & JFS_IUNLINK_FL) + inode->i_flags |= S_IUNLINK; + if (flags & JFS_BARRIER_FL) + inode->i_flags |= S_BARRIER; + + if (flags & JFS_SYNC_FL) + inode->i_flags |= S_SYNC; + if (flags & JFS_APPEND_FL) + inode->i_flags |= S_APPEND; + if (flags & JFS_NOATIME_FL) + inode->i_flags |= S_NOATIME; + if (flags & JFS_DIRSYNC_FL) + inode->i_flags |= S_DIRSYNC; +} + +int jfs_sync_flags(struct inode *inode) +{ + unsigned int oldflags, newflags; + + oldflags = JFS_IP(inode)->mode2; + newflags = oldflags & ~(JFS_APPEND_FL | + JFS_IMMUTABLE_FL | JFS_IUNLINK_FL | + JFS_BARRIER_FL | JFS_NOATIME_FL | + JFS_SYNC_FL | JFS_DIRSYNC_FL); + + if (IS_APPEND(inode)) + newflags |= JFS_APPEND_FL; + if (IS_IMMUTABLE(inode)) + newflags |= JFS_IMMUTABLE_FL; + if (IS_IUNLINK(inode)) + newflags |= JFS_IUNLINK_FL; + if (IS_BARRIER(inode)) + newflags |= JFS_BARRIER_FL; + + /* we do not want to copy superblock flags */ + if (inode->i_flags & S_NOATIME) + newflags |= JFS_NOATIME_FL; + if (inode->i_flags & S_SYNC) + newflags |= JFS_SYNC_FL; + if (inode->i_flags & S_DIRSYNC) + newflags |= JFS_DIRSYNC_FL; + + if (oldflags ^ newflags) { + JFS_IP(inode)->mode2 = newflags; + inode->i_ctime = CURRENT_TIME; + mark_inode_dirty(inode); + } + return 0; +} + /* * NAME: ialloc() * @@ -124,6 +184,7 @@ struct inode *ialloc(struct inode *paren jfs_inode->atlhead = 0; jfs_inode->atltail = 0; jfs_inode->xtlid = 0; + jfs_set_inode_flags(inode); jfs_info("ialloc returns inode = 0x%p\n", inode); diff -NurpP --minimal linux-2.6.17-vs2.0.2-rc23/fs/jfs/jfs_inode.h linux-2.6.17-vs2.0.2-rc23.0.1/fs/jfs/jfs_inode.h --- linux-2.6.17-vs2.0.2-rc23/fs/jfs/jfs_inode.h 2006-06-18 05:28:30 +0200 +++ linux-2.6.17-vs2.0.2-rc23.0.1/fs/jfs/jfs_inode.h 2006-06-18 15:42:00 +0200 @@ -20,6 +20,8 @@ extern struct inode *ialloc(struct inode *, umode_t); extern int jfs_fsync(struct file *, struct dentry *, int); +extern int jfs_ioctl(struct inode *, struct file *, + unsigned int, unsigned long); extern void jfs_read_inode(struct inode *); extern int jfs_commit_inode(struct inode *, int); extern int jfs_write_inode(struct inode*, int); @@ -29,6 +31,8 @@ extern void jfs_truncate(struct inode *) extern void jfs_truncate_nolock(struct inode *, loff_t); extern void jfs_free_zero_link(struct inode *); extern struct dentry *jfs_get_parent(struct dentry *dentry); +extern int jfs_sync_flags(struct inode *); +extern void jfs_set_inode_flags(struct inode *); extern struct address_space_operations jfs_aops; extern struct inode_operations jfs_dir_inode_operations; diff -NurpP --minimal linux-2.6.17-vs2.0.2-rc23/fs/jfs/namei.c linux-2.6.17-vs2.0.2-rc23.0.1/fs/jfs/namei.c --- linux-2.6.17-vs2.0.2-rc23/fs/jfs/namei.c 2006-06-18 07:20:20 +0200 +++ linux-2.6.17-vs2.0.2-rc23.0.1/fs/jfs/namei.c 2006-06-18 15:42:00 +0200 @@ -1519,12 +1519,14 @@ struct inode_operations jfs_dir_inode_op .setattr = jfs_setattr, .permission = jfs_permission, #endif + .sync_flags = jfs_sync_flags, }; const struct file_operations jfs_dir_operations = { .read = generic_read_dir, .readdir = jfs_readdir, .fsync = jfs_fsync, + .ioctl = jfs_ioctl, }; static int jfs_ci_hash(struct dentry *dir, struct qstr *this)