fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / fs / ext2 / inode.c
index 3e00095..31f2052 100644 (file)
@@ -31,7 +31,7 @@
 #include <linux/writeback.h>
 #include <linux/buffer_head.h>
 #include <linux/mpage.h>
-#include <linux/vserver/xid.h>
+#include <linux/vs_tag.h>
 #include "ext2.h"
 #include "acl.h"
 #include "xip.h"
@@ -668,18 +668,6 @@ static sector_t ext2_bmap(struct address_space *mapping, sector_t block)
        return generic_block_bmap(mapping,block,ext2_get_block);
 }
 
-static int
-ext2_get_blocks(struct inode *inode, sector_t iblock, unsigned long max_blocks,
-                       struct buffer_head *bh_result, int create)
-{
-       int ret;
-
-       ret = ext2_get_block(inode, iblock, bh_result, create);
-       if (ret == 0)
-               bh_result->b_size = (1 << inode->i_blkbits);
-       return ret;
-}
-
 static ssize_t
 ext2_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
                        loff_t offset, unsigned long nr_segs)
@@ -688,7 +676,7 @@ ext2_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
        struct inode *inode = file->f_mapping->host;
 
        return blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
-                               offset, nr_segs, ext2_get_blocks, NULL);
+                               offset, nr_segs, ext2_get_block, NULL);
 }
 
 static int
@@ -697,7 +685,7 @@ ext2_writepages(struct address_space *mapping, struct writeback_control *wbc)
        return mpage_writepages(mapping, wbc, ext2_get_block);
 }
 
-struct address_space_operations ext2_aops = {
+const struct address_space_operations ext2_aops = {
        .readpage               = ext2_readpage,
        .readpages              = ext2_readpages,
        .writepage              = ext2_writepage,
@@ -710,12 +698,12 @@ struct address_space_operations ext2_aops = {
        .migratepage            = buffer_migrate_page,
 };
 
-struct address_space_operations ext2_aops_xip = {
+const struct address_space_operations ext2_aops_xip = {
        .bmap                   = ext2_bmap,
        .get_xip_page           = ext2_get_xip_page,
 };
 
-struct address_space_operations ext2_nobh_aops = {
+const struct address_space_operations ext2_nobh_aops = {
        .readpage               = ext2_readpage,
        .readpages              = ext2_readpages,
        .writepage              = ext2_nobh_writepage,
@@ -1080,13 +1068,9 @@ int ext2_sync_flags(struct inode *inode)
        unsigned int oldflags, newflags;
 
        oldflags = EXT2_I(inode)->i_flags;
-       newflags = oldflags & ~(EXT2_APPEND_FL |
-               EXT2_IMMUTABLE_FL | EXT2_IUNLINK_FL |
-               EXT2_BARRIER_FL | EXT2_NOATIME_FL |
-               EXT2_SYNC_FL | EXT2_DIRSYNC_FL);
+       newflags = oldflags & ~(EXT2_IMMUTABLE_FL |
+               EXT2_IUNLINK_FL | EXT2_BARRIER_FL);
 
-       if (IS_APPEND(inode))
-               newflags |= EXT2_APPEND_FL;
        if (IS_IMMUTABLE(inode))
                newflags |= EXT2_IMMUTABLE_FL;
        if (IS_IUNLINK(inode))
@@ -1094,20 +1078,11 @@ int ext2_sync_flags(struct inode *inode)
        if (IS_BARRIER(inode))
                newflags |= EXT2_BARRIER_FL;
 
-       /* we do not want to copy superblock flags */
-       if (inode->i_flags & S_NOATIME)
-               newflags |= EXT2_NOATIME_FL;
-       if (inode->i_flags & S_SYNC)
-               newflags |= EXT2_SYNC_FL;
-       if (inode->i_flags & S_DIRSYNC)
-               newflags |= EXT2_DIRSYNC_FL;
-
        if (oldflags ^ newflags) {
                EXT2_I(inode)->i_flags = newflags;
                inode->i_ctime = CURRENT_TIME;
                mark_inode_dirty(inode);
        }
-
        return 0;
 }
 
@@ -1135,10 +1110,10 @@ void ext2_read_inode (struct inode * inode)
                uid |= le16_to_cpu(raw_inode->i_uid_high) << 16;
                gid |= le16_to_cpu(raw_inode->i_gid_high) << 16;
        }
-       inode->i_uid = INOXID_UID(XID_TAG(inode), uid, gid);
-       inode->i_gid = INOXID_GID(XID_TAG(inode), uid, gid);
-       inode->i_xid = INOXID_XID(XID_TAG(inode), uid, gid,
-               le16_to_cpu(raw_inode->i_raw_xid));
+       inode->i_uid = INOTAG_UID(DX_TAG(inode), uid, gid);
+       inode->i_gid = INOTAG_GID(DX_TAG(inode), uid, gid);
+       inode->i_tag = INOTAG_TAG(DX_TAG(inode), uid, gid,
+               le16_to_cpu(raw_inode->i_raw_tag));
 
        inode->i_nlink = le16_to_cpu(raw_inode->i_links_count);
        inode->i_size = le32_to_cpu(raw_inode->i_size);
@@ -1157,7 +1132,6 @@ void ext2_read_inode (struct inode * inode)
                brelse (bh);
                goto bad_inode;
        }
-       inode->i_blksize = PAGE_SIZE;   /* This is the optimal IO size (for stat), not the fs block size */
        inode->i_blocks = le32_to_cpu(raw_inode->i_blocks);
        ei->i_flags = le32_to_cpu(raw_inode->i_flags);
        ei->i_faddr = le32_to_cpu(raw_inode->i_faddr);
@@ -1237,8 +1211,8 @@ static int ext2_update_inode(struct inode * inode, int do_sync)
        struct ext2_inode_info *ei = EXT2_I(inode);
        struct super_block *sb = inode->i_sb;
        ino_t ino = inode->i_ino;
-       uid_t uid = XIDINO_UID(XID_TAG(inode), inode->i_uid, inode->i_xid);
-       gid_t gid = XIDINO_GID(XID_TAG(inode), inode->i_gid, inode->i_xid);
+       uid_t uid = TAGINO_UID(DX_TAG(inode), inode->i_uid, inode->i_tag);
+       gid_t gid = TAGINO_GID(DX_TAG(inode), inode->i_gid, inode->i_tag);
        struct buffer_head * bh;
        struct ext2_inode * raw_inode = ext2_get_inode(sb, ino, &bh);
        int n;
@@ -1273,8 +1247,8 @@ static int ext2_update_inode(struct inode * inode, int do_sync)
                raw_inode->i_uid_high = 0;
                raw_inode->i_gid_high = 0;
        }
-#ifdef CONFIG_INOXID_INTERN
-       raw_inode->i_raw_xid = cpu_to_le16(inode->i_xid);
+#ifdef CONFIG_TAGGING_INTERN
+       raw_inode->i_raw_tag = cpu_to_le16(inode->i_tag);
 #endif
        raw_inode->i_links_count = cpu_to_le16(inode->i_nlink);
        raw_inode->i_size = cpu_to_le32(inode->i_size);
@@ -1363,7 +1337,7 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
                return error;
        if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) ||
            (iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid) ||
-           (iattr->ia_valid & ATTR_XID && iattr->ia_xid != inode->i_xid)) {
+           (iattr->ia_valid & ATTR_TAG && iattr->ia_tag != inode->i_tag)) {
                error = DQUOT_TRANSFER(inode, iattr) ? -EDQUOT : 0;
                if (error)
                        return error;