commit e015b46762092a45296cc6536e42aec6d5e571af
Author: Erez Zadok <[EMAIL PROTECTED]>
Date: Mon Nov 12 22:30:48 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 e35a496..3a60fa6 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_dentry->d_inode->i_size);
+ bindex,
+ i_size_read(file->f_dentry->d_inode));
if (err) {
if (unlikely(err == -EEXIST))
goto retry;
@@ -198,7 +199,6 @@ static int open_highest_file(struct file *file, bool
willwrite)
struct dentry *dentry = file->f_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);
@@ -207,7 +207,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;
}
@@ -242,7 +242,6 @@ static int do_delayed_copyup(struct file *file)
int bindex, bstart, bend, err = 0;
struct dentry *dentry = file->f_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);
@@ -254,7 +253,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/inode.c b/fs/unionfs/inode.c
index 59854ea..35a71c3 100644
--- a/fs/unionfs/inode.c
+++ b/fs/unionfs/inode.c
@@ -303,7 +303,7 @@ docopyup:
old_dentry, old_bstart,
bindex, old_dentry->d_name.name,
old_dentry->d_name.len, NULL,
- old_dentry->d_inode->i_size);
+ i_size_read(old_dentry->d_inode));
if (!err) {
lower_new_dentry =
create_parents(dir, new_dentry,
@@ -1023,7 +1023,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 26ec5a0..3241380 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 0023055..7a37d78 100644
--- a/fs/unionfs/rename.c
+++ b/fs/unionfs/rename.c
@@ -254,8 +254,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 copyup failed, try next branch to the left */
if (err)
continue;
diff --git a/fs/unionfs/super.c b/fs/unionfs/super.c
index e483892..b325b9a 100644
--- a/fs/unionfs/super.c
+++ b/fs/unionfs/super.c
@@ -69,7 +69,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