Skip to content

Commit

Permalink
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/shaggy/jfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
  jfs: needs crc32_le
  jfs: Fix error handling in metapage_writepage()
  jfs: return f_fsid for statfs(2)
  jfs: remove xtLookupList()
  jfs: clean up a dangling comment
  • Loading branch information
Linus Torvalds committed Mar 30, 2009
2 parents 0d34fb8 + c68a65d commit ffd1428
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 344 deletions.
1 change: 1 addition & 0 deletions fs/jfs/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config JFS_FS
tristate "JFS filesystem support"
select NLS
select CRC32
help
This is a port of IBM's Journaled Filesystem . More information is
available in the file <file:Documentation/filesystems/jfs.txt>.
Expand Down
63 changes: 24 additions & 39 deletions fs/jfs/jfs_extent.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,11 +362,12 @@ int extRealloc(struct inode *ip, s64 nxlen, xad_t * xp, bool abnr)
int extHint(struct inode *ip, s64 offset, xad_t * xp)
{
struct super_block *sb = ip->i_sb;
struct xadlist xadl;
struct lxdlist lxdl;
lxd_t lxd;
int nbperpage = JFS_SBI(sb)->nbperpage;
s64 prev;
int rc, nbperpage = JFS_SBI(sb)->nbperpage;
int rc = 0;
s64 xaddr;
int xlen;
int xflag;

/* init the hint as "no hint provided" */
XADaddress(xp, 0);
Expand All @@ -376,46 +377,30 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp)
*/
prev = ((offset & ~POFFSET) >> JFS_SBI(sb)->l2bsize) - nbperpage;

/* if the offsets in the first page of the file,
* no hint provided.
/* if the offset is in the first page of the file, no hint provided.
*/
if (prev < 0)
return (0);

/* prepare to lookup the previous page's extent info */
lxdl.maxnlxd = 1;
lxdl.nlxd = 1;
lxdl.lxd = &lxd;
LXDoffset(&lxd, prev)
LXDlength(&lxd, nbperpage);

xadl.maxnxad = 1;
xadl.nxad = 0;
xadl.xad = xp;

/* perform the lookup */
if ((rc = xtLookupList(ip, &lxdl, &xadl, 0)))
return (rc);

/* check if no extent exists for the previous page.
* this is possible for sparse files.
*/
if (xadl.nxad == 0) {
// assert(ISSPARSE(ip));
return (0);
}
goto out;

/* only preserve the abnr flag within the xad flags
* of the returned hint.
*/
xp->flag &= XAD_NOTRECORDED;
rc = xtLookup(ip, prev, nbperpage, &xflag, &xaddr, &xlen, 0);

if(xadl.nxad != 1 || lengthXAD(xp) != nbperpage) {
jfs_error(ip->i_sb, "extHint: corrupt xtree");
return -EIO;
}
if ((rc == 0) && xlen) {
if (xlen != nbperpage) {
jfs_error(ip->i_sb, "extHint: corrupt xtree");
rc = -EIO;
}
XADaddress(xp, xaddr);
XADlength(xp, xlen);
/*
* only preserve the abnr flag within the xad flags
* of the returned hint.
*/
xp->flag = xflag & XAD_NOTRECORDED;
} else
rc = 0;

return (0);
out:
return (rc);
}


Expand Down
10 changes: 3 additions & 7 deletions fs/jfs/jfs_imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@
#include "jfs_superblock.h"
#include "jfs_debug.h"

/*
* __mark_inode_dirty expects inodes to be hashed. Since we don't want
* special inodes in the fileset inode space, we make them appear hashed,
* but do not put on any lists.
*/

/*
* imap locks
*/
Expand Down Expand Up @@ -497,7 +491,9 @@ struct inode *diReadSpecial(struct super_block *sb, ino_t inum, int secondary)
release_metapage(mp);

/*
* that will look hashed, but won't be on any list; hlist_del()
* __mark_inode_dirty expects inodes to be hashed. Since we don't
* want special inodes in the fileset inode space, we make them
* appear hashed, but do not put on any lists. hlist_del()
* will work fine and require no locking.
*/
ip->i_hash.pprev = &ip->i_hash.next;
Expand Down
18 changes: 13 additions & 5 deletions fs/jfs/jfs_metapage.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
unsigned long bio_bytes = 0;
unsigned long bio_offset = 0;
int offset;
int bad_blocks = 0;

page_start = (sector_t)page->index <<
(PAGE_CACHE_SHIFT - inode->i_blkbits);
Expand All @@ -394,6 +395,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
}

clear_bit(META_dirty, &mp->flag);
set_bit(META_io, &mp->flag);
block_offset = offset >> inode->i_blkbits;
lblock = page_start + block_offset;
if (bio) {
Expand All @@ -402,7 +404,6 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
len = min(xlen, blocks_per_mp);
xlen -= len;
bio_bytes += len << inode->i_blkbits;
set_bit(META_io, &mp->flag);
continue;
}
/* Not contiguous */
Expand All @@ -424,12 +425,14 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
xlen = (PAGE_CACHE_SIZE - offset) >> inode->i_blkbits;
pblock = metapage_get_blocks(inode, lblock, &xlen);
if (!pblock) {
/* Need better error handling */
printk(KERN_ERR "JFS: metapage_get_blocks failed\n");
dec_io(page, last_write_complete);
/*
* We already called inc_io(), but can't cancel it
* with dec_io() until we're done with the page
*/
bad_blocks++;
continue;
}
set_bit(META_io, &mp->flag);
len = min(xlen, (int)JFS_SBI(inode->i_sb)->nbperpage);

bio = bio_alloc(GFP_NOFS, 1);
Expand Down Expand Up @@ -459,6 +462,9 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)

unlock_page(page);

if (bad_blocks)
goto err_out;

if (nr_underway == 0)
end_page_writeback(page);

Expand All @@ -474,7 +480,9 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
bio_put(bio);
unlock_page(page);
dec_io(page, last_write_complete);

err_out:
while (bad_blocks--)
dec_io(page, last_write_complete);
return -EIO;
}

Expand Down
29 changes: 0 additions & 29 deletions fs/jfs/jfs_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,35 +57,6 @@ struct timestruc_t {
#define HIGHORDER 0x80000000u /* high order bit on */
#define ONES 0xffffffffu /* all bit on */

/*
* logical xd (lxd)
*/
typedef struct {
unsigned len:24;
unsigned off1:8;
u32 off2;
} lxd_t;

/* lxd_t field construction */
#define LXDlength(lxd, length32) ( (lxd)->len = length32 )
#define LXDoffset(lxd, offset64)\
{\
(lxd)->off1 = ((s64)offset64) >> 32;\
(lxd)->off2 = (offset64) & 0xffffffff;\
}

/* lxd_t field extraction */
#define lengthLXD(lxd) ( (lxd)->len )
#define offsetLXD(lxd)\
( ((s64)((lxd)->off1)) << 32 | (lxd)->off2 )

/* lxd list */
struct lxdlist {
s16 maxnlxd;
s16 nlxd;
lxd_t *lxd;
};

/*
* physical xd (pxd)
*/
Expand Down
Loading

0 comments on commit ffd1428

Please sign in to comment.