Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
f1c5d5cd
Commit
f1c5d5cd
authored
Nov 05, 2002
by
James Bottomley
Browse files
Options
Browse Files
Download
Plain Diff
Merge mulgrave.(none):/home/jejb/BK/scsi-misc-2.5
into mulgrave.(none):/home/jejb/BK/scsi-for-linus-2.5
parents
0f09a4e3
d1819213
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
52 deletions
+13
-52
drivers/scsi/sg.c
drivers/scsi/sg.c
+13
-52
No files found.
drivers/scsi/sg.c
View file @
f1c5d5cd
...
...
@@ -110,7 +110,6 @@ static int sg_allow_dio = SG_ALLOW_DIO_DEF;
#define SG_DEV_ARR_LUMP 6
/* amount to over allocate sg_dev_arr by */
static
int
sg_init
(
void
);
static
int
sg_attach
(
Scsi_Device
*
);
static
int
sg_detect
(
Scsi_Device
*
);
static
void
sg_detach
(
Scsi_Device
*
);
...
...
@@ -126,7 +125,6 @@ static struct Scsi_Device_Template sg_template = {
.
tag
=
"sg"
,
.
scsi_type
=
0xff
,
.
detect
=
sg_detect
,
.
init
=
sg_init
,
.
attach
=
sg_attach
,
.
detach
=
sg_detach
};
...
...
@@ -1344,55 +1342,6 @@ sg_detect(Scsi_Device * scsidp)
return
1
;
}
/* Driver initialization */
static
int
sg_init
()
{
static
int
sg_registered
=
0
;
unsigned
long
iflags
;
int
tmp_dev_max
;
Sg_device
**
tmp_da
;
if
((
sg_template
.
dev_noticed
==
0
)
||
sg_dev_arr
)
return
0
;
SCSI_LOG_TIMEOUT
(
3
,
printk
(
"sg_init
\n
"
));
write_lock_irqsave
(
&
sg_dev_arr_lock
,
iflags
);
tmp_dev_max
=
sg_template
.
dev_noticed
+
SG_DEV_ARR_LUMP
;
write_unlock_irqrestore
(
&
sg_dev_arr_lock
,
iflags
);
tmp_da
=
(
Sg_device
**
)
vmalloc
(
tmp_dev_max
*
sizeof
(
Sg_device
*
));
if
(
NULL
==
tmp_da
)
{
printk
(
KERN_ERR
"sg_init: no space for sg_dev_arr
\n
"
);
return
1
;
}
write_lock_irqsave
(
&
sg_dev_arr_lock
,
iflags
);
if
(
!
sg_registered
)
{
if
(
register_chrdev
(
SCSI_GENERIC_MAJOR
,
"sg"
,
&
sg_fops
))
{
printk
(
KERN_ERR
"Unable to get major %d for generic SCSI device
\n
"
,
SCSI_GENERIC_MAJOR
);
write_unlock_irqrestore
(
&
sg_dev_arr_lock
,
iflags
);
vfree
((
char
*
)
tmp_da
);
return
1
;
}
sg_registered
++
;
}
memset
(
tmp_da
,
0
,
tmp_dev_max
*
sizeof
(
Sg_device
*
));
sg_template
.
dev_max
=
tmp_dev_max
;
sg_dev_arr
=
tmp_da
;
write_unlock_irqrestore
(
&
sg_dev_arr_lock
,
iflags
);
#ifdef CONFIG_PROC_FS
sg_proc_init
();
#endif
/* CONFIG_PROC_FS */
return
0
;
}
#ifndef MODULE
static
int
__init
sg_def_reserved_size_setup
(
char
*
str
)
...
...
@@ -1643,9 +1592,21 @@ MODULE_PARM_DESC(def_reserved_size, "size of buffer reserved for each fd");
static
int
__init
init_sg
(
void
)
{
int
rc
;
if
(
def_reserved_size
>=
0
)
sg_big_buff
=
def_reserved_size
;
return
scsi_register_device
(
&
sg_template
);
rc
=
register_chrdev
(
SCSI_GENERIC_MAJOR
,
"sg"
,
&
sg_fops
);
if
(
rc
)
return
rc
;
rc
=
scsi_register_device
(
&
sg_template
);
if
(
rc
)
return
rc
;
#ifdef CONFIG_PROC_FS
sg_proc_init
();
#endif
/* CONFIG_PROC_FS */
return
0
;
}
static
void
__exit
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment