Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199178
b: refs/heads/master
c: 3322e79
h: refs/heads/master
v: v3
  • Loading branch information
Nick Piggin authored and Al Viro committed May 28, 2010
1 parent 2bd328f commit 53bd147
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 15c6fd9786dfaab43547bf60df6fa63170fb64fc
refs/heads/master: 3322e79a3860fd0d50e3c1879b2e98ac582c0ff6
9 changes: 5 additions & 4 deletions trunk/fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,9 @@ blkdev_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;

return blockdev_direct_IO_no_locking(rw, iocb, inode, I_BDEV(inode),
iov, offset, nr_segs, blkdev_get_blocks, NULL);
return blockdev_direct_IO_no_locking_newtrunc(rw, iocb, inode,
I_BDEV(inode), iov, offset, nr_segs,
blkdev_get_blocks, NULL);
}

int __sync_blockdev(struct block_device *bdev, int wait)
Expand Down Expand Up @@ -309,8 +310,8 @@ static int blkdev_write_begin(struct file *file, struct address_space *mapping,
struct page **pagep, void **fsdata)
{
*pagep = NULL;
return block_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
blkdev_get_block);
return block_write_begin_newtrunc(file, mapping, pos, len, flags,
pagep, fsdata, blkdev_get_block);
}

static int blkdev_write_end(struct file *file, struct address_space *mapping,
Expand Down
9 changes: 2 additions & 7 deletions trunk/fs/configfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,11 @@ int configfs_setattr(struct dentry * dentry, struct iattr * iattr)
if (!sd)
return -EINVAL;

sd_iattr = sd->s_iattr;

error = inode_change_ok(inode, iattr);
if (error)
return error;

error = inode_setattr(inode, iattr);
error = simple_setattr(dentry, iattr);
if (error)
return error;

sd_iattr = sd->s_iattr;
if (!sd_iattr) {
/* setting attributes for the first time, allocate now */
sd_iattr = kzalloc(sizeof(struct iattr), GFP_KERNEL);
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/ramfs/file-mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ const struct file_operations ramfs_file_operations = {
};

const struct inode_operations ramfs_file_inode_operations = {
.setattr = simple_setattr,
.getattr = simple_getattr,
};
7 changes: 4 additions & 3 deletions trunk/fs/ramfs/file-nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static int ramfs_nommu_resize(struct inode *inode, loff_t newsize, loff_t size)
return ret;
}

ret = vmtruncate(inode, newsize);
ret = simple_setsize(inode, newsize);

return ret;
}
Expand All @@ -169,7 +169,8 @@ static int ramfs_nommu_setattr(struct dentry *dentry, struct iattr *ia)

/* pick out size-changing events */
if (ia->ia_valid & ATTR_SIZE) {
loff_t size = i_size_read(inode);
loff_t size = inode->i_size;

if (ia->ia_size != size) {
ret = ramfs_nommu_resize(inode, ia->ia_size, size);
if (ret < 0 || ia->ia_valid == ATTR_SIZE)
Expand All @@ -182,7 +183,7 @@ static int ramfs_nommu_setattr(struct dentry *dentry, struct iattr *ia)
}
}

ret = inode_setattr(inode, ia);
generic_setattr(inode, ia);
out:
ia->ia_valid = old_ia_valid;
return ret;
Expand Down
8 changes: 3 additions & 5 deletions trunk/fs/sysfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,11 @@ int sysfs_setattr(struct dentry *dentry, struct iattr *iattr)
if (error)
goto out;

iattr->ia_valid &= ~ATTR_SIZE; /* ignore size changes */

error = inode_setattr(inode, iattr);
if (error)
goto out;
/* this ignores size changes */
generic_setattr(inode, iattr);

error = sysfs_sd_setattr(sd, iattr);

out:
mutex_unlock(&sysfs_mutex);
return error;
Expand Down

0 comments on commit 53bd147

Please sign in to comment.