]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/log
linux-2.6-omap-h63xx.git
17 years agoquota: Keep which entries were set by SETQUOTA quotactl
Jan Kara [Thu, 2 Oct 2008 14:48:10 +0000 (16:48 +0200)]
quota: Keep which entries were set by SETQUOTA quotactl

Quota in a clustered environment needs to synchronize quota information
among cluster nodes. This means we have to occasionally update some
information in dquot from disk / network. On the other hand we have to
be careful not to overwrite changes administrator did via SETQUOTA.
So indicate in dquot->dq_flags which entries have been set by SETQUOTA
and quota format can clear these flags when it properly propagated
the changes.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoquota: Allow negative usage of space and inodes
Jan Kara [Wed, 1 Oct 2008 16:21:39 +0000 (18:21 +0200)]
quota: Allow negative usage of space and inodes

For clustered filesystems, it can happen that space / inode usage goes
negative temporarily (because some node is allocating another node
is freeing and they are not completely in sync). So let quota code
allow this and change qsize_t so a signed type so that we don't
underflow the variables.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoquota: Convert union in mem_dqinfo to a pointer
Jan Kara [Thu, 2 Oct 2008 16:44:14 +0000 (18:44 +0200)]
quota: Convert union in mem_dqinfo to a pointer

Coming quota support for OCFS2 is going to need quite a bit
of additional per-sb quota information. Moreover having fs.h
include all the types needed for this structure would be a
pain in the a**. So remove the union from mem_dqinfo and add
a private pointer for filesystem's use.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoquota: Split off quota tree handling into a separate file
Jan Kara [Mon, 22 Sep 2008 03:54:49 +0000 (05:54 +0200)]
quota: Split off quota tree handling into a separate file

There is going to be a new version of quota format having 64-bit
quota limits and a new quota format for OCFS2. They are both
going to use the same tree structure as VFSv0 quota format. So
split out tree handling into a separate file and make size of
leaf blocks, amount of space usable in each block (needed for
checksumming) and structures contained in them configurable
so that the code can be shared.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoquota: Move quotaio_v[12].h from include/linux/ to fs/
Jan Kara [Sun, 21 Sep 2008 21:17:53 +0000 (23:17 +0200)]
quota: Move quotaio_v[12].h from include/linux/ to fs/

Since these include files are used only by implementation of quota formats,
there's no need to have them in include/linux/.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoquota: Introduce DQUOT_QUOTA_SYS_FILE flag
Jan Kara [Tue, 30 Sep 2008 15:53:37 +0000 (17:53 +0200)]
quota: Introduce DQUOT_QUOTA_SYS_FILE flag

If filesystem can handle quota files as system files hidden from users, we can
skip a lot of cache invalidation, syncing, inode flags setting etc. when
turning quotas on, off and quota_sync. Allow filesystem to indicate that it is
hiding quota files from users by DQUOT_QUOTA_SYS_FILE flag.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoquota: Remove compatibility function sb_any_quota_enabled()
Jan Kara [Wed, 20 Aug 2008 16:30:40 +0000 (18:30 +0200)]
quota: Remove compatibility function sb_any_quota_enabled()

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoreiserfs: Use sb_any_quota_loaded() instead of sb_any_quota_enabled().
Jan Kara [Wed, 20 Aug 2008 16:16:36 +0000 (18:16 +0200)]
reiserfs: Use sb_any_quota_loaded() instead of sb_any_quota_enabled().

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoext4: Use sb_any_quota_loaded() instead of sb_any_quota_enabled()
Jan Kara [Wed, 20 Aug 2008 16:14:35 +0000 (18:14 +0200)]
ext4: Use sb_any_quota_loaded() instead of sb_any_quota_enabled()

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoext3: Use sb_any_quota_loaded() instead of sb_any_quota_enabled()
Jan Kara [Wed, 20 Aug 2008 16:11:50 +0000 (18:11 +0200)]
ext3: Use sb_any_quota_loaded() instead of sb_any_quota_enabled()

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoquota: Allow to separately enable quota accounting and enforcing limits
Jan Kara [Wed, 20 Aug 2008 15:50:32 +0000 (17:50 +0200)]
quota: Allow to separately enable quota accounting and enforcing limits

Split DQUOT_USR_ENABLED (and DQUOT_GRP_ENABLED) into DQUOT_USR_USAGE_ENABLED
and DQUOT_USR_LIMITS_ENABLED. This way we are able to separately enable /
disable whether we should:
1) ignore quotas completely
2) just keep uptodate information about usage
3) actually enforce quota limits

This is going to be useful when quota is treated as filesystem metadata - we
then want to keep quota information uptodate all the time and just enable /
disable limits enforcement.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoquota: Make _SUSPENDED just a flag
Jan Kara [Wed, 20 Aug 2008 14:21:01 +0000 (16:21 +0200)]
quota: Make _SUSPENDED just a flag

Upto now, DQUOT_USR_SUSPENDED behaved like a state - i.e., either quota
was enabled or suspended or none. Now allowed states are 0, ENABLED,
ENABLED | SUSPENDED. This will be useful later when we implement separate
enabling of quota usage tracking and limits enforcement because we need to
keep track of a state which has been suspended.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoquota: Remove bogus 'optimization' in check_idq() and check_bdq()
Jan Kara [Wed, 20 Aug 2008 13:49:59 +0000 (15:49 +0200)]
quota: Remove bogus 'optimization' in check_idq() and check_bdq()

Checks like <= 0 for an unsigned type do not make much sence. The value
could be only 0 and that does not happen often enough for the check
to be worth it.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoquota: Increase size of variables for limits and inode usage
Jan Kara [Wed, 20 Aug 2008 12:45:12 +0000 (14:45 +0200)]
quota: Increase size of variables for limits and inode usage

