Age | Commit message (Collapse) | Author | Files | Lines |
|
Use the rbm structure for gfs2_setbit() in order to simplify the
arguments to the function. We have to add a bool to control whether
the clone bitmap should be updated (if it exists) but otherwise it
is a more or less direct substitution.
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
Change the arguments to gfs2_testbit() so that it now just takes an
rbm specifying the position of the two bit entry to return.
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
Function gfs2_bitfit was checking for state > 3, but that's
impossible since it is only called from rgblk_search, which receives
only GFS2_BLKST_ constants.
Signed-off-by: Bob Peterson <[email protected]>
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
Function add_to_queue was checking may_grant for the passed-in
holder for every iteration of its gh2 loop. Now it only checks it
once at the beginning to see if a try lock is futile.
Signed-off-by: Bob Peterson <[email protected]>
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
Function gfs2_glock_dq_wait called two-line function wait_on_demote,
so they were combined.
Signed-off-by: Bob Peterson <[email protected]>
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
Function gfs2_glock_wait only called function wait_on_holder and
returned its return code, so they were combined for readability.
Signed-off-by: Bob Peterson <[email protected]>
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
Since function gfs2_glock_schedule_for_reclaim is only two
significant lines, we can eliminate it, simplifying the code
and making it more readable.
Signed-off-by: Bob Peterson <[email protected]>
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
This patch changes function gfs2_direct_IO so that it uses a normal
call to gfs2_glock_dq rather than a call to a multiple-dq of one item.
Signed-off-by: Bob Peterson <[email protected]>
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
This patch fixes a few small rbm related things. First, it fixes
a corner case where the rbm needs to switch bitmaps and wasn't
adjusting its buffer pointer. Second, there's a white space issue
fixed. Third, the logic in function gfs2_rbm_from_block was optimized
a bit. Lastly, a check for goal block overflows was added to function
gfs2_alloc_blocks.
Signed-off-by: Bob Peterson <[email protected]>
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
One corner case which the original patch failed to take into
account was when there is a reservation which ended such that
the following block was one beyond the end of the rgrp in
question. This extra test fixes that case.
Signed-off-by: Steven Whitehouse <[email protected]>
Reported-by: Bob Peterson <[email protected]>
Tested-by: Bob Peterson <[email protected]>
|
|
gfs2 calls RB_EMPTY_NODE() to check if nodes are not on an rbtree.
The corresponding initialization function is RB_CLEAR_NODE().
rb_init_node() was never clearly defined and is going away.
Signed-off-by: Michel Lespinasse <[email protected]>
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
Replace open coded version with a call to gfs2_rbm_from_block()
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
Use the new gfs2_rbm_from_block() function to replace an open
coded version of the same code.
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
This is part of a series of patches which are introducing the
gfs2_rbm structure throughout the block allocation code. The
main aim of this part is to create a search function which can
deal directly with struct gfs2_rbm. In this case it specifies
the initial position at which to start the search and also the
point at which the search terminates.
The net result of this is to clean up the search code and make
it rather more readable, and the various possible exceptions which
may occur during the search are partitioned into their own functions.
There are some bug fixes too. We should not be checking the reservations
while allocating extents - the time for that is when we are searching
for where to put the extent, not when we've already made that decision.
Also, rgblk_search had two uses, and in only one of those cases did
it make sense to check for reservations. This is fixed in the new
gfs2_rbm_find function, which has a cleaner interface.
The reservation checking has been improved by always checking for
contiguous reservations, and returning the first free block after
all contiguous reservations. This is done under the spin lock to
ensure consistancy of the tree.
The allocation of extents is now in all cases done by the existing
allocation code, and if there is an active reservation, that is updated
after the fact. Again this is done under the spin lock, since it entails
changing the lookup key for the reservation in question.
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
This patch introduces a new structure, gfs2_rbm, which is a
tuple of a resource group, a bitmap within the resource group
and an offset within that bitmap. This is designed to make
manipulating these sets of variables easier. There is also a
new helper function which converts this representation back
to a disk block address.
In addition, the rbtree nodes which are used for the reservations
were not being correctly initialised, which is now fixed. Also,
the tracing was not passing through the inode where it should
have been. That is mostly fixed aside from one corner case. This
needs to be revisited since there can also be a NULL rgrp in
some cases which results in the device being incorrect in the
trace.
This is intended to be the first step towards cleaning up some
of the allocation code, and some further bug fixes.
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
The rs_requested field is left over from the original allocation
code, however this should have been a parameter passed to the
various functions from gfs2_inplace_reserve() and not a member of the
reservation structure as the value is not required after the
initial allocation.
This also helps simplify the code since we no longer need to set
the rs_requested to zero. Also the gfs2_inplace_release()
function can also be simplified since the reservation structure
will always be defined when it is called, and the only remaining
task is to unlock the rgrp if required. It can also now be
called unconditionally too, resulting in a further simplification.
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
There were two functions in the xattr code which were nearly
identical, the only difference being that one was copy data into
the unstuffed xattrs and the other was copying data out from it.
This patch merges the two functions such that the code which deal
with iteration over the unstuffed xattrs is no longer duplicated.
Signed-off-by: Steven Whitehouse <[email protected]>
|
|
When either of __alloc_from_contiguous or __alloc_remap_buffer fails
to provide a valid pointer, allocated memory is freed up and an error
is returned. 'pages' was however not freed before returning error.
Cc: Arnd Bergmann <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Signed-off-by: Sachin Kamat <[email protected]>
Signed-off-by: Marek Szyprowski <[email protected]>
|
|
commit b17459c05000fdbe8d10946570a26510f86ec0f
raid5: add a per-stripe lock
added a spin_lock to the 'stripe_head' struct.
Unfortunately there are two places where this struct is allocated
but the spin lock was only initialised in one of them.
So add the missing spin_lock_init.
Signed-off-by: NeilBrown <[email protected]>
|
|
This Patch adds support for mcp3221 chip to the
mcp3021 driver.
Signed-off-by: Sven Schuchmann <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
This Patch is to prepare the MCP3021 driver to support
other chips like the MCP3221. The hard defined chip data
is now stored within the data struct of each chip.
Signed-off-by: Sven Schuchmann <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
The following build warnings are seen with -Wextra.
w83791d.c: In function store_temp_target:
w83791d.c:858:2: warning: comparison of unsigned expression < 0 is always false
w83791d.c: In function store_temp_tolerance:
w83791d.c:920:2: warning: comparison of unsigned expression < 0 is always false
For store_temp_target, accept negative numbers and clamp to >= 0.
For store_temp_tolerance, drop the unnecessary comparison.
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jean Delvare <[email protected]>
|
|
The following build warning is seen with -Wextra.
lm93.c: In function ‘store_fan_smart_tach’:
lm93.c:1833:2: warning: comparison of unsigned expression >= 0 is always true
Drop the unnecessary comparison.
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jean Delvare <[email protected]>
|
|
Instead of using a switch statement to determine the device name, use
to_spi_device(dev)->modalias to simplify the code and reduce module size.
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Display device name using to_spi_device(dev)->modalias instead of computing it
from the number of ADC channels. This is cleaner and reduces code size.
Signed-off-by: Guenter Roeck <[email protected]>
|
|
CONFIG_EXPERIMENTAL is expected to be removed, so drop dependencies on it.
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Acked-by: Jean Delvare <[email protected]>
|
|
Add missing reference to IT8782F and IT8783E/F to it87 driver description
in Kconfig. Replace wrong reference to Si960 with the correct Si950.
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jean Delvare <[email protected]>
|
|
This patch moves the sht15.h header from include/linux to
include/linux/platform_data, and update existing support (stargate2
platform) accordingly.
Signed-off-by: Vivien Didelot <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
The semantic patch that finds this problem is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@r exists@
position p1,p2;
expression x;
@@
if (x@p1 == NULL) { ... kfree@p2(x); ... return ...; }
@unchanged exists@
position r.p1,r.p2;
expression e <= r.x,x,e1;
iterator I;
statement S;
@@
if (x@p1 == NULL) { ... when != I(x,...) S
when != e = e1
when != e += e1
when != e -= e1
when != ++e
when != --e
when != e++
when != e--
when != &e
kfree@p2(x); ... return ...; }
@ok depends on unchanged exists@
position any r.p1;
position r.p2;
expression x;
@@
... when != true x@p1 == NULL
kfree@p2(x);
@depends on !ok && unchanged@
position r.p2;
expression x;
@@
*kfree@p2(x);
// </smpl>
Signed-off-by: Peter Senna Tschudin <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
INA220 is register compatible to INA219, and INA230 is register compatible to
INA226, so all we need to do is to add name aliases for those two chips.
Cc: Lothar Felten <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Reviewed-by: Jean Delvare <[email protected]>
|
|
Replace per-device initialization and per-device calculation code with
per-device configuration data, which is then used to configure the chip and
perform calculations based on that data.
This patch reduces code size by more than 400 bytes on x86_64.
Cc: Lothar Felten <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jean Delvare <[email protected]>
|
|
MAX1110 is similar to MAX1111, with 8 instead of 4 channels. MAX1112 and MAX1113
are similar to MAX1110 and MAX1111, with 4.096V reference voltage instead of
2.048V.
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jean Delvare <[email protected]>
|
|
Add support for LM74 and LM71 to LM70 driver.
Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Legacy sysfs attributes for chassis intrusion detection have been removed.
Update feature-removal-schedule.txt to reflect it.
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jean Delvare <[email protected]>
|
|
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jean Delvare <[email protected]>
|
|
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jean Delvare <[email protected]>
|
|
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jean Delvare <[email protected]>
|
|
Removing the 3wire limitation on LM70 as the component also allows
operation on 4wire SPI bus
Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Declare an array of platform_device_id, instead of registering a driver
for each supported chip. This makes the code cleaner.
Also add a module description.
Signed-off-by: Vivien Didelot <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
The MAX197 is an A/D converter, made by Maxim. This driver currently
supports the MAX197, and MAX199. They are both 8-Channel, Multi-Range,
5V, 12-Bit DAS with 8+4 Bus Interface and Fault Protection.
The available ranges for the MAX197 are {0,-5V} to 5V, and {0,-10V} to
10V, while they are {0,-2V} to 2V, and {0,-4V} to 4V on the MAX199.
Signed-off-by: Vivien Didelot <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Smatch complains that adt7410_update_device() can return error pointers.
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
This patch brings basic support for the Analog Devices ADT7410 temperature
sensor. The following functionality has been implemented:
* get current temperature
* get/set minimum, maximum and critical temperature
* get/set hysteresis
* get alarm events for minimum, maximum and critical temperature
All implemented sysfs attributes have been sucessfully tested at temperatures
of 15°C to 40°C.
Signed-off-by: Hartmut Knaack <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Convert to use devm_ functions to reduce code size and simplify the code.
Cc: Andreas Herrmann <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Convert to use devm_ functions to reduce code size and simplify the code.
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Convert to use devm_ functions to reduce code size and simplify the code.
Cc: Lars-Peter Clausen <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Convert to use devm_ functions to reduce code size and simplify the code.
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Convert to use devm_ functions to reduce code size and simplify the code.
Cc: Roger Lucas <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Convert to use devm_ functions to reduce code size and simplify the code.
Cc: Jonathan Cameron <[email protected]>
Cc: Urs Fleisch <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
|
|
Convert to use devm_ functions to reduce code size and simplify the code.
Cc: Jonathan Cameron <[email protected]>
Cc: Vivien Didelot <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Jonathan Cameron <[email protected]>
|
|
Convert to use devm_ functions to reduce code size and simplify the code.
Signed-off-by: Guenter Roeck <[email protected]>
|