Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 207512
b: refs/heads/master
c: 282dc17
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Al Viro committed Aug 9, 2010
1 parent 4c8af09 commit 0b04897
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 31 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: ea0f04e59543bafb3d2cbe37a0d375acb0bb2c34
refs/heads/master: 282dc178849882289d30e58b54be6b2799b351aa
11 changes: 10 additions & 1 deletion trunk/fs/adfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,19 @@ static int adfs_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
{
int ret;

*pagep = NULL;
return cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
adfs_get_block,
&ADFS_I(mapping->host)->mmu_private);
if (unlikely(ret)) {
loff_t isize = mapping->host->i_size;
if (pos + len > isize)
vmtruncate(mapping->host, isize);
}

return ret;
}

static sector_t _adfs_bmap(struct address_space *mapping, sector_t block)
Expand Down
11 changes: 10 additions & 1 deletion trunk/fs/affs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,10 +406,19 @@ static int affs_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
{
int ret;

*pagep = NULL;
return cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
affs_get_block,
&AFFS_I(mapping->host)->mmu_private);
if (unlikely(ret)) {
loff_t isize = mapping->host->i_size;
if (pos + len > isize)
vmtruncate(mapping->host, isize);
}

return ret;
}

static sector_t _affs_bmap(struct address_space *mapping, sector_t block)
Expand Down
21 changes: 1 addition & 20 deletions trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -2351,7 +2351,7 @@ static int cont_expand_zero(struct file *file, struct address_space *mapping,
* For moronic filesystems that do not allow holes in file.
* We may have to extend the file.
*/
int cont_write_begin_newtrunc(struct file *file, struct address_space *mapping,
int cont_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata,
get_block_t *get_block, loff_t *bytes)
Expand All @@ -2377,25 +2377,6 @@ int cont_write_begin_newtrunc(struct file *file, struct address_space *mapping,
out:
return err;
}
EXPORT_SYMBOL(cont_write_begin_newtrunc);

int cont_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata,
get_block_t *get_block, loff_t *bytes)
{
int ret;

ret = cont_write_begin_newtrunc(file, mapping, pos, len, flags,
pagep, fsdata, get_block, bytes);
if (unlikely(ret)) {
loff_t isize = mapping->host->i_size;
if (pos + len > isize)
vmtruncate(mapping->host, isize);
}

return ret;
}
EXPORT_SYMBOL(cont_write_begin);

int block_prepare_write(struct page *page, unsigned from, unsigned to,
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/fat/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static int fat_write_begin(struct file *file, struct address_space *mapping,
int err;

*pagep = NULL;
err = cont_write_begin_newtrunc(file, mapping, pos, len, flags,
err = cont_write_begin(file, mapping, pos, len, flags,
pagep, fsdata, fat_get_block,
&MSDOS_I(mapping->host)->mmu_private);
if (err < 0)
Expand Down
11 changes: 10 additions & 1 deletion trunk/fs/hfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,19 @@ static int hfs_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
{
int ret;

*pagep = NULL;
return cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
hfs_get_block,
&HFS_I(mapping->host)->phys_size);
if (unlikely(ret)) {
loff_t isize = mapping->host->i_size;
if (pos + len > isize)
vmtruncate(mapping->host, isize);
}

return ret;
}

static sector_t hfs_bmap(struct address_space *mapping, sector_t block)
Expand Down
11 changes: 10 additions & 1 deletion trunk/fs/hfsplus/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,19 @@ static int hfsplus_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
{
int ret;

*pagep = NULL;
return cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
hfsplus_get_block,
&HFSPLUS_I(mapping->host).phys_size);
if (unlikely(ret)) {
loff_t isize = mapping->host->i_size;
if (pos + len > isize)
vmtruncate(mapping->host, isize);
}

return ret;
}

static sector_t hfsplus_bmap(struct address_space *mapping, sector_t block)
Expand Down
11 changes: 10 additions & 1 deletion trunk/fs/hpfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,19 @@ static int hpfs_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
struct page **pagep, void **fsdata)
{
int ret;

*pagep = NULL;
return cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
hpfs_get_block,
&hpfs_i(mapping->host)->mmu_private);
if (unlikely(ret)) {
loff_t isize = mapping->host->i_size;
if (pos + len > isize)
vmtruncate(mapping->host, isize);
}

return ret;
}

static sector_t _hpfs_bmap(struct address_space *mapping, sector_t block)
Expand Down
11 changes: 10 additions & 1 deletion trunk/fs/qnx4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,19 @@ static int qnx4_write_begin(struct file *file, struct address_space *mapping,
struct page **pagep, void **fsdata)
{
struct qnx4_inode_info *qnx4_inode = qnx4_i(mapping->host);
int ret;

*pagep = NULL;
return cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
ret = cont_write_begin(file, mapping, pos, len, flags, pagep, fsdata,
qnx4_get_block,
&qnx4_inode->mmu_private);
if (unlikely(ret)) {
loff_t isize = mapping->host->i_size;
if (pos + len > isize)
vmtruncate(mapping->host, isize);
}

return ret;
}
static sector_t qnx4_bmap(struct address_space *mapping, sector_t block)
{
Expand Down
3 changes: 0 additions & 3 deletions trunk/include/linux/buffer_head.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@ int generic_write_end(struct file *, struct address_space *,
struct page *, void *);
void page_zero_new_buffers(struct page *page, unsigned from, unsigned to);
int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*);
int cont_write_begin_newtrunc(struct file *, struct address_space *, loff_t,
unsigned, unsigned, struct page **, void **,
get_block_t *, loff_t *);
int cont_write_begin(struct file *, struct address_space *, loff_t,
unsigned, unsigned, struct page **, void **,
get_block_t *, loff_t *);
Expand Down

0 comments on commit 0b04897

Please sign in to comment.