So far quota was fine with quota block limits and inode limits/numbers in
a 32-bit type. Now with rapid increase in storage sizes there are coming
requests to be able to handle quota limits above 4TB / more that 2^32 inodes.
So bump up sizes of types in mem_dqblk structure to 64-bits to be able to
handle this. Also update inode allocation / checking functions to use qsize_t
and make global structure keep quota limits in bytes so that things are
consistent.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoquota: Add callbacks for allocating and destroying dquot structures
Jan Kara [Tue, 19 Aug 2008 12:51:22 +0000 (14:51 +0200)]
quota: Add callbacks for allocating and destroying dquot structures

Some filesystems would like to keep private information together with each
dquot. Add callbacks alloc_dquot and destroy_dquot allowing filesystem to
allocate larger dquots from their private slab in a similar fashion we
currently allocate inodes.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2/xattr: Restore not_found in xis
Tao Ma [Wed, 19 Nov 2008 08:48:42 +0000 (16:48 +0800)]
ocfs2/xattr: Restore not_found in xis

During an xattr set, when we move a xattr which was stored in inode to the
outside bucket, we have to delete it and it will use the old value of
xis->not_found. xis->not_found is removed by ocfs2_calc_xattr_set_need
though, so we must restore it.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2/xattr: Fix a bug in xattr allocation estimation
Tao Ma [Wed, 19 Nov 2008 08:48:41 +0000 (16:48 +0800)]
ocfs2/xattr: Fix a bug in xattr allocation estimation

When we extend one xattr's value to a large size, the old value size might
be smaller than the size of a value root. In those cases, we still need to
guess the metadata allocation.

Reported-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Remove JBD compatibility layer
Mark Fasheh [Wed, 19 Nov 2008 00:53:43 +0000 (16:53 -0800)]
ocfs2: Remove JBD compatibility layer

JBD2 is fully backwards compatible with JBD and it's been tested enough with
Ocfs2 that we can clean this code up now.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Convert ocfs2_read_dir_block() to ocfs2_read_virt_blocks()
Joel Becker [Thu, 13 Nov 2008 22:49:21 +0000 (14:49 -0800)]
ocfs2: Convert ocfs2_read_dir_block() to ocfs2_read_virt_blocks()

Now that we've centralized the ocfs2_read_virt_blocks() code, let's use
it in ocfs2_read_dir_block().

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Wrap virtual block reads in ocfs2_read_virt_blocks()
Joel Becker [Thu, 13 Nov 2008 22:49:20 +0000 (14:49 -0800)]
ocfs2: Wrap virtual block reads in ocfs2_read_virt_blocks()

The ocfs2_read_dir_block() function really maps an inode's virtual
blocks to physical ones before calling ocfs2_read_blocks().  Let's
extract that to common code, because other places might want to do that.

Other than the block number being virtual, ocfs2_read_virt_blocks()
takes the same arguments as ocfs2_read_blocks().  It converts those
virtual block numbers to physical before calling ocfs2_read_blocks()
directly.  If the blocks asked for are discontiguous, this can mean
multiple calls to ocfs2_read_blocks(), but this is mostly hidden from
the caller.

Like ocfs2_read_blocks(), the caller can pass in an existing
buffer_head.  This is usually done to pick up some readahead I/O.
ocfs2_read_virt_blocks() checks the buffer_head's block number
against the extent map - it must match.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Validate metadata only when it's read from disk.
Joel Becker [Thu, 13 Nov 2008 22:49:19 +0000 (14:49 -0800)]
ocfs2: Validate metadata only when it's read from disk.

Add an optional validation hook to ocfs2_read_blocks().  Now the
validation function is only called when a block was actually read off of
disk.  It is not called when the buffer was in cache.

We add a buffer state bit BH_NeedsValidate to flag these buffers.  It
must always be one higher than the last JBD2 buffer state bit.

The dinode, dirblock, extent_block, and xattr_block validators are
lifted to this scheme directly.  The group_descriptor validator needs to
be split into two pieces.  The first part only needs the gd buffer and
is passed to ocfs2_read_block().  The second part requires the dinode as
well, and is called every time.  It's only 3 compares, so it's tiny.
This also allows us to clean up the non-fatal gd check used by resize.c.
It now has no magic argument.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Wrap xattr block reads in a dedicated function
Joel Becker [Thu, 13 Nov 2008 22:49:18 +0000 (14:49 -0800)]
ocfs2: Wrap xattr block reads in a dedicated function

We weren't consistently checking xattr blocks after we read them.
Most places checked the signature, but none checked xb_blkno or
xb_fs_signature.  Create a toplevel ocfs2_read_xattr_block() that does
the read and the validation.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Wrap dirblock reads in a dedicated function.
Joel Becker [Thu, 13 Nov 2008 22:49:17 +0000 (14:49 -0800)]
ocfs2: Wrap dirblock reads in a dedicated function.

We have ocfs2_bread() as a vestige of the original ext-based dir code.
It's only used by directories, though.  Turn it into
ocfs2_read_dir_block(), with a prototype matching the other metadata
read functions.  It's set up to validate dirblocks when the time comes.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Wrap extent block reads in a dedicated function.
Joel Becker [Thu, 13 Nov 2008 22:49:16 +0000 (14:49 -0800)]
ocfs2: Wrap extent block reads in a dedicated function.

We weren't consistently checking extent blocks after we read them.
Most places checked the signature, but none checked h_blkno or
h_fs_signature.  Create a toplevel ocfs2_read_extent_block() that does
the read and the validation.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Morph the haphazard OCFS2_IS_VALID_GROUP_DESC() checks.
Joel Becker [Thu, 13 Nov 2008 22:49:15 +0000 (14:49 -0800)]
ocfs2: Morph the haphazard OCFS2_IS_VALID_GROUP_DESC() checks.

