commit cb16f3614f0f0edb3b69433b6ad872fbb6a6f6b5
Author: Erez Zadok <[EMAIL PROTECTED]>
Date:   Sat Nov 17 23:42:10 2007 -0500

    Unionfs: use i_size wrappers
    
    Signed-off-by: Erez Zadok <[EMAIL PROTECTED]>

diff --git a/fs/unionfs/commonfops.c b/fs/unionfs/commonfops.c
index fcf0aa7..8d2cfdc 100644
--- a/fs/unionfs/commonfops.c
+++ b/fs/unionfs/commonfops.c
@@ -72,7 +72,8 @@ retry:
        dput(tmp_dentry);
 
        err = copyup_named_file(dentry->d_parent->d_inode, file, name, bstart,
-                               bindex, file->f_path.dentry->d_inode->i_size);
+                               bindex,
+                               i_size_read(file->f_path.dentry->d_inode));
        if (err) {
                if (unlikely(err == -EEXIST))
                        goto retry;
@@ -266,7 +267,6 @@ static int open_highest_file(struct file *file, bool 
willwrite)
        struct dentry *dentry = file->f_path.dentry;
        struct inode *parent_inode = dentry->d_parent->d_inode;
        struct super_block *sb = dentry->d_sb;
-       size_t inode_size = dentry->d_inode->i_size;
 
        bstart = dbstart(dentry);
        bend = dbend(dentry);
@@ -275,7 +275,7 @@ static int open_highest_file(struct file *file, bool 
willwrite)
        if (willwrite && IS_WRITE_FLAG(file->f_flags) && is_robranch(dentry)) {
                for (bindex = bstart - 1; bindex >= 0; bindex--) {
                        err = copyup_file(parent_inode, file, bstart, bindex,
-                                         inode_size);
+                                         i_size_read(dentry->d_inode));
                        if (!err)
                                break;
                }
@@ -310,7 +310,6 @@ static int do_delayed_copyup(struct file *file)
        int bindex, bstart, bend, err = 0;
        struct dentry *dentry = file->f_path.dentry;
        struct inode *parent_inode = dentry->d_parent->d_inode;
-       loff_t inode_size = dentry->d_inode->i_size;
 
        bstart = fbstart(file);
        bend = fbend(file);
@@ -322,7 +321,8 @@ static int do_delayed_copyup(struct file *file)
        for (bindex = bstart - 1; bindex >= 0; bindex--) {
                if (!d_deleted(dentry))
                        err = copyup_file(parent_inode, file, bstart,
-                                         bindex, inode_size);
+                                         bindex,
+                                         i_size_read(dentry->d_inode));
                else
                        err = copyup_deleted_file(file, dentry, bstart,
                                                  bindex);
diff --git a/fs/unionfs/dirfops.c b/fs/unionfs/dirfops.c
index 5a15acb..1521560 100644
--- a/fs/unionfs/dirfops.c
+++ b/fs/unionfs/dirfops.c
@@ -50,7 +50,7 @@ static int unionfs_readdir(struct file *file, void *dirent, 
filldir_t filldir)
        }
 
        /* check if cached dir does not exist */
