sb: use s_maxbytes field instead of hardcoded check in simplefs_write()

generic_write_checks() will do this for us now, using s_maxbytes field
from sb.
This commit is contained in:
Azat Khuzhin 2013-09-25 15:40:31 +04:00
parent ab68a5176a
commit ee1efa11df

View File

@ -318,11 +318,6 @@ ssize_t simplefs_write(struct file * filp, const char __user * buf, size_t len,
sfs_inode = SIMPLEFS_INODE(inode);
sb = inode->i_sb;
if (*ppos + len >= SIMPLEFS_DEFAULT_BLOCK_SIZE) {
printk(KERN_ERR "File size write will exceed a block");
return -ENOSPC;
}
bh = sb_bread(filp->f_path.dentry->d_inode->i_sb,
sfs_inode->data_block_number);
@ -698,6 +693,8 @@ int simplefs_fill_super(struct super_block *sb, void *data, int silent)
/* For all practical purposes, we will be using this s_fs_info as the super block */
sb->s_fs_info = sb_disk;
sb->s_maxbytes = SIMPLEFS_DEFAULT_BLOCK_SIZE;
root_inode = new_inode(sb);
root_inode->i_ino = SIMPLEFS_ROOTDIR_INODE_NUMBER;
inode_init_owner(root_inode, NULL, S_IFDIR);