Commit 7549ae3e authored by Abhishek Kulkarni's avatar Abhishek Kulkarni Committed by Eric Van Hensbergen
Browse files

9p: Use the i_size_[read, write]() macros instead of using inode->i_size directly.



Change all occurrence of inode->i_size with i_size_read() or i_size_write()
as appropriate.
Signed-off-by: default avatarAbhishek Kulkarni <adkulkar@umail.iu.edu>
Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
parent 70430786
...@@ -72,7 +72,7 @@ int v9fs_file_open(struct inode *inode, struct file *file) ...@@ -72,7 +72,7 @@ int v9fs_file_open(struct inode *inode, struct file *file)
return err; return err;
} }
if (omode & P9_OTRUNC) { if (omode & P9_OTRUNC) {
inode->i_size = 0; i_size_write(inode, 0);
inode->i_blocks = 0; inode->i_blocks = 0;
} }
if ((file->f_flags & O_APPEND) && (!v9fs_extended(v9ses))) if ((file->f_flags & O_APPEND) && (!v9fs_extended(v9ses)))
...@@ -239,9 +239,9 @@ v9fs_file_write(struct file *filp, const char __user * data, ...@@ -239,9 +239,9 @@ v9fs_file_write(struct file *filp, const char __user * data,
*offset += total; *offset += total;
} }
if (*offset > inode->i_size) { if (*offset > i_size_read(inode)) {
inode->i_size = *offset; i_size_write(inode, *offset);
inode->i_blocks = (inode->i_size + 512 - 1) >> 9; inode->i_blocks = (i_size_read(inode) + 512 - 1) >> 9;
} }
if (n < 0) if (n < 0)
......
...@@ -872,10 +872,10 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode, ...@@ -872,10 +872,10 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode,
} else } else
inode->i_rdev = 0; inode->i_rdev = 0;
inode->i_size = stat->length; i_size_write(inode, stat->length);
/* not real number of blocks, but 512 byte ones ... */ /* not real number of blocks, but 512 byte ones ... */
inode->i_blocks = (inode->i_size + 512 - 1) >> 9; inode->i_blocks = (i_size_read(inode) + 512 - 1) >> 9;
} }
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment