* LOCKING:
* Kernel thread context (may sleep).
*/
-void ata_scsi_dev_rescan(void *data)
+void ata_scsi_dev_rescan(struct work_struct *work)
{
- struct ata_port *ap = data;
+ struct ata_port *ap =
+ container_of(work, struct ata_port, scsi_rescan_task);
- struct ata_device *dev;
+ unsigned long flags;
unsigned int i;
+ spin_lock_irqsave(ap->lock, flags);
+
for (i = 0; i < ATA_MAX_DEVICES; i++) {
- dev = &ap->device[i];
+ struct ata_device *dev = &ap->device[i];
+ struct scsi_device *sdev = dev->sdev;
- if (ata_dev_enabled(dev) && dev->sdev)
- scsi_rescan_device(&(dev->sdev->sdev_gendev));
+ if (!ata_dev_enabled(dev) || !sdev)
+ continue;
+ if (scsi_device_get(sdev))
+ continue;
+
+ spin_unlock_irqrestore(ap->lock, flags);
+ scsi_rescan_device(&(sdev->sdev_gendev));
+ scsi_device_put(sdev);
+ spin_lock_irqsave(ap->lock, flags);
}
+
+ spin_unlock_irqrestore(ap->lock, flags);
}
/**
spin_unlock(&trans_inc_lock);
}
- extern kmem_cache_t *ocfs2_lock_cache;
-
- struct ocfs2_journal_lock {
- struct inode *jl_inode;
- struct list_head jl_lock_list;
- };
-
- struct ocfs2_journal_handle {
- handle_t *k_handle; /* kernel handle. */
- struct ocfs2_journal *journal;
- u32 flags; /* see flags below. */
- int max_buffs; /* Buffs reserved by this handle */
-
- /* The following two fields are for ocfs2_handle_add_lock */
- int num_locks;
- struct list_head locks; /* A bunch of locks to
- * release on commit. This
- * should be a list_head */
-
- struct list_head inode_list;
- };
-
- #define OCFS2_HANDLE_STARTED 1
- /* should we sync-commit this handle? */
- #define OCFS2_HANDLE_SYNC 2
- static inline int ocfs2_handle_started(struct ocfs2_journal_handle *handle)
- {
- return handle->flags & OCFS2_HANDLE_STARTED;
- }
-
- static inline void ocfs2_handle_set_sync(struct ocfs2_journal_handle *handle, int sync)
- {
- if (sync)
- handle->flags |= OCFS2_HANDLE_SYNC;
- else
- handle->flags &= ~OCFS2_HANDLE_SYNC;
- }
-
/* Exported only for the journal struct init code in super.c. Do not call. */
-void ocfs2_complete_recovery(void *data);
+void ocfs2_complete_recovery(struct work_struct *work);
/*
* Journal Control:
extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg);
extern void ata_host_resume(struct ata_host *host);
extern int ata_ratelimit(void);
- extern unsigned int ata_busy_sleep(struct ata_port *ap,
- unsigned long timeout_pat,
- unsigned long timeout);
+ extern int ata_busy_sleep(struct ata_port *ap,
+ unsigned long timeout_pat, unsigned long timeout);
-extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *),
+extern void ata_port_queue_task(struct ata_port *ap, work_func_t fn,
void *data, unsigned long delay);
extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val,
unsigned long interval_msec,