Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Copy i_flags to jfs inode flags on write

This mirrors Jan Kara's patches for ext3. This patch makes sure that
changes made to inode->i_flags are reflected on disk for jfs. It also
moves a call of jfs_set_inode_flags() to be more consistent with where
jfs_get_inode_flags() is called.

Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>

+23 -1
-1
fs/jfs/inode.c
··· 55 55 inode->i_op = &jfs_file_inode_operations; 56 56 init_special_inode(inode, inode->i_mode, inode->i_rdev); 57 57 } 58 - jfs_set_inode_flags(inode); 59 58 } 60 59 61 60 /*
+2
fs/jfs/ioctl.c
··· 59 59 60 60 switch (cmd) { 61 61 case JFS_IOC_GETFLAGS: 62 + jfs_get_inode_flags(jfs_inode); 62 63 flags = jfs_inode->mode2 & JFS_FL_USER_VISIBLE; 63 64 flags = jfs_map_ext2(flags, 0); 64 65 return put_user(flags, (int __user *) arg); ··· 79 78 if (!S_ISDIR(inode->i_mode)) 80 79 flags &= ~JFS_DIRSYNC_FL; 81 80 81 + jfs_get_inode_flags(jfs_inode); 82 82 oldflags = jfs_inode->mode2; 83 83 84 84 /*
+2
fs/jfs/jfs_imap.c
··· 3078 3078 3079 3079 jfs_ip->fileset = le32_to_cpu(dip->di_fileset); 3080 3080 jfs_ip->mode2 = le32_to_cpu(dip->di_mode); 3081 + jfs_set_inode_flags(ip); 3081 3082 3082 3083 ip->i_mode = le32_to_cpu(dip->di_mode) & 0xffff; 3083 3084 if (sbi->umask != -1) { ··· 3175 3174 dip->di_gid = cpu_to_le32(ip->i_gid); 3176 3175 else 3177 3176 dip->di_gid = cpu_to_le32(jfs_ip->saved_gid); 3177 + jfs_get_inode_flags(jfs_ip); 3178 3178 /* 3179 3179 * mode2 is only needed for storing the higher order bits. 3180 3180 * Trust i_mode for the lower order ones
+18
fs/jfs/jfs_inode.c
··· 45 45 inode->i_flags |= S_SYNC; 46 46 } 47 47 48 + void jfs_get_inode_flags(struct jfs_inode_info *jfs_ip) 49 + { 50 + unsigned int flags = jfs_ip->vfs_inode.i_flags; 51 + 52 + jfs_ip->mode2 &= ~(JFS_IMMUTABLE_FL | JFS_APPEND_FL | JFS_NOATIME_FL | 53 + JFS_DIRSYNC_FL | JFS_SYNC_FL); 54 + if (flags & S_IMMUTABLE) 55 + jfs_ip->mode2 |= JFS_IMMUTABLE_FL; 56 + if (flags & S_APPEND) 57 + jfs_ip->mode2 |= JFS_APPEND_FL; 58 + if (flags & S_NOATIME) 59 + jfs_ip->mode2 |= JFS_NOATIME_FL; 60 + if (flags & S_DIRSYNC) 61 + jfs_ip->mode2 |= JFS_DIRSYNC_FL; 62 + if (flags & S_SYNC) 63 + jfs_ip->mode2 |= JFS_SYNC_FL; 64 + } 65 + 48 66 /* 49 67 * NAME: ialloc() 50 68 *
+1
fs/jfs/jfs_inode.h
··· 31 31 extern void jfs_truncate_nolock(struct inode *, loff_t); 32 32 extern void jfs_free_zero_link(struct inode *); 33 33 extern struct dentry *jfs_get_parent(struct dentry *dentry); 34 + extern void jfs_get_inode_flags(struct jfs_inode_info *); 34 35 extern void jfs_set_inode_flags(struct inode *); 35 36 extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int); 36 37