Random places in the code would check a group descriptor bh to see if it
was valid. The previous commit unified descriptor block reads,
validating all block reads in the same place.  Thus, these checks are no
longer necessary.  Rather than eliminate them, however, we change them
to BUG_ON() checks.  This ensures the assumptions remain true.  All of
the code paths to these checks have been audited to ensure they come
from a validated descriptor read.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Wrap group descriptor reads in a dedicated function.
Joel Becker [Thu, 13 Nov 2008 22:49:14 +0000 (14:49 -0800)]
ocfs2: Wrap group descriptor reads in a dedicated function.

We have a clean call for validating group descriptors, but every place
that wants the always does a read_block()+validate() call pair.  Create
a toplevel ocfs2_read_group_descriptor() that does the right
thing.  This allows us to leverage the single call point later for
fancier handling.  We also add validation of gd->bg_generation against
the superblock and gd->bg_blkno against the block we thought we read.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Consolidate validation of group descriptors.
Joel Becker [Thu, 13 Nov 2008 22:49:13 +0000 (14:49 -0800)]
ocfs2: Consolidate validation of group descriptors.

Currently the validation of group descriptors is directly duplicated so
that one version can error the filesystem and the other (resize) can
just report the problem.  Consolidate to one function that takes a
boolean.  Wrap that function with the old call for the old users.

This is in preparation for lifting the read+validate step into a
single function.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Morph the haphazard OCFS2_IS_VALID_DINODE() checks.
Joel Becker [Thu, 13 Nov 2008 22:49:12 +0000 (14:49 -0800)]
ocfs2: Morph the haphazard OCFS2_IS_VALID_DINODE() checks.

Random places in the code would check a dinode bh to see if it was
valid.  Not only did they do different levels of validation, they
handled errors in different ways.

The previous commit unified inode block reads, validating all block
reads in the same place.  Thus, these haphazard checks are no longer
necessary.  Rather than eliminate them, however, we change them to
BUG_ON() checks.  This ensures the assumptions remain true.  All of the
code paths to these checks have been audited to ensure they come from a
validated inode read.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Wrap inode block reads in a dedicated function.
Joel Becker [Thu, 13 Nov 2008 22:49:11 +0000 (14:49 -0800)]
ocfs2: Wrap inode block reads in a dedicated function.

The ocfs2 code currently reads inodes off disk with a simple
ocfs2_read_block() call.  Each place that does this has a different set
of sanity checks it performs.  Some check only the signature.  A couple
validate the block number (the block read vs di->i_blkno).  A couple
others check for VALID_FL.  Only one place validates i_fs_generation.  A
couple check nothing.  Even when an error is found, they don't all do
the same thing.

We wrap inode reading into ocfs2_read_inode_block().  This will validate
all the above fields, going readonly if they are invalid (they never
should be).  ocfs2_read_inode_block_full() is provided for the places
that want to pass read_block flags.  Every caller is passing a struct
inode with a valid ip_blkno, so we don't need a separate blkno argument
either.

We will remove the validation checks from the rest of the code in a
later commit, as they are no longer necessary.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: add mount option and Kconfig option for acl
Tiger Yang [Fri, 14 Nov 2008 03:17:52 +0000 (11:17 +0800)]
ocfs2: add mount option and Kconfig option for acl

This patch adds the Kconfig option "CONFIG_OCFS2_FS_POSIX_ACL"
and mount options "acl" to enable acls in Ocfs2.

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: add ocfs2_init_acl in mknod
Tiger Yang [Fri, 14 Nov 2008 03:17:41 +0000 (11:17 +0800)]
ocfs2: add ocfs2_init_acl in mknod

We need to get the parent directories acls and let the new child inherit it.
To this, we add additional calculations for data/metadata allocation.

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: add ocfs2_acl_chmod
Tiger Yang [Fri, 14 Nov 2008 03:17:29 +0000 (11:17 +0800)]
ocfs2: add ocfs2_acl_chmod

This function is used to update acl xattrs during file mode changes.

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: add ocfs2_check_acl
Tiger Yang [Fri, 14 Nov 2008 03:17:18 +0000 (11:17 +0800)]
ocfs2: add ocfs2_check_acl

This function is used to enhance permission checking with POSIX ACLs.

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: add POSIX ACL API
Tiger Yang [Fri, 14 Nov 2008 03:17:04 +0000 (11:17 +0800)]
ocfs2: add POSIX ACL API

This patch adds POSIX ACL(access control lists) APIs in ocfs2. We convert
struct posix_acl to many ocfs2_acl_entry and regard them as an extended
attribute entry.

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: add ocfs2_xattr_get_nolock
Tiger Yang [Fri, 14 Nov 2008 03:16:53 +0000 (11:16 +0800)]
ocfs2: add ocfs2_xattr_get_nolock

This function does the work of ocfs2_xattr_get under an open lock.

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: add ocfs2_init_security in during file create
Tiger Yang [Fri, 14 Nov 2008 03:16:41 +0000 (11:16 +0800)]
ocfs2: add ocfs2_init_security in during file create

Security attributes must be set when creating a new inode.

We do this in three steps.

- First, get security xattr's name and value by security_operation

- Calculate and reserve the meta data and clusters needed by this security
  xattr before starting transaction

- Finally, we set it before add_entry

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: add security xattr API
Tiger Yang [Fri, 14 Nov 2008 03:16:27 +0000 (11:16 +0800)]
ocfs2: add security xattr API

This patch add security xattr set/get/list APIs to
support security attributes in Ocfs2.

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: add ocfs2_xattr_set_handle
Tiger Yang [Fri, 14 Nov 2008 03:16:03 +0000 (11:16 +0800)]
ocfs2: add ocfs2_xattr_set_handle

This function is used to set xattr's in a started transaction. It is only
called during inode creation inode for initial security/acl xattrs of the
new inode. These xattrs could be put into ibody or extent block, so xattr
bucket would not be use in this case.

Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: move new inode allocation out of the transaction
Tiger Yang [Fri, 14 Nov 2008 03:15:44 +0000 (11:15 +0800)]
ocfs2: move new inode allocation out of the transaction

