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
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)
*/
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
=
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
,
&
dm_blk_dops
,
NULL
);
...
...
@@ -448,17 +448,18 @@ static int __info(struct mapped_device *md, struct dm_ioctl *param)
{
struct
dm_table
*
table
;
struct
block_device
*
bdev
;
struct
gendisk
*
disk
=
dm_disk
(
md
);
param
->
flags
=
DM_EXISTS_FLAG
;
if
(
dm_suspended
(
md
))
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
);
if
(
!
bdev
)
return
-
ENXIO
;
if
(
bdev_read_only
(
bdev
)
)
if
(
disk
->
policy
)
param
->
flags
|=
DM_READONLY_FLAG
;
param
->
open_count
=
bdev
->
bd_openers
;
...
...
@@ -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 */
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
);
dm_put
(
md
);
...
...
@@ -871,7 +872,7 @@ static int reload(struct dm_ioctl *param, struct dm_ioctl *user)
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
);
r
=
info
(
param
,
user
);
...
...
drivers/md/dm.c
View file @
345c6010
...
...
@@ -749,15 +749,9 @@ int dm_resume(struct mapped_device *md)
return
0
;
}
kdev_t
dm_kdev
(
struct
mapped_device
*
md
)
struct
gendisk
*
dm_disk
(
struct
mapped_device
*
md
)
{
kdev_t
dev
;
down_read
(
&
md
->
lock
);
dev
=
md
->
kdev
;
up_read
(
&
md
->
lock
);
return
dev
;
return
md
->
disk
;
}
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);
/*
* 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
);
/*-----------------------------------------------------------------
...
...
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