aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2012-09-24GFS2: Use rbm for gfs2_setbit()Steven Whitehouse1-26/+20
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]>
2012-09-24GFS2: Use rbm for gfs2_testbit()Steven Whitehouse1-44/+28
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]>
2012-09-24GFS2: Eliminate unnecessary check for state > 3 in bitfitBob Peterson1-2/+0
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]>
2012-09-24GFS2: Eliminate redundant calls to may_grantBob Peterson1-5/+4
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]>
2012-09-24GFS2: Combine functions gfs2_glock_dq_wait and wait_on_demoteBob Peterson1-7/+2
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]>
2012-09-24GFS2: Combine functions gfs2_glock_wait and wait_on_holderBob Peterson1-14/+9
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]>
2012-09-24GFS2: inline __gfs2_glock_schedule_for_reclaimBob Peterson1-16/+3
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]>
2012-09-24GFS2: change function gfs2_direct_IO to use a normal gfs2_glock_dqBob Peterson1-1/+1
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]>
2012-09-24GFS2: rbm code cleanupBob Peterson1-5/+11
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]>
2012-09-24GFS2: Fix case where reservation finished at end of rgrpSteven Whitehouse1-0/+7
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]>
2012-09-24GFS2: Use RB_CLEAR_NODE() rather than rb_init_node()Michel Lespinasse1-2/+2
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]>
2012-09-24GFS2: Update rgblk_free() to use rbmSteven Whitehouse1-30/+14
Replace open coded version with a call to gfs2_rbm_from_block() Signed-off-by: Steven Whitehouse <[email protected]>
2012-09-24GFS2: Update gfs2_get_block_type() to use rbmSteven Whitehouse1-19/+6
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]>
2012-09-24GFS2: Replace rgblk_search with gfs2_rbm_findSteven Whitehouse2-210/+257
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]>
2012-09-24GFS2: Add structure to contain rgrp, bitmap, offset tupleSteven Whitehouse6-115/+105
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]>
2012-09-24GFS2: Remove rs_requested field from reservationsSteven Whitehouse9-59/+27
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]>
2012-09-24GFS2: Merge two nearly identical xattr functionsSteven Whitehouse1-64/+30
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]>
2012-09-24ARM: dma-mapping: Fix potential memory leak in atomic_pool_init()Sachin Kamat1-0/+2
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]>
2012-09-24md/raid5: add missing spin_lock_init.NeilBrown1-0/+1
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]>
2012-09-23hwmon: (mcp3021) Add MCP3221 supportSven Schuchmann3-14/+37
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]>
2012-09-23hwmon: (mcp3021) Prepare MCP3021 driver to support other chipsSven Schuchmann1-7/+26
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]>
2012-09-23hwmon: (w83791d) Drop unnecessary compare statementsGuenter Roeck1-4/+3
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]>
2012-09-23hwmon: (lm93) Drop unnecessary compare statementGuenter Roeck1-1/+1
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]>
2012-09-23hwmon: (lm70) Simplify show_name functionGuenter Roeck1-20/+1
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]>
2012-09-23hwmon: (adcxx) Simplify show_name functionGuenter Roeck1-4/+1
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]>
2012-09-23hwmon: Drop dependencies on EXPERIMENTALGuenter Roeck1-41/+40
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]>
2012-09-23hwmon: (it87) Fix Kconfig for IT87 driverGuenter Roeck1-2/+2
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]>
2012-09-23hwmon: (sht15) move header to linux/platform_data/Vivien Didelot3-3/+2
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]>
2012-09-23hwmon: (asus_atk0110) Remove useless kfreePeter Senna Tschudin1-1/+0
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]>
2012-09-23hwmon: (ina2xx) Add support for INA220 and INA230Guenter Roeck3-3/+31
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]>
2012-09-23hwmon: (ina2xx) Use structure array to distinguish chip typesGuenter Roeck1-103/+56
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]>
2012-09-23hwmon: (max1111) Add support for MAX1110, MAX1112, and MAX1113Guenter Roeck2-9/+70
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]>
2012-09-23hwmon: (lm70) Add support for LM71 and LM74Christophe Leroy3-8/+34
Add support for LM74 and LM71 to LM70 driver. Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2012-09-23hwmon: (Documentation) Update feature-removal-schedule.txtGuenter Roeck1-10/+0
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]>
2012-09-23hwmon: (w83793) Remove legacy chassis intrusion detection sysfs attributesGuenter Roeck1-23/+0
Signed-off-by: Guenter Roeck <[email protected]> Acked-by: Jean Delvare <[email protected]>
2012-09-23hwmon: (w83792d) Remove legacy chassis intrusion detection attributesGuenter Roeck1-56/+2
Signed-off-by: Guenter Roeck <[email protected]> Acked-by: Jean Delvare <[email protected]>
2012-09-23hwmon: (adm9240) Remove legacy chassis intrusion detection sysfs attributeGuenter Roeck1-26/+0
Signed-off-by: Guenter Roeck <[email protected]> Acked-by: Jean Delvare <[email protected]>
2012-09-23hwmon: (lm70) Allow 4wire SPI bus with LM70Christophe Leroy2-7/+2
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]>
2012-09-23hwmon: (sht15) remove multiple driver registrationVivien Didelot1-71/+23
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]>
2012-09-23hwmon: add Maxim MAX197 supportVivien Didelot5-0/+440
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]>
2012-09-23hwmon: (adt7410) handle errors from adt7410_update_device()Dan Carpenter1-2/+7
Smatch complains that adt7410_update_device() can return error pointers. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
2012-09-23hwmon: Driver for ADT7410Hartmut Knaack4-0/+521
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]>
2012-09-23hwmon: (fam15h_power) Convert to use devm_ functionsGuenter Roeck1-17/+8
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]>
2012-09-23hwmon: (via-cputemp) Convert to use devm_ functionsGuenter Roeck1-16/+7
Convert to use devm_ functions to reduce code size and simplify the code. Signed-off-by: Guenter Roeck <[email protected]>
2012-09-23hwmon: (jz4740-hwmon) Convert to use devm_ functionsGuenter Roeck1-37/+16
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]>
2012-09-23hwmon: (w83l786ng) Convert to use devm_ functionsGuenter Roeck1-9/+4
Convert to use devm_ functions to reduce code size and simplify the code. Signed-off-by: Guenter Roeck <[email protected]>
2012-09-23hwmon: (vt8231) Convert to use devm_ functionsGuenter Roeck1-18/+6
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]>
2012-09-23hwmon: (sht21) Convert to use devm_ functionsGuenter Roeck1-9/+4
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]>
2012-09-23hwmon: (sht15) Convert to use devm_ functionsGuenter Roeck1-38/+20
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]>
2012-09-23hwmon: (sch5636) Convert to use devm_ functionsGuenter Roeck1-4/+2
Convert to use devm_ functions to reduce code size and simplify the code. Signed-off-by: Guenter Roeck <[email protected]>