aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-03-13DAC960: remove sleep_on usageArnd Bergmann1-18/+16
sleep_on and its variants are going away. The use of sleep_on() in DAC960_V2_ExecuteUserCommand seems to be bogus because the command by the time we get there, the command has completed already and we just enter the timeout. Based on this interpretation, I concluded that we can replace it with a simple msleep(1000) and rearrange the code around it slightly. The interruptible_sleep_on_timeout in DAC960_gam_ioctl seems equivalent to the race-free version using wait_event_interruptible_timeout. I left the driver to return -EINTR rather than -ERESTARTSYS to preserve the timeout behavior. Signed-off-by: Arnd Bergmann <[email protected]> Cc: Jens Axboe <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2014-03-13mtip32xx: Use pci_enable_msi() instead of pci_enable_msi_range()Alexander Gordeev1-2/+2
Commit "mtip32xx: Use pci_enable_msix_range() instead of pci_enable_msix()" was unnecessary, since pci_enable_msi() function is not deprecated and is still preferable for enabling the single MSI mode. This update reverts usage of pci_enable_msi() function. Besides, the changelog for that commit was bogus, since mtip32xx driver uses MSI interrupt, not MSI-X. Cc: Jens Axboe <[email protected]> Cc: Asai Thambi S P <[email protected]> Cc: [email protected] Signed-off-by: Jens Axboe <[email protected]>
2014-02-21skd: Use pci_enable_msix_range() instead of pci_enable_msix()Alexander Gordeev1-26/+12
As result of deprecation of MSI-X/MSI enablement functions pci_enable_msix() and pci_enable_msi_block() all drivers using these two interfaces need to be updated to use the new pci_enable_msi_range() and pci_enable_msix_range() interfaces. Signed-off-by: Alexander Gordeev <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: [email protected] Signed-off-by: Jens Axboe <[email protected]>
2014-02-21skd: Use unified access to skdev->msix_entries throughout the codeAlexander Gordeev1-2/+1
Signed-off-by: Alexander Gordeev <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: [email protected] Signed-off-by: Jens Axboe <[email protected]>
2014-02-21skd: Fix incomplete cleanup of MSI-X interruptAlexander Gordeev1-24/+26
When enabling MSI-X interrupts fails due to lack of memory the call to pci_disable_msix() is missed and the device is left with MSI-X interrupts enabled while the driver assumes otherwise. This update fixes the described misbehaviour and cleans up the code of skd_release_msix() function. Signed-off-by: Alexander Gordeev <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: [email protected] Signed-off-by: Jens Axboe <[email protected]>
2014-02-21skd: Fix out of array boundary accessAlexander Gordeev1-1/+1
When enabling MSI-X, interrupts are requested for SKD_MAX_MSIX_COUNT entries in skdev->msix_entries array, while the number of actually allocated entries is skdev->msix_count. This might lead to an out of boundary access in case number of allocated entries is less than SKD_MAX_MSIX_COUNT. This update fixes the described misbehaviour. Signed-off-by: Alexander Gordeev <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Bartlomiej Zolnierkiewicz <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: [email protected] Signed-off-by: Jens Axboe <[email protected]>
2014-02-21mtip32xx: Use pci_enable_msix_range() instead of pci_enable_msix()Alexander Gordeev1-2/+2
As result of deprecation of MSI-X/MSI enablement functions pci_enable_msix() and pci_enable_msi_block() all drivers using these two interfaces need to be updated to use the new pci_enable_msi_range() and pci_enable_msix_range() interfaces. Signed-off-by: Alexander Gordeev <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Asai Thambi S P <[email protected]> Cc: [email protected] Signed-off-by: Jens Axboe <[email protected]>
2014-02-21mtip32xx: Remove superfluous call to pci_disable_msi()Alexander Gordeev1-1/+3
There is no need to call pci_disable_msi() in case the previous call to pci_enable_msi() failed Signed-off-by: Alexander Gordeev <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Asai Thambi S P <[email protected]> Cc: [email protected] Signed-off-by: Jens Axboe <[email protected]>
2014-02-21drbd: Fix future possible NULL pointer dereferenceAndreas Gruenbacher1-1/+1
Right now every resource has exactly one connection. But we are preparing for dynamic connections. I.e. in the future thre can be resources without connections. However smatch points this out as 'variable dereferenced before check', which is correct. This issue was introduced in drbd: get_one_status(): Iterate over resource->devices instead of connection->peer_devices Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
2014-02-17drbd: Add drbd_thread->resource and make drbd_thread->connection optionalAndreas Gruenbacher2-19/+31
In the drbd_thread "infrastructure" functions, only use the resource instead of the connection. Make the connection field of drbd_thread optional. This will allow to introduce threads which are not associated with a connection. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Use the right peer deviceAndreas Gruenbacher1-31/+38
in w_e_ (peer request) callbacks and in peer request I/O completion handlers Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Remove unused parameter of wire_flags_to_bio()Andreas Gruenbacher1-2/+2
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Get rid of first_peer_device() in handle_write_conflicts()Andreas Gruenbacher1-5/+3
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: In the worker thread, process drbd_work instead of drbd_device_work itemsAndreas Gruenbacher1-7/+7
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Turn w_make_ov_request and make_resync_request into "normal" functionsAndreas Gruenbacher1-9/+6
These functions are not used as drbd_work callbacks. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Make w_make_resync_request() staticAndreas Gruenbacher2-3/+2
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: struct drbd_peer_request: Use drbd_work instead of drbd_device_workAndreas Gruenbacher3-75/+69
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: struct after_conn_state_chg_work: Use drbd_work instead of ↵Andreas Gruenbacher1-4/+4
drbd_device_work Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Turn conn_flush_workqueue() into drbd_flush_workqueue()Andreas Gruenbacher4-35/+33
The new function can flush any work queue, not just the work queue of the data socket of a connection. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Create a dedicated struct drbd_device_workAndreas Gruenbacher8-164/+197
drbd_device_work is a work item that has a reference to a device, while drbd_work is a more generic work item that does not carry a reference to a device. All callbacks get a pointer to a drbd_work instance, those callbacks that expect a drbd_device_work use the container_of macro to get it. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Rename w_prev_work_done -> w_completeAndreas Gruenbacher3-10/+9
Also move it to drbd_receiver.c and make it static. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Move string function prototypes from linux/drbd.h to drbd_string.hAndreas Gruenbacher4-6/+11
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Remove useless assertionAndreas Gruenbacher1-3/+1
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Kill drbd_task_to_thread_name()Andreas Gruenbacher3-28/+11
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Pass a peer device to a number of fuctionsAndreas Gruenbacher6-314/+353
These functions actually operate on a peer device, or need a peer device. drbd_prepare_command(), drbd_send_command(), drbd_send_sync_param() drbd_send_uuids(), drbd_gen_and_send_sync_uuid(), drbd_send_sizes() drbd_send_state(), drbd_send_current_state(), and drbd_send_state_req() drbd_send_sr_reply(), drbd_send_ack(), drbd_send_drequest(), drbd_send_drequest_csum(), drbd_send_ov_request(), drbd_send_dblock() drbd_send_block(), drbd_send_out_of_sync(), recv_dless_read() drbd_drain_block(), receive_bitmap_plain(), recv_resync_read() read_in_block(), read_for_csum(), drbd_alloc_pages(), drbd_alloc_peer_req() need_peer_seq(), update_peer_seq(), wait_for_and_update_peer_seq() drbd_sync_handshake(), drbd_asb_recover_{0,1,2}p(), drbd_connected() drbd_disconnected(), decode_bitmap_c() and recv_bm_rle_bits() Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Replace vnr_to_mdev() with conn_peer_device()Andreas Gruenbacher2-73/+109
The new function returns a peer device, which allows us to eliminate a few instances of first_peer_device(). Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: drbd_csum_bio(), drbd_csum_ee(): Remove unused device argumentAndreas Gruenbacher4-15/+13
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Function prototype cleanupsAndreas Gruenbacher2-4/+2
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Rename drbdd_init() -> drbd_receiver()Andreas Gruenbacher3-3/+4
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Move cpu_mask from connection to resourceAndreas Gruenbacher2-32/+47
Also fix drbd_calc_cpu_mask() to spread resources equally over all online cpus independent of device minor numbers. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Define the size of res_opts->cpu_mask in a single placeAndreas Gruenbacher3-3/+4
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Move susp, susp_nod, susp_fen from connection to resourceAndreas Gruenbacher4-19/+21
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Move conf_mutex from connection to resourceAndreas Gruenbacher8-161/+160
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: drbd_adm_prepare(): Only set adm_ctx.connection when a connection is ↵Andreas Gruenbacher1-6/+2
requested Also change drbd_adm_connect() to expect a resource after it requested one. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Iterate over all connectionsAndreas Gruenbacher2-53/+70
in drbd_adm_down(), drbd_create_device() and drbd_set_role() Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Rename net_conf variables old_conf -> old_net_conf and new_conf -> ↵Andreas Gruenbacher1-46/+46
new_net_conf Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: drbd_create_device(): Take a resource instead of a connection argumentAndreas Gruenbacher3-4/+4
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: drbd_adm_new_resource(): Check if resource exists, not if it has any ↵Andreas Gruenbacher1-1/+1
connections Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: get_one_status(): Iterate over resource->devices instead of ↵Andreas Gruenbacher1-26/+46
connection->peer_devices Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Rename drbd_{create,delete}_minor -> drbd_{create,delete}_deviceAndreas Gruenbacher3-7/+7
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Add explicit device parameter to D_ASSERTAndreas Gruenbacher9-107/+109
The implicit dependency on a variable inside the macro is problematic. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Replace and remove the obsolete conn_() macrosAndreas Gruenbacher6-109/+99
With the polymorphic drbd_() macros, we no longer need the connection specific variants. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Turn drbd_printk() into a polymorphic macroAndreas Gruenbacher1-15/+43
This allows drbd_alert(), drbd_err(), drbd_warn(), and drbd_info() to work for a resource, device, or connection so that we don't have to introduce three separate sets of macros for that. The drbd_printk() macro itself is pretty ugly, but that problem is limited to one place in the code. Using drbd_printk() on an object type which it doesn't understand results in an undefined drbd_printk_with_wrong_object_type symbol. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Remove the terrible DEV hackAndreas Gruenbacher9-283/+298
DRBD was using dev_err() and similar all over the code; instead of having to write dev_err(disk_to_dev(device->vdisk), ...) to convert a drbd_device into a kernel device, a DEV macro was used which implicitly references the device variable. This is terrible; introduce separate drbd_err() and similar macros with an explicit device parameter instead. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Turn connection->volumes into connection->peer_devicesAndreas Gruenbacher6-92/+136
Let connection->peer_devices point to peer devices; connection->volumes was pointing to devices. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Move resource options from connection to resourceAndreas Gruenbacher4-22/+25
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: conn_try_disconnect(): Use parameter instead of the global variableAndreas Gruenbacher1-1/+1
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Replace conn_get_by_name() with drbd_find_resource()Andreas Gruenbacher3-20/+30
So far, connections and resources always come in pairs, but in the future with multiple connections per resource, the names will stick with the resources. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Add struct drbd_resource->devicesAndreas Gruenbacher3-20/+51
This allows to access the volumes of a resource by number. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>
2014-02-17drbd: Minor cleanup in conn_new_minor()Andreas Gruenbacher1-10/+9
Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Philipp Reisner <[email protected]>