Move out inode allocation from ocfs2_mknod_locked() because
vfs_dq_init() must be called outside of a transaction.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: turn __ocfs2_remove_inode_range() into ocfs2_remove_btree_range()
Mark Fasheh [Wed, 12 Nov 2008 23:16:38 +0000 (15:16 -0800)]
ocfs2: turn __ocfs2_remove_inode_range() into ocfs2_remove_btree_range()

This patch genericizes the high level handling of extent removal.
ocfs2_remove_btree_range() is nearly identical to
__ocfs2_remove_inode_range(), except that extent tree operations have been
used where necessary. We update ocfs2_remove_inode_range() to use the
generic helper. Now extent tree based structures have an easy way to
truncate ranges.

Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Acked-by: Joel Becker <joel.becker@oracle.com>
17 years agoocfs2/xattr: Merge xattr set transaction.
Tao Ma [Wed, 12 Nov 2008 00:27:01 +0000 (08:27 +0800)]
ocfs2/xattr: Merge xattr set transaction.

In current ocfs2/xattr, the whole xattr set is divided into
many steps are many transaction are used, this make the
xattr set process isn't like a real transaction, so this
patch try to merge all the transaction into one. Another
benefit is that acl can use it easily now.

I don't merge the transaction of deleting xattr when we
remove an inode. The reason is that if we have a large number
of xattrs and every xattrs has large values(large enough
for outside storage), the whole transaction will be very
huge and it looks like jbd can't handle it(I meet with a
jbd complain once). And the old inode removal is also divided
into many steps, so I'd like to leave as it is.

Note:
In xattr set, I try to avoid ocfs2_extend_trans since if
the credits aren't enough for the extension, it will commit
all the dirty blocks and create a new transaction which may
lead to inconsistency in metadata. All ocfs2_extend_trans
remained are safe now.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2/xattr: Reserve meta/data at the beginning of ocfs2_xattr_set.
Tao Ma [Wed, 12 Nov 2008 00:27:00 +0000 (08:27 +0800)]
ocfs2/xattr: Reserve meta/data at the beginning of ocfs2_xattr_set.

In ocfs2 xattr set, we reserve metadata and clusters in any place
they are needed. It is time-consuming and ineffective, so this
patch try to reserve metadata and clusters at the beginning of
ocfs2_xattr_set.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2/xattr: Move clusters free into dealloc.
Tao Ma [Wed, 12 Nov 2008 00:26:59 +0000 (08:26 +0800)]
ocfs2/xattr: Move clusters free into dealloc.

Move clusters free process into dealloc context so that
they can be freed after the transaction.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Add clusters free in dealloc_ctxt.
Tao Ma [Wed, 12 Nov 2008 00:26:58 +0000 (08:26 +0800)]
ocfs2: Add clusters free in dealloc_ctxt.

Now in ocfs2 xattr set, the whole process are divided into many small
parts and they are wrapped into diffrent transactions and it make the
set doesn't look like a real transaction. So we want to integrate it
into a real one.

In some cases we will allocate some clusters and free some in just one
transaction. e.g, one xattr is larger than inline size, so it and its
value root is stored within the inode while the value is outside in a
cluster. Then we try to update it with a smaller value(larger than the
size of root but smaller than inline size), we may need to free the
outside cluster while allocate a new bucket(one cluster) since now the
inode may be full. The old solution will lock the global_bitmap(if the
local alloc failed in stress test) and then the truncate log. This will
cause a ABBA lock with truncate log flush.

This patch add the clusters free in dealloc_ctxt, so that we can record
the free clusters during the transaction and then free it after we
release the global_bitmap in xattr set.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2/xattr: Only extend xattr bucket in need.
Tao Ma [Wed, 12 Nov 2008 00:26:57 +0000 (08:26 +0800)]
ocfs2/xattr: Only extend xattr bucket in need.

When the first block of a bucket is filled up with xattr
entries, we normally extend the bucket. But if we are
just replace one xattr with small length, we don't need
to extend it. This is important since we will calculate
what we need before the transaction and in this situation
no resources will be allocated.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2/xattr: Only set buffer update if it doesn't exist in cache.
Tao Ma [Thu, 6 Nov 2008 00:10:48 +0000 (08:10 +0800)]
ocfs2/xattr: Only set buffer update if it doesn't exist in cache.

When we call ocfs2_init_xattr_bucket, we deem that the new buffer head
will be written to disk immediately, so we just use sb_getblk. But in
some cases the buffer may have already been in ocfs2 uptodate cache,
so we only call ocfs2_set_buffer_uptodate if the buffer head isn't
in the cache.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2/xattr: Remove additional bucket allocation in bucket defragment.
Tao Ma [Thu, 6 Nov 2008 00:10:47 +0000 (08:10 +0800)]
ocfs2/xattr: Remove additional bucket allocation in bucket defragment.

Joel has refactored xattr bucket and make xattr bucket a general
wrapper. So in ocfs2_defrag_xattr_bucket, we have already passed the
bucket in, so there is no need to allocate a new one and read it.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Use buckets in ocfs2_xattr_set_entry_in_bucket().
Joel Becker [Tue, 28 Oct 2008 01:07:45 +0000 (18:07 -0700)]
ocfs2: Use buckets in ocfs2_xattr_set_entry_in_bucket().

The ocfs2_xattr_set_entry_in_bucket() function is already working on an
ocfs2_xattr_bucket structure, so let's use the bucket API.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Use buckets in ocfs2_defrag_xattr_bucket().
Joel Becker [Mon, 27 Oct 2008 22:25:18 +0000 (15:25 -0700)]
ocfs2: Use buckets in ocfs2_defrag_xattr_bucket().

