PMFS: Fix error handling in pmfs_mknod()

This change fixes a bug in pmfs_mknod where the return value
of pmfs_new_inode was checked wrongly for error.

Signed-off-by: Sanjay Kumar <sanjay.k.kumar@intel.com>
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
PMFS: Fix error handling in pmfs_symlink()

This change fixes a bug in pmfs_symlink, where on an error from
pmfs_add_nondir, pmfs_setsize was incorrectly called. pmfs_setsize doesn't need
to be called because the inode and all its data blocks have been freed by
pmfs_add_nondir itself on an error.

Signed-off-by: Sanjay Kumar <sanjay.k.kumar@intel.com>
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
ext2: Fix fs corruption in ext2_get_xip_mem()

Commit 8e3dffc651cb "Ext2: mark inode dirty after the function
dquot_free_block_nodirty is called" unveiled a bug in __ext2_get_block()
called from ext2_get_xip_mem(). That function called ext2_get_block()
mistakenly asking it to map 0 blocks while 1 was intended. Before the
above mentioned commit things worked out fine by luck but after that commit
we started returning that we allocated 0 blocks while we in fact
allocated 1 block and thus allocation was looping until all blocks in
the filesystem were exhausted.

Fix the problem by properly asking for one block and also add assertion
in ext2_get_blocks() to catch similar problems.

Signed-off-by: Jan Kara <jack@suse.cz>
PMFS: Rename pmfs_inode_vfs to pmfs_inode_info

Matches other filesystems, particularly extN

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
pmfs: Remove old write protection scheme

The old scheme is slower than the new scheme and produces sparse warnings.
Just remove it.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
pmfs: Remove ioremap-related sparse warnings

ioremap returns an __iomem pointer which should not normally be directly
dereferenced.  The pmfs filesystem wants a pointer that can be directly
dereferenced; the use of ioremap to obtain that pointer is a temporary
implementation artefact which will eventually go away.  Disable the sparse
warnings by inserting the __force casts at the minimum number of places.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Merge remote-tracking branch 'upstream/master'