diff options
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/dir.c | 4 | ||||
-rw-r--r-- | fs/ext2/ext2.h | 1 | ||||
-rw-r--r-- | fs/ext2/fsync.c | 1 | ||||
-rw-r--r-- | fs/ext2/inode.c | 26 | ||||
-rw-r--r-- | fs/ext2/ioctl.c | 1 | ||||
-rw-r--r-- | fs/ext2/super.c | 9 | ||||
-rw-r--r-- | fs/ext2/xattr_security.c | 1 | ||||
-rw-r--r-- | fs/ext2/xattr_trusted.c | 1 |
8 files changed, 28 insertions, 16 deletions
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index e89bfc8cf95..2bf49d7ef84 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c @@ -23,7 +23,6 @@ #include "ext2.h" #include <linux/pagemap.h> -#include <linux/smp_lock.h> typedef struct ext2_dir_entry_2 ext2_dirent; @@ -161,10 +160,7 @@ static struct page * ext2_get_page(struct inode *dir, unsigned long n) struct address_space *mapping = dir->i_mapping; struct page *page = read_mapping_page(mapping, n, NULL); if (!IS_ERR(page)) { - wait_on_page_locked(page); kmap(page); - if (!PageUptodate(page)) - goto fail; if (!PageChecked(page)) ext2_check_page(page); if (PageError(page)) diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index e2a0ea50af1..9fd0ec5ba0d 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h @@ -133,6 +133,7 @@ extern int ext2_get_block(struct inode *, sector_t, struct buffer_head *, int); extern void ext2_truncate (struct inode *); extern int ext2_setattr (struct dentry *, struct iattr *); extern void ext2_set_inode_flags(struct inode *inode); +extern void ext2_get_inode_flags(struct ext2_inode_info *); /* ioctl.c */ extern int ext2_ioctl (struct inode *, struct file *, unsigned int, diff --git a/fs/ext2/fsync.c b/fs/ext2/fsync.c index 7806b9e8155..fc66c93fcb5 100644 --- a/fs/ext2/fsync.c +++ b/fs/ext2/fsync.c @@ -23,7 +23,6 @@ */ #include "ext2.h" -#include <linux/smp_lock.h> #include <linux/buffer_head.h> /* for sync_mapping_buffers() */ diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index dd4e14c221e..0079b2cd531 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c @@ -1055,6 +1055,25 @@ void ext2_set_inode_flags(struct inode *inode) inode->i_flags |= S_DIRSYNC; } +/* Propagate flags from i_flags to EXT2_I(inode)->i_flags */ +void ext2_get_inode_flags(struct ext2_inode_info *ei) +{ + unsigned int flags = ei->vfs_inode.i_flags; + + ei->i_flags &= ~(EXT2_SYNC_FL|EXT2_APPEND_FL| + EXT2_IMMUTABLE_FL|EXT2_NOATIME_FL|EXT2_DIRSYNC_FL); + if (flags & S_SYNC) + ei->i_flags |= EXT2_SYNC_FL; + if (flags & S_APPEND) + ei->i_flags |= EXT2_APPEND_FL; + if (flags & S_IMMUTABLE) + ei->i_flags |= EXT2_IMMUTABLE_FL; + if (flags & S_NOATIME) + ei->i_flags |= EXT2_NOATIME_FL; + if (flags & S_DIRSYNC) + ei->i_flags |= EXT2_DIRSYNC_FL; +} + void ext2_read_inode (struct inode * inode) { struct ext2_inode_info *ei = EXT2_I(inode); @@ -1079,9 +1098,9 @@ void ext2_read_inode (struct inode * inode) } inode->i_nlink = le16_to_cpu(raw_inode->i_links_count); inode->i_size = le32_to_cpu(raw_inode->i_size); - inode->i_atime.tv_sec = le32_to_cpu(raw_inode->i_atime); - inode->i_ctime.tv_sec = le32_to_cpu(raw_inode->i_ctime); - inode->i_mtime.tv_sec = le32_to_cpu(raw_inode->i_mtime); + inode->i_atime.tv_sec = (signed)le32_to_cpu(raw_inode->i_atime); + inode->i_ctime.tv_sec = (signed)le32_to_cpu(raw_inode->i_ctime); + inode->i_mtime.tv_sec = (signed)le32_to_cpu(raw_inode->i_mtime); inode->i_atime.tv_nsec = inode->i_mtime.tv_nsec = inode->i_ctime.tv_nsec = 0; ei->i_dtime = le32_to_cpu(raw_inode->i_dtime); /* We now have enough fields to check if the inode was active or not. @@ -1188,6 +1207,7 @@ static int ext2_update_inode(struct inode * inode, int do_sync) if (ei->i_state & EXT2_STATE_NEW) memset(raw_inode, 0, EXT2_SB(sb)->s_inode_size); + ext2_get_inode_flags(ei); raw_inode->i_mode = cpu_to_le16(inode->i_mode); if (!(test_opt(sb, NO_UID32))) { raw_inode->i_uid_low = cpu_to_le16(low_16_bits(uid)); diff --git a/fs/ext2/ioctl.c b/fs/ext2/ioctl.c index 4b099d31071..e85c4821823 100644 --- a/fs/ext2/ioctl.c +++ b/fs/ext2/ioctl.c @@ -27,6 +27,7 @@ int ext2_ioctl (struct inode * inode, struct file * filp, unsigned int cmd, switch (cmd) { case EXT2_IOC_GETFLAGS: + ext2_get_inode_flags(ei); flags = ei->i_flags & EXT2_FL_USER_VISIBLE; return put_user(flags, (int __user *) arg); case EXT2_IOC_SETFLAGS: { diff --git a/fs/ext2/super.c b/fs/ext2/super.c index a046a419d8a..16337bff027 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c @@ -160,14 +160,11 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag { struct ext2_inode_info *ei = (struct ext2_inode_info *) foo; - if ((flags & (SLAB_CTOR_VERIFY|SLAB_CTOR_CONSTRUCTOR)) == - SLAB_CTOR_CONSTRUCTOR) { - rwlock_init(&ei->i_meta_lock); + rwlock_init(&ei->i_meta_lock); #ifdef CONFIG_EXT2_FS_XATTR - init_rwsem(&ei->xattr_sem); + init_rwsem(&ei->xattr_sem); #endif - inode_init_once(&ei->vfs_inode); - } + inode_init_once(&ei->vfs_inode); } static int init_inodecache(void) diff --git a/fs/ext2/xattr_security.c b/fs/ext2/xattr_security.c index a2661279847..eaa23d2d521 100644 --- a/fs/ext2/xattr_security.c +++ b/fs/ext2/xattr_security.c @@ -6,7 +6,6 @@ #include <linux/module.h> #include <linux/string.h> #include <linux/fs.h> -#include <linux/smp_lock.h> #include <linux/ext2_fs.h> #include <linux/security.h> #include "xattr.h" diff --git a/fs/ext2/xattr_trusted.c b/fs/ext2/xattr_trusted.c index f28a6a499c9..83ee149f353 100644 --- a/fs/ext2/xattr_trusted.c +++ b/fs/ext2/xattr_trusted.c @@ -9,7 +9,6 @@ #include <linux/string.h> #include <linux/capability.h> #include <linux/fs.h> -#include <linux/smp_lock.h> #include <linux/ext2_fs.h> #include "xattr.h" |