Initialization of Linux-initiated SCSI and ATA

Source: Internet
Author: User

static int __init init_scsi (void)
{
int error;

Error = Scsi_init_queue ();
if (Error)
return error;
Error = SCSI_INIT_PROCFS ();
if (Error)
Goto Cleanup_queue;
Error = Scsi_init_devinfo ();
if (Error)
Goto CLEANUP_PROCFS;
Error = Scsi_init_hosts ();
if (Error)
Goto Cleanup_devlist;
Error = Scsi_init_sysctl ();
if (Error)
Goto cleanup_hosts;
Error = Scsi_sysfs_register ();
if (Error)
Goto Cleanup_sysctl;

Scsi_netlink_init ();

PRINTK (Kern_notice "SCSI Subsystem initialized\n");
return 0;

Cleanup_sysctl:
Scsi_exit_sysctl ();
Cleanup_hosts:
Scsi_exit_hosts ();
Cleanup_devlist:
Scsi_exit_devinfo ();
CLEANUP_PROCFS:
Scsi_exit_procfs ();
Cleanup_queue:
Scsi_exit_queue ();
PRINTK (kern_err "SCSI subsystem failed to initialize, error =%d\n",
-ERROR);
return error;
}


[0.260628] SCSI subsystem initialized
[0.260660] libata version 3.00 loaded.


Ata/libata-core.c

static int __init ata_init (void)

{
int RC;

Ata_parse_force_param ();

rc = Ata_sff_init ();
if (RC) {
Kfree (ATA_FORCE_TBL);
return RC;
}

Libata_transport_init ();
Ata_scsi_transport_template = Ata_attach_transport ();
if (!ata_scsi_transport_template) {
Ata_sff_exit ();
rc =-enomem;
Goto Err_out;
}

PRINTK (Kern_debug "libata version" Drv_version "loaded.\n");
return 0;

Err_out:
return RC;
}

Initialization of Linux-initiated SCSI and ATA

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.