Use the ocfs2_xattr_bucket abstraction for reading and writing the
bucket in ocfs2_defrag_xattr_bucket().

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Use buckets in ocfs2_xattr_create_index_block().
Joel Becker [Mon, 27 Oct 2008 22:18:29 +0000 (15:18 -0700)]
ocfs2: Use buckets in ocfs2_xattr_create_index_block().

Use the ocfs2_xattr_bucket abstraction in
ocfs2_xattr_create_index_block() and its helpers.  We get more efficient
reads, a lot less buffer_head munging, and nicer code to boot.  While
we're at it, ocfs2_xattr_update_xattr_search() becomes void.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Use buckets in ocfs2_xattr_bucket_find().
Joel Becker [Mon, 27 Oct 2008 22:01:54 +0000 (15:01 -0700)]
ocfs2: Use buckets in ocfs2_xattr_bucket_find().

Change the ocfs2_xattr_bucket_find() function to use ocfs2_xattr_bucket
as its abstraction.  This makes for more efficient reads, as buckets are
linear blocks, and also has improved caching characteristics.  It also
reads better.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Take ocfs2_xattr_bucket structures off of the stack.
Joel Becker [Sat, 25 Oct 2008 02:13:20 +0000 (19:13 -0700)]
ocfs2: Take ocfs2_xattr_bucket structures off of the stack.

The ocfs2_xattr_bucket structure is a nice abstraction, but it is a bit
large to have on the stack.  Just like ocfs2_path, let's allocate it
with a ocfs2_xattr_bucket_new() function.

We can now store the inode on the bucket, cleaning up all the other
bucket functions.  While we're here, we catch another place or two that
wasn't using ocfs2_read_xattr_bucket().

Updates:
- No longer allocating xis.bucket, as it will never be used.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Copy xattr buckets with a dedicated function.
Joel Becker [Sat, 25 Oct 2008 01:54:43 +0000 (18:54 -0700)]
ocfs2: Copy xattr buckets with a dedicated function.

Now that the places that copy whole buckets are using struct
ocfs2_xattr_bucket, we can do the copy in a dedicated function.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Wrap journal_access/journal_dirty for xattr buckets.
Joel Becker [Sat, 25 Oct 2008 01:47:33 +0000 (18:47 -0700)]
ocfs2: Wrap journal_access/journal_dirty for xattr buckets.

A common action is to call ocfs2_journal_access() and
ocfs2_journal_dirty() on the buffer heads of an xattr bucket.  Let's
create nice wrappers.

While we're there, let's drop the places that try to be smart by writing
only the first and last blocks of a bucket.  A bucket is contiguous, so
writing the whole thing is actually more efficient.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Improve ocfs2_read_xattr_bucket().
Joel Becker [Sat, 25 Oct 2008 00:33:40 +0000 (17:33 -0700)]
ocfs2: Improve ocfs2_read_xattr_bucket().

The ocfs2_read_xattr_bucket() function would read an xattr bucket into a
list of buffer heads.  However, we have a nice ocfs2_xattr_bucket
structure.  Let's have it fill that out instead.

In addition, ocfs2_read_xattr_bucket() would initialize buffer heads for
a bucket that's never been on disk before.  That's confusing.  Let's
call that functionality ocfs2_init_xattr_bucket().

The functions ocfs2_cp_xattr_bucket() and ocfs2_half_xattr_bucket() are
updated to use the ocfs2_xattr_bucket structure rather than raw bh
lists.  That way they can use the new read/init calls.  In addition,
they drop the wasted read of an existing target bucket.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Provide a wrapper to brelse() xattr bucket buffers.
Joel Becker [Sat, 25 Oct 2008 00:16:48 +0000 (17:16 -0700)]
ocfs2: Provide a wrapper to brelse() xattr bucket buffers.

A common theme is walking all the buffer heads on an ocfs2_xattr_bucket
and releasing them.  Let's wrap that.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Convenient access to an xattr bucket's header.
Joel Becker [Sat, 25 Oct 2008 00:04:49 +0000 (17:04 -0700)]
ocfs2: Convenient access to an xattr bucket's header.

The xattr code often wants to access the ocfs2_xattr_header at the start
of an bucket.  Rather than walk the pointer chains, let's just create
another nice macro.  As a side benefit, we can get rid of the mostly
spurious ->bu_xh element on the bucket structure.  The idea is ripped
from the ocfs2_path code.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Convenient access to xattr bucket data blocks.
Joel Becker [Fri, 24 Oct 2008 23:57:21 +0000 (16:57 -0700)]
ocfs2: Convenient access to xattr bucket data blocks.

The xattr code often wants to access the data pointer for blocks in an
xattr bucket.  This is usually found by dereferencing the bh array
hanging off of the ocfs2_xattr_bucket structure.  Rather than do this
all the time, let's provide a nice little macro.  The idea is ripped
from the ocfs2_path code.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Convenient access to an xattr bucket's block number.
Joel Becker [Fri, 24 Oct 2008 23:21:03 +0000 (16:21 -0700)]
ocfs2: Convenient access to an xattr bucket's block number.

The xattr code often wants to know the block number of an xattr bucket.
This is usually found by dereferencing the first bh hanging off of the
ocfs2_xattr_bucket structure.  Rather than do this all the time, let's
provide a nice little macro.  The idea is ripped from the ocfs2_path
code.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years agoocfs2: Field prefixes for the xattr_bucket structure
Joel Becker [Sun, 19 Oct 2008 02:11:42 +0000 (19:11 -0700)]
ocfs2: Field prefixes for the xattr_bucket structure

