Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ffd14285 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* '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
parents 0d34fb8e c68a65da
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
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>.
+24 −39
Original line number Diff line number Diff line
@@ -362,11 +362,12 @@ exit:
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);
@@ -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);
		goto out;

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

	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);
	if ((rc == 0) && xlen) {
		if (xlen != nbperpage) {
			jfs_error(ip->i_sb, "extHint: corrupt xtree");
			rc = -EIO;
		}

	/* only preserve the abnr flag within the xad flags
		XADaddress(xp, xaddr);
		XADlength(xp, xlen);
		/*
		 * only preserve the abnr flag within the xad flags
		 * of the returned hint.
		 */
	xp->flag &= XAD_NOTRECORDED;

	if(xadl.nxad != 1 || lengthXAD(xp) != nbperpage) {
		jfs_error(ip->i_sb, "extHint: corrupt xtree");
		return -EIO;
	}
		xp->flag  = xflag & XAD_NOTRECORDED;
	} else
		rc = 0;

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


+3 −7
Original line number Diff line number Diff line
@@ -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
 */
@@ -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;
+13 −5
Original line number Diff line number Diff line
@@ -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);
@@ -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) {
@@ -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 */
@@ -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);
@@ -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);

@@ -474,7 +480,9 @@ skip:
	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;
}

+0 −29
Original line number Diff line number Diff line
@@ -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)
 */
Loading