-       if (!odf_cache->d_inode || !odf_cache->d_inode->i_size) {
+       if (!odf_cache->d_inode || !i_size_read(odf_cache->d_inode)) {
 
                /*
                 * odf cache dir calls partial lookup which expects a locked
@@ -91,7 +91,7 @@ static int unionfs_readdir(struct file *file, void *dirent, 
filldir_t filldir)
 
        odf_file->f_pos = file->f_pos;
 
-       size = odf_cache->d_inode->i_size;
+       size = i_size_read(odf_cache->d_inode);
        while (odf_file->f_pos < size && !overflow) {
 
                pos = odf_file->f_pos;
diff --git a/fs/unionfs/dirhelper.c b/fs/unionfs/dirhelper.c
index b7a6d7a..5036cec 100644
--- a/fs/unionfs/dirhelper.c
+++ b/fs/unionfs/dirhelper.c
@@ -331,7 +331,7 @@ retry:
         * compare mtimes, do not proceed if equal, do not check if retrying
         * after -ENOSPC
         */
-       if (i_odf && i_odf->i_size && !cleaned) {
+       if (i_odf && i_size_read(i_odf) && !cleaned) {
                if(timespec_compare(&i_odf->i_mtime,mtime) >= 0)
                        goto out;
        }
diff --git a/fs/unionfs/export.c b/fs/unionfs/export.c
index 4e6173e..44493e9 100644
--- a/fs/unionfs/export.c
+++ b/fs/unionfs/export.c
@@ -215,7 +215,7 @@ static int unionfs_get_name(struct dentry *dentry, char 
*name,
        }
 
        /* reconstruct the cached dir if necessary */
-       if (!odf_cache->d_inode || !odf_cache->d_inode->i_size) {
+       if (!odf_cache->d_inode || !i_size_read(odf_cache->d_inode)) {
                unionfs_lock_dentry(dentry);
                err = odf_cache_dir(dentry, odf_cache,
                                    &dentry->d_inode->i_mtime);
@@ -238,7 +238,7 @@ static int unionfs_get_name(struct dentry *dentry, char 
*name,
 
        /* search for the inode in the dir */
        file->f_pos = 0;
-       while (file->f_pos < file->f_path.dentry->d_inode->i_size) {
+       while (file->f_pos < i_size_read(file->f_path.dentry->d_inode)) {
                err = odf_read_dirent(file, &tmp_name, &namelen, &ino,
                                      &d_type);
                if (err)
diff --git a/fs/unionfs/inode.c b/fs/unionfs/inode.c
index 3ad08d8..e522b56 100644
--- a/fs/unionfs/inode.c
+++ b/fs/unionfs/inode.c
@@ -271,7 +271,7 @@ docopyup:
                                    old_dentry, old_bstart, bindex,
                                    old_dentry->d_name.name,
                                    old_dentry->d_name.len,
-                                   NULL, old_dentry->d_inode->i_size);
+                                   NULL, i_size_read(old_dentry->d_inode));
                if (!err) {
                        lower_new_dentry =
                                create_parents(dir, new_dentry,
@@ -861,7 +861,7 @@ static int unionfs_setattr(struct dentry *dentry, struct 
iattr *ia)
                                continue;
                        /* Only if its the leftmost file, copyup the file */
                        for (i = bstart - 1; i >= 0; i--) {
-                               loff_t size = dentry->d_inode->i_size;
+                               loff_t size = i_size_read(dentry->d_inode);
                                if (ia->ia_valid & ATTR_SIZE)
                                        size = ia->ia_size;
                                err = copyup_dentry(dentry->d_parent->d_inode,
diff --git a/fs/unionfs/rdstate.c b/fs/unionfs/rdstate.c
index 95c4818..8f82441 100644
--- a/fs/unionfs/rdstate.c
+++ b/fs/unionfs/rdstate.c
@@ -76,10 +76,10 @@ static int guesstimate_hash_size(struct inode *inode)
                if (!lower_inode)
                        continue;
 
-               if (lower_inode->i_size == DENTPAGE)
+               if (i_size_read(lower_inode) == DENTPAGE)
                        hashsize += DENTPERONEPAGE;
                else
-                       hashsize += (lower_inode->i_size / DENTPAGE) *
+                       hashsize += (i_size_read(lower_inode) / DENTPAGE) *
                                DENTPERPAGE;
        }
 
diff --git a/fs/unionfs/rename.c b/fs/unionfs/rename.c
index 43a7b01..330812d 100644
--- a/fs/unionfs/rename.c
+++ b/fs/unionfs/rename.c
@@ -221,8 +221,8 @@ static int do_unionfs_rename(struct inode *old_dir,
                        err = copyup_dentry(old_dentry->d_parent->d_inode,
                                            old_dentry, old_bstart, bindex,
                                            old_dentry->d_name.name,
-                                           old_dentry->d_name.len,
-                                           NULL, old_dentry->d_inode->i_size);
+                                           old_dentry->d_name.len, NULL,
+                                           i_size_read(old_dentry->d_inode));
                        if (!err)
                                err = __unionfs_rename(old_dir, old_dentry,
                                                       new_dir, new_dentry,
diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
index 73d2507..cdb5439 100644
--- a/fs/unionfs/super.c
+++ b/fs/unionfs/super.c
@@ -67,7 +67,7 @@ static void unionfs_read_inode(struct inode *inode)
  */
 static void unionfs_delete_inode(struct inode *inode)
 {
-       inode->i_size = 0;      /* every f/s seems to do that */
+       i_size_write(inode, 0); /* every f/s seems to do that */
 
        if (inode->i_data.nrpages)
                truncate_inode_pages(&inode->i_data, 0);
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs

Reply via email to