aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/jfs/inode.c1
-rw-r--r--fs/jfs/ioctl.c2
-rw-r--r--fs/jfs/jfs_imap.c2
-rw-r--r--fs/jfs/jfs_inode.c18
-rw-r--r--fs/jfs/jfs_inode.h1
5 files changed, 23 insertions, 1 deletions
diff --git a/fs/jfs/inode.c b/fs/jfs/inode.c
index e285022f006c..3467dde27e5a 100644
--- a/fs/jfs/inode.c
+++ b/fs/jfs/inode.c
@@ -55,7 +55,6 @@ void jfs_read_inode(struct inode *inode)
55 inode->i_op = &jfs_file_inode_operations; 55 inode->i_op = &jfs_file_inode_operations;
56 init_special_inode(inode, inode->i_mode, inode->i_rdev); 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/*
diff --git a/fs/jfs/ioctl.c b/fs/jfs/ioctl.c
index ed814b1ff4d9..fe063af6fd2f 100644
--- a/fs/jfs/ioctl.c
+++ b/fs/jfs/ioctl.c
@@ -59,6 +59,7 @@ int jfs_ioctl(struct inode * inode, struct file * filp, unsigned int cmd,
59 59
60 switch (cmd) { 60 switch (cmd) {
61 case JFS_IOC_GETFLAGS: 61 case JFS_IOC_GETFLAGS:
62 jfs_get_inode_flags(jfs_inode);
62 flags = jfs_inode->mode2 & JFS_FL_USER_VISIBLE; 63 flags = jfs_inode->mode2 & JFS_FL_USER_VISIBLE;
63 flags = jfs_map_ext2(flags, 0); 64 flags = jfs_map_ext2(flags, 0);
64 return put_user(flags, (int __user *) arg); 65 return put_user(flags, (int __user *) arg);
@@ -78,6 +79,7 @@ int jfs_ioctl(struct inode * inode, struct file * filp, unsigned int cmd,
78 if (!S_ISDIR(inode->i_mode)) 79 if (!S_ISDIR(inode->i_mode))
79 flags &= ~JFS_DIRSYNC_FL; 80 flags &= ~JFS_DIRSYNC_FL;
80 81
82 jfs_get_inode_flags(jfs_inode);
81 oldflags = jfs_inode->mode2; 83 oldflags = jfs_inode->mode2;
82 84
83 /* 85 /*
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
index aa5124b643b1..c465607be991 100644
--- a/fs/jfs/jfs_imap.c
+++ b/fs/jfs/jfs_imap.c
@@ -3078,6 +3078,7 @@ static int copy_from_dinode(struct dinode * dip, struct inode *ip)
3078 3078
3079 jfs_ip->fileset = le32_to_cpu(dip->di_fileset); 3079 jfs_ip->fileset = le32_to_cpu(dip->di_fileset);
3080 jfs_ip->mode2 = le32_to_cpu(dip->di_mode); 3080 jfs_ip->mode2 = le32_to_cpu(dip->di_mode);
3081 jfs_set_inode_flags(ip);
3081 3082
3082 ip->i_mode = le32_to_cpu(dip->di_mode) & 0xffff; 3083 ip->i_mode = le32_to_cpu(dip->di_mode) & 0xffff;
3083 if (sbi->umask != -1) { 3084 if (sbi->umask != -1) {
@@ -3174,6 +3175,7 @@ static void copy_to_dinode(struct dinode * dip, struct inode *ip)
3174 dip->di_gid = cpu_to_le32(ip->i_gid); 3175 dip->di_gid = cpu_to_le32(ip->i_gid);
3175 else 3176 else
3176 dip->di_gid = cpu_to_le32(jfs_ip->saved_gid); 3177 dip->di_gid = cpu_to_le32(jfs_ip->saved_gid);
3178 jfs_get_inode_flags(jfs_ip);
3177 /* 3179 /*
3178 * mode2 is only needed for storing the higher order bits. 3180 * mode2 is only needed for storing the higher order bits.
3179 * Trust i_mode for the lower order ones 3181 * Trust i_mode for the lower order ones
diff --git a/fs/jfs/jfs_inode.c b/fs/jfs/jfs_inode.c
index 4c67ed97682b..ed6574bee51a 100644
--- a/fs/jfs/jfs_inode.c
+++ b/fs/jfs/jfs_inode.c
@@ -45,6 +45,24 @@ void jfs_set_inode_flags(struct inode *inode)
45 inode->i_flags |= S_SYNC; 45 inode->i_flags |= S_SYNC;
46} 46}
47 47
48void 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 * NAME: ialloc() 67 * NAME: ialloc()
50 * 68 *
diff --git a/fs/jfs/jfs_inode.h b/fs/jfs/jfs_inode.h
index 6802837f757e..2374b595f2e1 100644
--- a/fs/jfs/jfs_inode.h
+++ b/fs/jfs/jfs_inode.h
@@ -31,6 +31,7 @@ extern void jfs_truncate(struct inode *);
31extern void jfs_truncate_nolock(struct inode *, loff_t); 31extern void jfs_truncate_nolock(struct inode *, loff_t);
32extern void jfs_free_zero_link(struct inode *); 32extern void jfs_free_zero_link(struct inode *);
33extern struct dentry *jfs_get_parent(struct dentry *dentry); 33extern struct dentry *jfs_get_parent(struct dentry *dentry);
34extern void jfs_get_inode_flags(struct jfs_inode_info *);
34extern void jfs_set_inode_flags(struct inode *); 35extern void jfs_set_inode_flags(struct inode *);
35extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int); 36extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
36 37