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
Kirill Smelkov
linux
Commits
345c6010
Commit
345c6010
authored
Nov 10, 2002
by
Alexander Viro
Committed by
Andy Grover
Nov 10, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] dm_ioctl() fix
Compile fixes, cleanup.
parent
eecdce9c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
15 deletions
+10
-15
drivers/md/dm-ioctl.c
drivers/md/dm-ioctl.c
+7
-6
drivers/md/dm.c
drivers/md/dm.c
+2
-8
drivers/md/dm.h
drivers/md/dm.h
+1
-1
No files found.
drivers/md/dm-ioctl.c
View file @
345c6010
...
@@ -176,10 +176,10 @@ static void free_cell(struct hash_cell *hc)
...
@@ -176,10 +176,10 @@ static void free_cell(struct hash_cell *hc)
*/
*/
static
int
register_with_devfs
(
struct
hash_cell
*
hc
)
static
int
register_with_devfs
(
struct
hash_cell
*
hc
)
{
{
kdev_t
dev
=
dm_kdev
(
hc
->
md
);
struct
gendisk
*
disk
=
dm_disk
(
hc
->
md
);
hc
->
devfs_entry
=
hc
->
devfs_entry
=
devfs_register
(
_dev_dir
,
hc
->
name
,
DEVFS_FL_CURRENT_OWNER
,
devfs_register
(
_dev_dir
,
hc
->
name
,
DEVFS_FL_CURRENT_OWNER
,
major
(
dev
),
minor
(
dev
)
,
disk
->
major
,
disk
->
first_minor
,
S_IFBLK
|
S_IRUSR
|
S_IWUSR
|
S_IRGRP
,
S_IFBLK
|
S_IRUSR
|
S_IWUSR
|
S_IRGRP
,
&
dm_blk_dops
,
NULL
);
&
dm_blk_dops
,
NULL
);
...
@@ -448,17 +448,18 @@ static int __info(struct mapped_device *md, struct dm_ioctl *param)
...
@@ -448,17 +448,18 @@ static int __info(struct mapped_device *md, struct dm_ioctl *param)
{
{
struct
dm_table
*
table
;
struct
dm_table
*
table
;
struct
block_device
*
bdev
;
struct
block_device
*
bdev
;
struct
gendisk
*
disk
=
dm_disk
(
md
);
param
->
flags
=
DM_EXISTS_FLAG
;
param
->
flags
=
DM_EXISTS_FLAG
;
if
(
dm_suspended
(
md
))
if
(
dm_suspended
(
md
))
param
->
flags
|=
DM_SUSPEND_FLAG
;
param
->
flags
|=
DM_SUSPEND_FLAG
;
param
->
dev
=
kdev_t_to_nr
(
dm_kdev
(
md
)
);
param
->
dev
=
MKDEV
(
disk
->
major
,
disk
->
first_minor
);
bdev
=
bdget
(
param
->
dev
);
bdev
=
bdget
(
param
->
dev
);
if
(
!
bdev
)
if
(
!
bdev
)
return
-
ENXIO
;
return
-
ENXIO
;
if
(
bdev_read_only
(
bdev
)
)
if
(
disk
->
policy
)
param
->
flags
|=
DM_READONLY_FLAG
;
param
->
flags
|=
DM_READONLY_FLAG
;
param
->
open_count
=
bdev
->
bd_openers
;
param
->
open_count
=
bdev
->
bd_openers
;
...
@@ -585,7 +586,7 @@ static int create(struct dm_ioctl *param, struct dm_ioctl *user)
...
@@ -585,7 +586,7 @@ static int create(struct dm_ioctl *param, struct dm_ioctl *user)
}
}
dm_table_put
(
t
);
/* md will have grabbed its own reference */
dm_table_put
(
t
);
/* md will have grabbed its own reference */
set_d
evice_ro
(
dm_kdev
(
md
),
(
param
->
flags
&
DM_READONLY_FLAG
));
set_d
isk_ro
(
dm_disk
(
md
),
(
param
->
flags
&
DM_READONLY_FLAG
));
r
=
dm_hash_insert
(
param
->
name
,
*
param
->
uuid
?
param
->
uuid
:
NULL
,
md
);
r
=
dm_hash_insert
(
param
->
name
,
*
param
->
uuid
?
param
->
uuid
:
NULL
,
md
);
dm_put
(
md
);
dm_put
(
md
);
...
@@ -871,7 +872,7 @@ static int reload(struct dm_ioctl *param, struct dm_ioctl *user)
...
@@ -871,7 +872,7 @@ static int reload(struct dm_ioctl *param, struct dm_ioctl *user)
return
r
;
return
r
;
}
}
set_d
evice_ro
(
dm_kdev
(
md
),
(
param
->
flags
&
DM_READONLY_FLAG
));
set_d
isk_ro
(
dm_disk
(
md
),
(
param
->
flags
&
DM_READONLY_FLAG
));
dm_put
(
md
);
dm_put
(
md
);
r
=
info
(
param
,
user
);
r
=
info
(
param
,
user
);
...
...
drivers/md/dm.c
View file @
345c6010
...
@@ -749,15 +749,9 @@ int dm_resume(struct mapped_device *md)
...
@@ -749,15 +749,9 @@ int dm_resume(struct mapped_device *md)
return
0
;
return
0
;
}
}
kdev_t
dm_kdev
(
struct
mapped_device
*
md
)
struct
gendisk
*
dm_disk
(
struct
mapped_device
*
md
)
{
{
kdev_t
dev
;
return
md
->
disk
;
down_read
(
&
md
->
lock
);
dev
=
md
->
kdev
;
up_read
(
&
md
->
lock
);
return
dev
;
}
}
struct
dm_table
*
dm_get_table
(
struct
mapped_device
*
md
)
struct
dm_table
*
dm_get_table
(
struct
mapped_device
*
md
)
...
...
drivers/md/dm.h
View file @
345c6010
...
@@ -77,7 +77,7 @@ struct dm_table *dm_get_table(struct mapped_device *md);
...
@@ -77,7 +77,7 @@ struct dm_table *dm_get_table(struct mapped_device *md);
/*
/*
* Info functions.
* Info functions.
*/
*/
kdev_t
dm_kdev
(
struct
mapped_device
*
md
);
struct
gendisk
*
dm_disk
(
struct
mapped_device
*
md
);
int
dm_suspended
(
struct
mapped_device
*
md
);
int
dm_suspended
(
struct
mapped_device
*
md
);
/*-----------------------------------------------------------------
/*-----------------------------------------------------------------
...
...
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