The ocfs2_xattr_bucket structure keeps track of the buffers for one
xattr bucket.  Let's prefix the fields for easier code navigation.

Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
17 years ago[MTD] [TESTS] Fix some size_t printk format warnings
David Woodhouse [Mon, 5 Jan 2009 16:31:03 +0000 (16:31 +0000)]
[MTD] [TESTS] Fix some size_t printk format warnings

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
17 years agoMerge branch 'master' of git://git.infradead.org/users/dedekind/mtd-tests-2.6
David Woodhouse [Mon, 5 Jan 2009 16:24:55 +0000 (16:24 +0000)]
Merge branch 'master' of git://git.infradead.org/users/dedekind/mtd-tests-2.6

Conflicts:
drivers/mtd/Makefile

17 years agoavr32: data param to at32_add_device_mci() must be non-NULL
Haavard Skinnemoen [Mon, 5 Jan 2009 16:14:22 +0000 (17:14 +0100)]
avr32: data param to at32_add_device_mci() must be non-NULL

at32_add_device_mci() will refuse to add the mci device if the data
parameter is NULL. Fix up the favr-32 and hammerhead boards so that this
doesn't happen.

Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Cc: Alex Raimondi <mailinglist@miromico.ch>
Cc: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
17 years agoMerge branch 'move-atmel-mci-h' into boards
Haavard Skinnemoen [Mon, 5 Jan 2009 15:36:07 +0000 (16:36 +0100)]
Merge branch 'move-atmel-mci-h' into boards

17 years agoatmel-mci: move atmel-mci.h file to include/linux
Nicolas Ferre [Thu, 20 Nov 2008 14:59:12 +0000 (15:59 +0100)]
atmel-mci: move atmel-mci.h file to include/linux

Needed to use the atmel-mci driver in an architecture
independant maner.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
17 years ago[SCSI] sd: Correctly handle 6-byte commands with DIX
Martin K. Petersen [Sun, 4 Jan 2009 08:04:34 +0000 (03:04 -0500)]
[SCSI] sd: Correctly handle 6-byte commands with DIX

DIF does not work with 6-byte commands so we previously ignored those
commands when preparing a request.  However, DIX does not need
RDPROTECT/WRPROTECT to be set and 6-byte commands are consequently
perfectly valid in host-only mode.

This patch fixes a problem where we would set the wrong DIX operation
when issuing commands to a legacy disk.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
17 years ago[SCSI] sd: DIF: Fix tagging on platforms with signed char
Martin K. Petersen [Sun, 4 Jan 2009 08:04:33 +0000 (03:04 -0500)]
[SCSI] sd: DIF: Fix tagging on platforms with signed char

Switch tag arrays to u8 to prevent problems on platforms with signed
char.

Reported-by: Tim LaBerge <tim.laberge@Quantum.Com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
17 years ago[SCSI] sd: DIF: Show app tag on error
Martin K. Petersen [Sun, 4 Jan 2009 08:04:32 +0000 (03:04 -0500)]
[SCSI] sd: DIF: Show app tag on error

Add application tag to the output displayed on error.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
17 years ago[SCSI] Fix error handling for DIF/DIX
Martin K. Petersen [Sun, 4 Jan 2009 08:04:31 +0000 (03:04 -0500)]
[SCSI] Fix error handling for DIF/DIX

patch

commit b60af5b0adf0da24c673598c8d3fb4d4189a15ce
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Mon Nov 3 15:56:47 2008 -0500

    [SCSI] simplify scsi_io_completion()

broke DIX error handling.  Also, we are now using EILSEQ to indicate
integrity errors to the upper layers (as opposed to regular EIO
failures).  This allows filesystems to inspect buffers and decide
whether to retry the I/O.  Update scsi_io_completion() accordingly.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
17 years ago[SCSI] scsi_lib: don't decrement busy counters when inserting commands
James Bottomley [Fri, 2 Jan 2009 16:42:21 +0000 (10:42 -0600)]
[SCSI] scsi_lib: don't decrement busy counters when inserting commands

A bug was introduced by

commit b60af5b0adf0da24c673598c8d3fb4d4189a15ce
Author: Alan Stern <stern@rowland.harvard.edu>
Date:   Mon Nov 3 15:56:47 2008 -0500

    [SCSI] simplify scsi_io_completion()

because the simplification uses scsi_queue_insert().  The problem with
this function is that it expects to be called from the completion path
while the command is still outstanding, so it decrements the device
and host busy counts to do the requeue.  The problem is that
scsi_io_completion() is a path executed well after these counts have
*already* been decremented, leading to a double decrement if the
command goes down any error path leading to ACTION_DELAYED_RETRY.

The fix is to allow a private function __scsi_queue_insert() with a
flag to say whether the busy counters should be decremented.  This is
made static to scsi_lib.c to discourage other use.

Reported-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
17 years agoavr32: Hammerhead board support
Alex Raimondi [Tue, 9 Dec 2008 15:17:13 +0000 (16:17 +0100)]
avr32: Hammerhead board support

The Hammerhead platform is built around a AVR32 32-bit microcontroller
from Atmel.  It offers versatile peripherals, such as ethernet, usb
device, usb host etc.

The board also incooperates a power supply and is a Power over Ethernet
(PoE) Powered Device (PD).

Additonally, a Cyclone III FPGA from Altera is integrated on the board.
The FPGA is mapped into the 32-bit AVR memory bus. The FPGA offers two
DDR2 SDRAM interfaces, which will cover even the most exceptional need
of memory bandwidth. Together with the onboard video decoder the board
is ready for video processing.

This patch does include the basic support for the fpga device driver,
but not the device driver itself.

Signed-off-by: Alex Raimondi <mailinglist@miromico.ch>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
17 years agoMerge branch 'cleanups' into boards
Haavard Skinnemoen [Mon, 5 Jan 2009 14:51:52 +0000 (15:51 +0100)]
Merge branch 'cleanups' into boards

17 years agox86: update Alan Cox's email addresses
Alan Cox [Mon, 5 Jan 2009 14:08:04 +0000 (14:08 +0000)]
x86: update Alan Cox's email addresses

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agogenirq: provide irq_to_desc() to non-genirq architectures too
Ingo Molnar [Mon, 5 Jan 2009 13:34:42 +0000 (14:34 +0100)]
genirq: provide irq_to_desc() to non-genirq architectures too

