Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw: (22 commits)
  GFS2: fixed typo
  GFS2: Fix type mapping for demote_rq interface
  GFS2 fatal: filesystem consistency error on rename
  GFS2: Improve journal allocation via sysfs
  GFS2: Add "norecovery" mount option as a synonym for "spectator"
  GFS2: Fix spectator umount issue
  GFS2: Fix compiler warning from previous patch
  GFS2: reserve more blocks for transactions
  GFS2: Fix journal check for spectator mounts
  GFS2: Remove upgrade mount option
  GFS2: Remove localcaching mount option
  GFS2: Remove ignore_local_fs mount argument
  GFS2: Make . and .. qstrs constant
  GFS2: Use new workqueue scheme
  GFS2: Update handling of DLM return codes to match reality
  GFS2: Don't enforce min hold time when two demotes occur in rapid succession
  GFS2: Fix whitespace in previous patch
  GFS2: fallocate support
  GFS2: Add a bug trap in allocation code
  GFS2: No longer experimental
  ...
  • Loading branch information
Linus Torvalds committed Oct 21, 2010
2 parents 2017bd1 + 33027af commit f6f0a6d
Show file tree
Hide file tree
Showing 28 changed files with 617 additions and 395 deletions.
2 changes: 1 addition & 1 deletion fs/gfs2/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config GFS2_FS
tristate "GFS2 file system support"
depends on EXPERIMENTAL && (64BIT || LBDAF)
depends on (64BIT || LBDAF)
select DLM if GFS2_FS_LOCKING_DLM
select CONFIGFS_FS if GFS2_FS_LOCKING_DLM
select SYSFS if GFS2_FS_LOCKING_DLM
Expand Down
24 changes: 10 additions & 14 deletions fs/gfs2/aops.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#include "glops.h"


static void gfs2_page_add_databufs(struct gfs2_inode *ip, struct page *page,
unsigned int from, unsigned int to)
void gfs2_page_add_databufs(struct gfs2_inode *ip, struct page *page,
unsigned int from, unsigned int to)
{
struct buffer_head *head = page_buffers(page);
unsigned int bsize = head->b_size;
Expand Down Expand Up @@ -615,7 +615,7 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping,
unsigned int data_blocks = 0, ind_blocks = 0, rblocks;
int alloc_required;
int error = 0;
struct gfs2_alloc *al;
struct gfs2_alloc *al = NULL;
pgoff_t index = pos >> PAGE_CACHE_SHIFT;
unsigned from = pos & (PAGE_CACHE_SIZE - 1);
unsigned to = from + len;
Expand Down Expand Up @@ -663,6 +663,8 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping,
rblocks += RES_STATFS + RES_QUOTA;
if (&ip->i_inode == sdp->sd_rindex)
rblocks += 2 * RES_STATFS;
if (alloc_required)
rblocks += gfs2_rg_blocks(al);

error = gfs2_trans_begin(sdp, rblocks,
PAGE_CACHE_SIZE/sdp->sd_sb.sb_bsize);
Expand Down Expand Up @@ -696,13 +698,11 @@ static int gfs2_write_begin(struct file *file, struct address_space *mapping,

page_cache_release(page);

/*
* XXX(truncate): the call below should probably be replaced with
* a call to the gfs2-specific truncate blocks helper to actually
* release disk blocks..
*/
gfs2_trans_end(sdp);
if (pos + len > ip->i_inode.i_size)
truncate_setsize(&ip->i_inode, ip->i_inode.i_size);
gfs2_trim_blocks(&ip->i_inode);
goto out_trans_fail;

out_endtrans:
gfs2_trans_end(sdp);
out_trans_fail:
Expand Down Expand Up @@ -802,10 +802,8 @@ static int gfs2_stuffed_write_end(struct inode *inode, struct buffer_head *dibh,
page_cache_release(page);

if (copied) {
if (inode->i_size < to) {
if (inode->i_size < to)
i_size_write(inode, to);
ip->i_disksize = inode->i_size;
}
gfs2_dinode_out(ip, di);
mark_inode_dirty(inode);
}
Expand Down Expand Up @@ -876,8 +874,6 @@ static int gfs2_write_end(struct file *file, struct address_space *mapping,

ret = generic_write_end(file, mapping, pos, len, copied, page, fsdata);
if (ret > 0) {
if (inode->i_size > ip->i_disksize)
ip->i_disksize = inode->i_size;
gfs2_dinode_out(ip, dibh->b_data);
mark_inode_dirty(inode);
}
Expand Down
Loading

0 comments on commit f6f0a6d

Please sign in to comment.