]> err.no Git - linux-2.6/blobdiff - drivers/scsi/megaraid/megaraid_sas.c
JFS: Fix regression. fsck complains if symlinks do not have INLINEEA attribute
[linux-2.6] / drivers / scsi / megaraid / megaraid_sas.c
index c3f63739573479d37707f7c20aa63c56603ababd..511ed52a580747be705be11e3f1d9dce325af7c8 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/types.h>
 #include <linux/pci.h>
 #include <linux/list.h>
-#include <linux/version.h>
 #include <linux/moduleparam.h>
 #include <linux/module.h>
 #include <linux/spinlock.h>
@@ -36,6 +35,7 @@
 #include <asm/uaccess.h>
 #include <linux/fs.h>
 #include <linux/compat.h>
+#include <linux/mutex.h>
 
 #include <scsi/scsi.h>
 #include <scsi/scsi_cmnd.h>
@@ -73,7 +73,7 @@ MODULE_DEVICE_TABLE(pci, megasas_pci_table);
 static int megasas_mgmt_majorno;
 static struct megasas_mgmt_info megasas_mgmt_info;
 static struct fasync_struct *megasas_async_queue;
-static DECLARE_MUTEX(megasas_async_queue_mutex);
+static DEFINE_MUTEX(megasas_async_queue_mutex);
 
 /**
  * megasas_get_cmd -   Get a command from the free pool
@@ -81,7 +81,7 @@ static DECLARE_MUTEX(megasas_async_queue_mutex);
  *
  * Returns a free command from the pool
  */
-static inline struct megasas_cmd *megasas_get_cmd(struct megasas_instance
+static struct megasas_cmd *megasas_get_cmd(struct megasas_instance
                                                  *instance)
 {
        unsigned long flags;
@@ -263,7 +263,7 @@ megasas_issue_blocked_abort_cmd(struct megasas_instance *instance,
  * If successful, this function returns the number of SG elements. Otherwise,
  * it returnes -1.
  */
-static inline int
+static int
 megasas_make_sgl32(struct megasas_instance *instance, struct scsi_cmnd *scp,
                   union megasas_sgl *mfi_sgl)
 {
@@ -311,7 +311,7 @@ megasas_make_sgl32(struct megasas_instance *instance, struct scsi_cmnd *scp,
  * If successful, this function returns the number of SG elements. Otherwise,
  * it returnes -1.
  */
-static inline int
+static int
 megasas_make_sgl64(struct megasas_instance *instance, struct scsi_cmnd *scp,
                   union megasas_sgl *mfi_sgl)
 {
@@ -360,7 +360,7 @@ megasas_make_sgl64(struct megasas_instance *instance, struct scsi_cmnd *scp,
  * This function prepares CDB commands. These are typcially pass-through
  * commands to the devices.
  */
-static inline int
+static int
 megasas_build_dcdb(struct megasas_instance *instance, struct scsi_cmnd *scp,
                   struct megasas_cmd *cmd)
 {
@@ -441,7 +441,7 @@ megasas_build_dcdb(struct megasas_instance *instance, struct scsi_cmnd *scp,
  *
  * Frames (and accompanying SGLs) for regular SCSI IOs use this function.
  */
-static inline int
+static int
 megasas_build_ldio(struct megasas_instance *instance, struct scsi_cmnd *scp,
                   struct megasas_cmd *cmd)
 {
@@ -563,7 +563,7 @@ megasas_build_ldio(struct megasas_instance *instance, struct scsi_cmnd *scp,
  * @scp:               SCSI command
  * @frame_count:       [OUT] Number of frames used to prepare this command
  */
-static inline struct megasas_cmd *megasas_build_cmd(struct megasas_instance
+static struct megasas_cmd *megasas_build_cmd(struct megasas_instance
                                                    *instance,
                                                    struct scsi_cmnd *scp,
                                                    int *frame_count)
@@ -758,9 +758,8 @@ static int megasas_generic_reset(struct scsi_cmnd *scmd)
 
        instance = (struct megasas_instance *)scmd->device->host->hostdata;
 
-       printk(KERN_NOTICE "megasas: RESET -%ld cmd=%x <c=%d t=%d l=%d>\n",
-              scmd->serial_number, scmd->cmnd[0], scmd->device->channel,
-              scmd->device->id, scmd->device->lun);
+       scmd_printk(KERN_NOTICE, scmd, "megasas: RESET -%ld cmd=%x\n",
+              scmd->serial_number, scmd->cmnd[0]);
 
        if (instance->hw_crit_error) {
                printk(KERN_ERR "megasas: cannot recover from previous reset "
@@ -768,17 +767,12 @@ static int megasas_generic_reset(struct scsi_cmnd *scmd)
                return FAILED;
        }
 
-       spin_unlock(scmd->device->host->host_lock);
-
        ret_val = megasas_wait_for_outstanding(instance);
-
        if (ret_val == SUCCESS)
                printk(KERN_NOTICE "megasas: reset successful \n");
        else
                printk(KERN_ERR "megasas: failed to do reset\n");
 
-       spin_lock(scmd->device->host->host_lock);
-
        return ret_val;
 }
 
@@ -920,7 +914,7 @@ megasas_complete_abort(struct megasas_instance *instance,
  * @instance:                  Adapter soft state
  * @cmd:                       Completed command
  */
-static inline void
+static void
 megasas_unmap_sgbuf(struct megasas_instance *instance, struct megasas_cmd *cmd)
 {
        dma_addr_t buf_h;
@@ -964,7 +958,7 @@ megasas_unmap_sgbuf(struct megasas_instance *instance, struct megasas_cmd *cmd)
  *                             an alternate status (as in the case of aborted
  *                             commands)
  */
-static inline void
+static void
 megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
                     u8 alt_status)
 {
@@ -1111,7 +1105,7 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
  *                                     SCSI mid-layer instead of the status
  *                                     returned by the FW
  */
-static inline int
+static int
 megasas_deplete_reply_queue(struct megasas_instance *instance, u8 alt_status)
 {
        u32 status;
@@ -2369,11 +2363,11 @@ static int megasas_mgmt_fasync(int fd, struct file *filep, int mode)
 {
        int rc;
 
-       down(&megasas_async_queue_mutex);
+       mutex_lock(&megasas_async_queue_mutex);
 
        rc = fasync_helper(fd, filep, mode, &megasas_async_queue);
 
-       up(&megasas_async_queue_mutex);
+       mutex_unlock(&megasas_async_queue_mutex);
 
        if (rc >= 0) {
                /* For sanity check when we get ioctl */