Impact: build fix on non-genirq architectures

Sam Ravnborg reported this build failure on sparc32 allmodconfig,
the GPIO drivers assume the presence of irq_to_desc():

 drivers/gpio/gpiolib.c: In function `gpiolib_dbg_show':
 drivers/gpio/gpiolib.c:1146: error: implicit declaration of function 'irq_to_desc'

Add it in the !genirq case too.

Reported-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Tested-by: Sam Ravnborg <sam@ravnborg.org>
17 years agoMerge branch 'core/iommu' into core/urgent
Ingo Molnar [Mon, 5 Jan 2009 13:17:24 +0000 (14:17 +0100)]
Merge branch 'core/iommu' into core/urgent

Conflicts:
lib/swiotlb.c

17 years agohrtimer: splitout peek ahead functionality, fix
Ingo Molnar [Mon, 5 Jan 2009 13:11:10 +0000 (14:11 +0100)]
hrtimer: splitout peek ahead functionality, fix

Impact: build fix on !CONFIG_HIGH_RES_TIMERS

Fix:

  kernel/hrtimer.c:1586: error: implicit declaration of function '__hrtimer_peek_ahead_timers'

Signen-off-by: Ingo Molnar <mingo@elte.hu>
17 years agoASoC: fix davinci-sffsdr buglet
David Brownell [Mon, 5 Jan 2009 10:08:30 +0000 (02:08 -0800)]
ASoC: fix davinci-sffsdr buglet

Minor bugfix:  now that DaVinci kernels can support multiple
boards, board-specific ASoC components need to verify they're
running on the right board before initializing.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
17 years agox86: rename all fields of mpc_table mpc_X to X
Jaswinder Singh Rajput [Sun, 4 Jan 2009 16:52:56 +0000 (22:22 +0530)]
x86: rename all fields of mpc_table mpc_X to X

Impact: cleanup, solve 80 columns wrap problems

It would be cleaner to rename all the mpc->mpc_X fields to
mpc->X - that alone would give 4 characters per usage site.
(we already know that it's an 'mpc' entity -
no need to duplicate that in the field too)

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agox86: rename all fields of mpc_oemtable oem_X to X
Jaswinder Singh Rajput [Sun, 4 Jan 2009 16:30:46 +0000 (22:00 +0530)]
x86: rename all fields of mpc_oemtable oem_X to X

Impact: cleanup, solve 80 columns wrap problems

It would be cleaner to rename all the mpc->oem_X fields to
mpc->X - that alone would give 4 characters per usage site.
(we already know that it's an 'oem' entity -
no need to duplicate that in the field too)

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agox86: rename all fields of mpc_bus mpc_X to X
Jaswinder Singh Rajput [Sun, 4 Jan 2009 16:29:26 +0000 (21:59 +0530)]
x86: rename all fields of mpc_bus mpc_X to X

Impact: cleanup, solve 80 columns wrap problems

It would be cleaner to rename all the mpc->mpc_X fields to
mpc->X - that alone would give 4 characters per usage site.
(we already know that it's an 'mpc' entity -
no need to duplicate that in the field too)

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agox86: rename all fields of mpc_cpu mpc_X to X
Jaswinder Singh Rajput [Sun, 4 Jan 2009 16:28:25 +0000 (21:58 +0530)]
x86: rename all fields of mpc_cpu mpc_X to X

Impact: cleanup, solve 80 columns wrap problems

It would be cleaner to rename all the mpc->mpc_X fields to
mpc->X - that alone would give 4 characters per usage site.
(we already know that it's an 'mpc' entity -
no need to duplicate that in the field too)

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agox86: rename all fields of mpc_intsrc mpc_X to X
Jaswinder Singh Rajput [Sun, 4 Jan 2009 16:26:44 +0000 (21:56 +0530)]
x86: rename all fields of mpc_intsrc mpc_X to X

Impact: cleanup, solve 80 columns wrap problems

It would be cleaner to rename all the mpc->mpc_X fields to
mpc->X - that alone would give 4 characters per usage site.
(we already know that it's an 'mpc' entity -
no need to duplicate that in the field too)

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agox86: rename all fields of mpc_lintsrc mpc_X to X
Jaswinder Singh Rajput [Sun, 4 Jan 2009 16:25:53 +0000 (21:55 +0530)]
x86: rename all fields of mpc_lintsrc mpc_X to X

Impact: cleanup, solve 80 columns wrap problems

It would be cleaner to rename all the mpc->mpc_X fields to
mpc->X - that alone would give 4 characters per usage site.
(we already know that it's an 'mpc' entity -
no need to duplicate that in the field too)

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agox86: rename all fields of mpc_iopic mpc_X to X
Jaswinder Singh Rajput [Sun, 4 Jan 2009 16:24:39 +0000 (21:54 +0530)]
x86: rename all fields of mpc_iopic mpc_X to X

Impact: cleanup, solve 80 columns wrap problems

It would be cleaner to rename all the mpc->mpc_X fields to
mpc->X - that alone would give 4 characters per usage site.
(we already know that it's an 'mpc' entity -
no need to duplicate that in the field too)

Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years ago[MTD] LPDDR Makefile and KConfig
Alexey Korolev [Tue, 16 Dec 2008 18:24:14 +0000 (18:24 +0000)]
[MTD] LPDDR Makefile and KConfig

We have two components to manage LPDDR flash memories in Linux.
1. It is a driver for chip probing and reading its capabilities
2. It is a device operations driver.

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Acked-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
17 years ago[MTD] LPDDR extended physmap driver to support LPDDR flash
Alexey Korolev [Tue, 16 Dec 2008 18:22:39 +0000 (18:22 +0000)]
[MTD] LPDDR extended physmap driver to support LPDDR flash

Physmap is a generic map driver for different platforms and flash types.
We added support of LPDDR to physmap.
All changes here are related to introduction of new pfow_base parameter.
This parameter is valid in case of LPDDR chips only.

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Acked-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
17 years ago[MTD] LPDDR added new pfow_base parameter
Alexey Korolev [Tue, 16 Dec 2008 18:21:10 +0000 (18:21 +0000)]
[MTD] LPDDR added new pfow_base parameter

We need to supply additional parameter to mapping driver and tell
LPDDR drivers where PFOW window is in chip mapping.
It leads to necessity of map_info structure extendoing.

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Acked-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
17 years ago[MTD] LPDDR Command set driver
Alexey Korolev [Tue, 16 Dec 2008 18:20:03 +0000 (18:20 +0000)]
[MTD] LPDDR Command set driver

Driver which handles device command operation.
Details on device operations are available here:
http://www.numonyx.com/Documents/Datasheets/DS-315768_Velocity-Discrete.pdf

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Acked-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
17 years ago[MTD] LPDDR PFOW definition
Alexey Korolev [Tue, 16 Dec 2008 18:15:33 +0000 (18:15 +0000)]
[MTD] LPDDR PFOW definition

LPDDR chips use PFOW window for sending commands, reading status and
capabilites requesting.
This pfow.h - contains definitions for PFOW window fileds, possible commands,
error flags and some common macro function to avoid code duplications.

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Acked-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
17 years ago[MTD] LPDDR QINFO records definitions
Alexey Korolev [Tue, 16 Dec 2008 18:13:58 +0000 (18:13 +0000)]
[MTD] LPDDR QINFO records definitions

There are declaraton of structures and macros definitions
necessary for operations with QINFO in this patch.

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Acked-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
17 years ago[MTD] LPDDR qinfo probing.
Alexey Korolev [Tue, 16 Dec 2008 18:11:51 +0000 (18:11 +0000)]
[MTD] LPDDR qinfo probing.

LPDDR flash chips are based on completely new kind of chips probing.
Device capabilities are available via special request.
We sent field request command which contains Major and Minor numbers - and
recieve corresponend value.
All requests are performed within PFOW window.
Detailed information about qinfo records can be found here:
http://www.numonyx.com/Documents/Datasheets/DS-315768_Velocity-Discrete.pdf

Signed-off-by: Alexey Korolev <akorolev@infradead.org>
Acked-by: Jared Hulbert <jaredeh@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
17 years agosched: clean up arch_reinit_sched_domains()
Li Zefan [Mon, 5 Jan 2009 11:07:50 +0000 (19:07 +0800)]
sched: clean up arch_reinit_sched_domains()

- Make arch_reinit_sched_domains() static. It was exported to be used in
  s390, but now rebuild_sched_domains() is used instead.

- Make it return void.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agosched: mark sched_create_sysfs_power_savings_entries() as __init
Li Zefan [Mon, 5 Jan 2009 11:18:02 +0000 (19:18 +0800)]
sched: mark sched_create_sysfs_power_savings_entries() as __init

Impact: cleanup

The only caller is cpu_dev_init() which is marked as __init.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agoMerge branch 'linus' into sched/urgent
Ingo Molnar [Mon, 5 Jan 2009 12:53:39 +0000 (13:53 +0100)]
Merge branch 'linus' into sched/urgent

17 years agohrtimer: fixup comments
Thomas Gleixner [Mon, 5 Jan 2009 10:28:23 +0000 (11:28 +0100)]
hrtimer: fixup comments

Clean up the comments

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agohrtimer: fix recursion deadlock by re-introducing the softirq
Peter Zijlstra [Mon, 5 Jan 2009 10:28:22 +0000 (11:28 +0100)]
hrtimer: fix recursion deadlock by re-introducing the softirq

Impact: fix rare runtime deadlock

There are a few sites that do:

  spin_lock_irq(&foo)
  hrtimer_start(&bar)
    __run_hrtimer(&bar)
      func()
        spin_lock(&foo)

which obviously deadlocks. In order to avoid this, never call __run_hrtimer()
from hrtimer_start*() context, but instead defer this to softirq context.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agohrtimer: simplify hotplug migration
Thomas Gleixner [Mon, 5 Jan 2009 10:28:21 +0000 (11:28 +0100)]
hrtimer: simplify hotplug migration

Impact: cleanup

No need for a smp function call, which is likely to run on the same
CPU anyway. We can just call hrtimers_peek_ahead() in the interrupts
disabled section of migrate_hrtimers().

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agohrtimer: fix HOTPLUG_CPU=n compile warning
Thomas Gleixner [Mon, 5 Jan 2009 10:28:20 +0000 (11:28 +0100)]
hrtimer: fix HOTPLUG_CPU=n compile warning

Impact: cleanup

 kernel/hrtimer.c: In function 'hrtimer_cpu_notify':
 kernel/hrtimer.c:1574: warning: unused variable 'dcpu'

Introduced by commit 37810659ea7d9572c5ac284ade272f806ef8f788
("hrtimer: removing all ur callback modes, fix hotplug") from the
timers.  dcpu is only used if CONFIG_HOTPLUG_CPU is set.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agohrtimer: splitout peek ahead functionality
Thomas Gleixner [Mon, 5 Jan 2009 10:28:19 +0000 (11:28 +0100)]
hrtimer: splitout peek ahead functionality

Impact: cleanup

Provide a peek ahead function that assumes irqs disabled, allows for micro
optimizations.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
17 years agorcu: fix rcutorture bug
Paul E. McKenney [Mon, 5 Jan 2009 02:28:27 +0000 (18:28 -0800)]
rcu: fix rcutorture bug

Fix an rcutorture bug that prevents the shutdown notifier from ever
actually having any effect, due to the fact that kthreads ignore all
signals.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>