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
aacb4fe3
Commit
aacb4fe3
authored
Apr 30, 2002
by
Alexander Viro
Committed by
Linus Torvalds
Apr 30, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] (2/6) blksize_size[] removal
- switch set_blocksize() to struct block_device *.
parent
afe7e3a9
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
13 additions
and
22 deletions
+13
-22
drivers/block/blkpg.c
drivers/block/blkpg.c
+1
-1
drivers/block/loop.c
drivers/block/loop.c
+1
-1
drivers/ide/ide-cd.c
drivers/ide/ide-cd.c
+0
-7
fs/block_dev.c
fs/block_dev.c
+3
-5
fs/ext3/super.c
fs/ext3/super.c
+1
-1
fs/partitions/efi.c
fs/partitions/efi.c
+2
-2
fs/super.c
fs/super.c
+1
-1
include/linux/fs.h
include/linux/fs.h
+1
-1
mm/swapfile.c
mm/swapfile.c
+3
-3
No files found.
drivers/block/blkpg.c
View file @
aacb4fe3
...
...
@@ -320,7 +320,7 @@ int blk_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long arg)
return
-
EINVAL
;
if
(
bd_claim
(
bdev
,
&
holder
)
<
0
)
return
-
EBUSY
;
set_blocksize
(
dev
,
intval
);
set_blocksize
(
b
dev
,
intval
);
bd_release
(
bdev
);
return
0
;
...
...
drivers/block/loop.c
View file @
aacb4fe3
...
...
@@ -649,7 +649,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
lo
->
old_gfp_mask
=
inode
->
i_mapping
->
gfp_mask
;
inode
->
i_mapping
->
gfp_mask
=
GFP_NOIO
;
set_blocksize
(
dev
,
block_size
(
to_kdev_t
(
lo_device
->
bd_dev
)));
set_blocksize
(
b
dev
,
block_size
(
to_kdev_t
(
lo_device
->
bd_dev
)));
lo
->
lo_bio
=
lo
->
lo_biotail
=
NULL
;
kernel_thread
(
loop_thread
,
lo
,
CLONE_FS
|
CLONE_FILES
|
CLONE_SIGHAND
);
...
...
drivers/ide/ide-cd.c
View file @
aacb4fe3
...
...
@@ -2677,7 +2677,6 @@ int ide_cdrom_setup(ide_drive_t *drive)
* default to read-only always and fix latter at the bottom
*/
set_device_ro
(
mk_kdev
(
drive
->
channel
->
major
,
minor
),
1
);
set_blocksize
(
mk_kdev
(
drive
->
channel
->
major
,
minor
),
CD_FRAMESIZE
);
blk_queue_hardsect_size
(
&
drive
->
queue
,
CD_FRAMESIZE
);
blk_queue_prep_rq
(
&
drive
->
queue
,
ll_10byte_cmd_build
);
...
...
@@ -2861,13 +2860,7 @@ void ide_cdrom_revalidate (ide_drive_t *drive)
/* for general /dev/cdrom like mounting, one big disc */
drive
->
part
[
0
].
nr_sects
=
toc
->
capacity
*
SECTORS_PER_FRAME
;
drive
->
channel
->
gd
->
sizes
[
minor
]
=
toc
->
capacity
*
BLOCKS_PER_FRAME
;
/*
* reset block size, ide_revalidate_disk incorrectly sets it to
* 1024 even for CDROM's
*/
blk_size
[
drive
->
channel
->
major
]
=
drive
->
channel
->
gd
->
sizes
;
set_blocksize
(
mk_kdev
(
drive
->
channel
->
major
,
minor
),
CD_FRAMESIZE
);
}
static
sector_t
ide_cdrom_capacity
(
struct
ata_device
*
drive
)
...
...
fs/block_dev.c
View file @
aacb4fe3
...
...
@@ -53,10 +53,10 @@ static void kill_bdev(struct block_device *bdev)
truncate_inode_pages
(
bdev
->
bd_inode
->
i_mapping
,
0
);
}
int
set_blocksize
(
kdev_t
dev
,
int
size
)
int
set_blocksize
(
struct
block_device
*
b
dev
,
int
size
)
{
int
oldsize
;
struct
block_device
*
bdev
;
kdev_t
dev
=
to_kdev_t
(
bdev
->
bd_dev
)
;
/* Size must be a power of two, and between 512 and PAGE_SIZE */
if
(
size
>
PAGE_SIZE
||
size
<
512
||
(
size
&
(
size
-
1
)))
...
...
@@ -83,19 +83,17 @@ int set_blocksize(kdev_t dev, int size)
}
/* Ok, we're actually changing the blocksize.. */
bdev
=
bdget
(
kdev_t_to_nr
(
dev
));
sync_blockdev
(
bdev
);
blksize_size
[
major
(
dev
)][
minor
(
dev
)]
=
size
;
bdev
->
bd_inode
->
i_blkbits
=
blksize_bits
(
size
);
kill_bdev
(
bdev
);
bdput
(
bdev
);
return
0
;
}
int
sb_set_blocksize
(
struct
super_block
*
sb
,
int
size
)
{
int
bits
;
if
(
set_blocksize
(
sb
->
s_dev
,
size
)
<
0
)
if
(
set_blocksize
(
sb
->
s_
b
dev
,
size
)
<
0
)
return
0
;
sb
->
s_blocksize
=
size
;
for
(
bits
=
9
,
size
>>=
9
;
size
>>=
1
;
bits
++
)
...
...
fs/ext3/super.c
View file @
aacb4fe3
...
...
@@ -1330,7 +1330,7 @@ static journal_t *ext3_get_dev_journal(struct super_block *sb,
sb_block
=
EXT3_MIN_BLOCK_SIZE
/
blocksize
;
offset
=
EXT3_MIN_BLOCK_SIZE
%
blocksize
;
set_blocksize
(
j_
dev
,
blocksize
);
set_blocksize
(
b
dev
,
blocksize
);
if
(
!
(
bh
=
__bread
(
bdev
,
sb_block
,
blocksize
)))
{
printk
(
KERN_ERR
"EXT3-fs: couldn't read superblock of "
"external journal
\n
"
);
...
...
fs/partitions/efi.c
View file @
aacb4fe3
...
...
@@ -721,13 +721,13 @@ efi_partition(struct gendisk *hd, struct block_device *bdev,
/* Need to change the block size that the block layer uses */
if
(
orig_blksize_size
!=
hardblocksize
)
set_blocksize
(
dev
,
hardblocksize
);
set_blocksize
(
b
dev
,
hardblocksize
);
rc
=
add_gpt_partitions
(
hd
,
bdev
,
first_part_minor
);
/* change back */
if
(
orig_blksize_size
!=
hardblocksize
)
set_blocksize
(
dev
,
orig_blksize_size
);
set_blocksize
(
b
dev
,
orig_blksize_size
);
return
rc
;
}
...
...
fs/super.c
View file @
aacb4fe3
...
...
@@ -540,7 +540,7 @@ void kill_block_super(struct super_block *sb)
{
struct
block_device
*
bdev
=
sb
->
s_bdev
;
generic_shutdown_super
(
sb
);
set_blocksize
(
to_kdev_t
(
bdev
->
bd_dev
)
,
sb
->
s_old_blocksize
);
set_blocksize
(
bdev
,
sb
->
s_old_blocksize
);
bd_release
(
bdev
);
blkdev_put
(
bdev
,
BDEV_FS
);
}
...
...
include/linux/fs.h
View file @
aacb4fe3
...
...
@@ -1259,7 +1259,7 @@ extern int submit_bh(int, struct buffer_head *);
struct
bio
;
extern
int
submit_bio
(
int
,
struct
bio
*
);
extern
int
is_read_only
(
kdev_t
);
extern
int
set_blocksize
(
kdev_t
,
int
);
extern
int
set_blocksize
(
struct
block_device
*
,
int
);
extern
int
sb_set_blocksize
(
struct
super_block
*
,
int
);
extern
int
sb_min_blocksize
(
struct
super_block
*
,
int
);
...
...
mm/swapfile.c
View file @
aacb4fe3
...
...
@@ -791,7 +791,7 @@ asmlinkage long sys_swapoff(const char * specialfile)
if
(
S_ISBLK
(
swap_file
->
f_dentry
->
d_inode
->
i_mode
))
{
struct
block_device
*
bdev
;
bdev
=
swap_file
->
f_dentry
->
d_inode
->
i_bdev
;
set_blocksize
(
to_kdev_t
(
bdev
->
bd_dev
)
,
p
->
old_block_size
);
set_blocksize
(
bdev
,
p
->
old_block_size
);
bd_release
(
bdev
);
}
filp_close
(
swap_file
,
NULL
);
...
...
@@ -921,7 +921,7 @@ asmlinkage long sys_swapon(const char * specialfile, int swap_flags)
goto
bad_swap
;
}
p
->
old_block_size
=
block_size
(
to_kdev_t
(
bdev
->
bd_dev
));
error
=
set_blocksize
(
swap_file
->
f_dentry
->
d_inode
->
i_
r
dev
,
error
=
set_blocksize
(
swap_file
->
f_dentry
->
d_inode
->
i_
b
dev
,
PAGE_SIZE
);
if
(
error
<
0
)
goto
bad_swap
;
...
...
@@ -1074,7 +1074,7 @@ asmlinkage long sys_swapon(const char * specialfile, int swap_flags)
goto
out
;
bad_swap:
if
(
bdev
)
{
set_blocksize
(
to_kdev_t
(
bdev
->
bd_dev
)
,
p
->
old_block_size
);
set_blocksize
(
bdev
,
p
->
old_block_size
);
bd_release
(
bdev
);
}
bad_swap_2:
...
...
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