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
ec769fb0
Commit
ec769fb0
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] (3/6) blksize_size[] removal
- switch block_size() to struct block_device *.
parent
aacb4fe3
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
19 additions
and
17 deletions
+19
-17
drivers/block/blkpg.c
drivers/block/blkpg.c
+1
-1
drivers/block/loop.c
drivers/block/loop.c
+2
-2
drivers/mtd/devices/blkmtd.c
drivers/mtd/devices/blkmtd.c
+1
-1
drivers/s390/char/tape34xx.c
drivers/s390/char/tape34xx.c
+3
-1
drivers/scsi/scsicam.c
drivers/scsi/scsicam.c
+1
-1
fs/block_dev.c
fs/block_dev.c
+5
-5
fs/partitions/check.c
fs/partitions/check.c
+1
-1
fs/partitions/efi.c
fs/partitions/efi.c
+1
-2
fs/super.c
fs/super.c
+1
-1
include/linux/blkdev.h
include/linux/blkdev.h
+2
-1
mm/swapfile.c
mm/swapfile.c
+1
-1
No files found.
drivers/block/blkpg.c
View file @
ec769fb0
...
@@ -304,7 +304,7 @@ int blk_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long arg)
...
@@ -304,7 +304,7 @@ int blk_ioctl(struct block_device *bdev, unsigned int cmd, unsigned long arg)
case
BLKBSZGET
:
case
BLKBSZGET
:
/* get the logical block size (cf. BLKSSZGET) */
/* get the logical block size (cf. BLKSSZGET) */
intval
=
block_size
(
dev
);
intval
=
block_size
(
b
dev
);
return
put_user
(
intval
,
(
int
*
)
arg
);
return
put_user
(
intval
,
(
int
*
)
arg
);
case
BLKBSZSET
:
case
BLKBSZSET
:
...
...
drivers/block/loop.c
View file @
ec769fb0
...
@@ -284,7 +284,7 @@ static int lo_receive(struct loop_device *lo, struct bio *bio, int bsize, loff_t
...
@@ -284,7 +284,7 @@ static int lo_receive(struct loop_device *lo, struct bio *bio, int bsize, loff_t
static
inline
int
loop_get_bs
(
struct
loop_device
*
lo
)
static
inline
int
loop_get_bs
(
struct
loop_device
*
lo
)
{
{
return
block_size
(
to_kdev_t
(
lo
->
lo_device
->
bd_dev
)
);
return
block_size
(
lo
->
lo_device
);
}
}
static
inline
unsigned
long
loop_get_iv
(
struct
loop_device
*
lo
,
static
inline
unsigned
long
loop_get_iv
(
struct
loop_device
*
lo
,
...
@@ -649,7 +649,7 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file,
...
@@ -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
;
lo
->
old_gfp_mask
=
inode
->
i_mapping
->
gfp_mask
;
inode
->
i_mapping
->
gfp_mask
=
GFP_NOIO
;
inode
->
i_mapping
->
gfp_mask
=
GFP_NOIO
;
set_blocksize
(
bdev
,
block_size
(
to_kdev_t
(
lo_device
->
bd_dev
)
));
set_blocksize
(
bdev
,
block_size
(
lo_device
));
lo
->
lo_bio
=
lo
->
lo_biotail
=
NULL
;
lo
->
lo_bio
=
lo
->
lo_biotail
=
NULL
;
kernel_thread
(
loop_thread
,
lo
,
CLONE_FS
|
CLONE_FILES
|
CLONE_SIGHAND
);
kernel_thread
(
loop_thread
,
lo
,
CLONE_FS
|
CLONE_FILES
|
CLONE_SIGHAND
);
...
...
drivers/mtd/devices/blkmtd.c
View file @
ec769fb0
...
@@ -1137,7 +1137,7 @@ static int __init init_blkmtd(void)
...
@@ -1137,7 +1137,7 @@ static int __init init_blkmtd(void)
DEBUG
(
1
,
"blkmtd: devname = %s
\n
"
,
bdevname
(
bdev
));
DEBUG
(
1
,
"blkmtd: devname = %s
\n
"
,
bdevname
(
bdev
));
blocksize
=
BLOCK_SIZE
;
blocksize
=
BLOCK_SIZE
;
blocksize
=
bs
?
bs
:
block_size
(
r
dev
);
blocksize
=
bs
?
bs
:
block_size
(
b
dev
);
i
=
blocksize
;
i
=
blocksize
;
blocksize_bits
=
0
;
blocksize_bits
=
0
;
while
(
i
!=
1
)
{
while
(
i
!=
1
)
{
...
...
drivers/s390/char/tape34xx.c
View file @
ec769fb0
...
@@ -1344,11 +1344,13 @@ ccw_req_t * tape34xx_bread (struct request *req,tape_info_t* ti,int tapeblock_ma
...
@@ -1344,11 +1344,13 @@ ccw_req_t * tape34xx_bread (struct request *req,tape_info_t* ti,int tapeblock_ma
ccw1_t
*
ccw
;
ccw1_t
*
ccw
;
__u8
*
data
;
__u8
*
data
;
kdev_t
dev
=
mk_kdev
(
tapeblock_major
,
ti
->
blk_minor
);
kdev_t
dev
=
mk_kdev
(
tapeblock_major
,
ti
->
blk_minor
);
unsigned
bsize
=
block_size
(
dev
);
struct
block_device
*
bdev
=
bdget
(
kdev_t_to_nr
(
dev
));
unsigned
bsize
=
block_size
(
bdev
);
int
s2b
=
bsize
/
queue_hardsect_size
(
&
ti
->
request_queue
);
int
s2b
=
bsize
/
queue_hardsect_size
(
&
ti
->
request_queue
);
int
realcount
;
int
realcount
;
int
size
,
bhct
=
0
;
int
size
,
bhct
=
0
;
struct
buffer_head
*
bh
;
struct
buffer_head
*
bh
;
bdput
(
bdev
);
for
(
bh
=
req
->
bh
;
bh
;
bh
=
bh
->
b_reqnext
)
{
for
(
bh
=
req
->
bh
;
bh
;
bh
=
bh
->
b_reqnext
)
{
if
(
bh
->
b_size
>
bsize
)
if
(
bh
->
b_size
>
bsize
)
for
(
size
=
0
;
size
<
bh
->
b_size
;
size
+=
bsize
)
for
(
size
=
0
;
size
<
bh
->
b_size
;
size
+=
bsize
)
...
...
drivers/scsi/scsicam.c
View file @
ec769fb0
...
@@ -41,7 +41,7 @@ unsigned char *scsi_bios_ptable(kdev_t dev)
...
@@ -41,7 +41,7 @@ unsigned char *scsi_bios_ptable(kdev_t dev)
err
=
blkdev_get
(
bdev
,
FMODE_READ
,
0
,
BDEV_FILE
);
err
=
blkdev_get
(
bdev
,
FMODE_READ
,
0
,
BDEV_FILE
);
if
(
err
)
if
(
err
)
goto
fail
;
goto
fail
;
bh
=
__bread
(
bdev
,
0
,
block_size
(
r
dev
));
bh
=
__bread
(
bdev
,
0
,
block_size
(
b
dev
));
if
(
!
bh
)
if
(
!
bh
)
goto
fail2
;
goto
fail2
;
memcpy
(
res
,
bh
->
b_data
+
0x1be
,
66
);
memcpy
(
res
,
bh
->
b_data
+
0x1be
,
66
);
...
...
fs/block_dev.c
View file @
ec769fb0
...
@@ -25,13 +25,13 @@
...
@@ -25,13 +25,13 @@
#define MAX_BUF_PER_PAGE (PAGE_CACHE_SIZE / 512)
#define MAX_BUF_PER_PAGE (PAGE_CACHE_SIZE / 512)
static
unsigned
long
max_block
(
kdev_t
dev
)
static
unsigned
long
max_block
(
struct
block_device
*
b
dev
)
{
{
unsigned
int
retval
=
~
0U
;
unsigned
int
retval
=
~
0U
;
loff_t
sz
=
b
lkdev_size_in_bytes
(
dev
)
;
loff_t
sz
=
b
dev
->
bd_inode
->
i_size
;
if
(
sz
)
{
if
(
sz
)
{
unsigned
int
size
=
block_size
(
dev
);
unsigned
int
size
=
block_size
(
b
dev
);
unsigned
int
sizebits
=
blksize_bits
(
size
);
unsigned
int
sizebits
=
blksize_bits
(
size
);
retval
=
(
sz
>>
sizebits
);
retval
=
(
sz
>>
sizebits
);
}
}
...
@@ -112,7 +112,7 @@ int sb_min_blocksize(struct super_block *sb, int size)
...
@@ -112,7 +112,7 @@ int sb_min_blocksize(struct super_block *sb, int size)
static
int
blkdev_get_block
(
struct
inode
*
inode
,
sector_t
iblock
,
struct
buffer_head
*
bh
,
int
create
)
static
int
blkdev_get_block
(
struct
inode
*
inode
,
sector_t
iblock
,
struct
buffer_head
*
bh
,
int
create
)
{
{
if
(
iblock
>=
max_block
(
inode
->
i_
r
dev
))
if
(
iblock
>=
max_block
(
inode
->
i_
b
dev
))
return
-
EIO
;
return
-
EIO
;
bh
->
b_bdev
=
inode
->
i_bdev
;
bh
->
b_bdev
=
inode
->
i_bdev
;
...
@@ -617,7 +617,7 @@ static int do_open(struct block_device *bdev, struct inode *inode, struct file *
...
@@ -617,7 +617,7 @@ static int do_open(struct block_device *bdev, struct inode *inode, struct file *
}
}
bdev
->
bd_openers
++
;
bdev
->
bd_openers
++
;
bdev
->
bd_inode
->
i_size
=
blkdev_size
(
dev
);
bdev
->
bd_inode
->
i_size
=
blkdev_size
(
dev
);
bdev
->
bd_inode
->
i_blkbits
=
blksize_bits
(
block_size
(
dev
));
bdev
->
bd_inode
->
i_blkbits
=
blksize_bits
(
block_size
(
b
dev
));
unlock_kernel
();
unlock_kernel
();
up
(
&
bdev
->
bd_sem
);
up
(
&
bdev
->
bd_sem
);
return
0
;
return
0
;
...
...
fs/partitions/check.c
View file @
ec769fb0
...
@@ -253,7 +253,7 @@ static void check_partition(struct gendisk *hd, kdev_t dev, int first_part_minor
...
@@ -253,7 +253,7 @@ static void check_partition(struct gendisk *hd, kdev_t dev, int first_part_minor
bdev
=
bdget
(
kdev_t_to_nr
(
dev
));
bdev
=
bdget
(
kdev_t_to_nr
(
dev
));
bdev
->
bd_contains
=
bdev
;
bdev
->
bd_contains
=
bdev
;
bdev
->
bd_inode
->
i_size
=
(
loff_t
)
hd
->
part
[
minor
(
dev
)].
nr_sects
<<
9
;
bdev
->
bd_inode
->
i_size
=
(
loff_t
)
hd
->
part
[
minor
(
dev
)].
nr_sects
<<
9
;
bdev
->
bd_inode
->
i_blkbits
=
blksize_bits
(
block_size
(
dev
));
bdev
->
bd_inode
->
i_blkbits
=
blksize_bits
(
block_size
(
b
dev
));
for
(
i
=
0
;
check_part
[
i
];
i
++
)
{
for
(
i
=
0
;
check_part
[
i
];
i
++
)
{
int
res
;
int
res
;
res
=
check_part
[
i
](
hd
,
bdev
,
first_sector
,
first_part_minor
);
res
=
check_part
[
i
](
hd
,
bdev
,
first_sector
,
first_part_minor
);
...
...
fs/partitions/efi.c
View file @
ec769fb0
...
@@ -713,9 +713,8 @@ efi_partition(struct gendisk *hd, struct block_device *bdev,
...
@@ -713,9 +713,8 @@ efi_partition(struct gendisk *hd, struct block_device *bdev,
unsigned
long
first_sector
,
int
first_part_minor
)
unsigned
long
first_sector
,
int
first_part_minor
)
{
{
kdev_t
dev
=
to_kdev_t
(
bdev
->
bd_dev
);
int
hardblocksize
=
bdev_hardsect_size
(
bdev
);
int
hardblocksize
=
bdev_hardsect_size
(
bdev
);
int
orig_blksize_size
=
block_size
(
dev
);
int
orig_blksize_size
=
block_size
(
b
dev
);
int
rc
=
0
;
int
rc
=
0
;
/* Need to change the block size that the block layer uses */
/* Need to change the block size that the block layer uses */
...
...
fs/super.c
View file @
ec769fb0
...
@@ -516,7 +516,7 @@ struct super_block *get_sb_bdev(struct file_system_type *fs_type,
...
@@ -516,7 +516,7 @@ struct super_block *get_sb_bdev(struct file_system_type *fs_type,
}
else
{
}
else
{
s
->
s_flags
=
flags
;
s
->
s_flags
=
flags
;
strncpy
(
s
->
s_id
,
bdevname
(
bdev
),
sizeof
(
s
->
s_id
));
strncpy
(
s
->
s_id
,
bdevname
(
bdev
),
sizeof
(
s
->
s_id
));
s
->
s_old_blocksize
=
block_size
(
dev
);
s
->
s_old_blocksize
=
block_size
(
b
dev
);
sb_set_blocksize
(
s
,
s
->
s_old_blocksize
);
sb_set_blocksize
(
s
,
s
->
s_old_blocksize
);
error
=
fill_super
(
s
,
data
,
flags
&
MS_VERBOSE
?
1
:
0
);
error
=
fill_super
(
s
,
data
,
flags
&
MS_VERBOSE
?
1
:
0
);
if
(
error
)
{
if
(
error
)
{
...
...
include/linux/blkdev.h
View file @
ec769fb0
...
@@ -372,9 +372,10 @@ extern inline unsigned int blksize_bits(unsigned int size)
...
@@ -372,9 +372,10 @@ extern inline unsigned int blksize_bits(unsigned int size)
return
bits
;
return
bits
;
}
}
extern
inline
unsigned
int
block_size
(
kdev_t
dev
)
extern
inline
unsigned
int
block_size
(
struct
block_device
*
b
dev
)
{
{
int
retval
=
BLOCK_SIZE
;
int
retval
=
BLOCK_SIZE
;
kdev_t
dev
=
to_kdev_t
(
bdev
->
bd_dev
);
int
major
=
major
(
dev
);
int
major
=
major
(
dev
);
if
(
blksize_size
[
major
])
{
if
(
blksize_size
[
major
])
{
...
...
mm/swapfile.c
View file @
ec769fb0
...
@@ -920,7 +920,7 @@ asmlinkage long sys_swapon(const char * specialfile, int swap_flags)
...
@@ -920,7 +920,7 @@ asmlinkage long sys_swapon(const char * specialfile, int swap_flags)
bdev
=
NULL
;
bdev
=
NULL
;
goto
bad_swap
;
goto
bad_swap
;
}
}
p
->
old_block_size
=
block_size
(
to_kdev_t
(
bdev
->
bd_dev
)
);
p
->
old_block_size
=
block_size
(
bdev
);
error
=
set_blocksize
(
swap_file
->
f_dentry
->
d_inode
->
i_bdev
,
error
=
set_blocksize
(
swap_file
->
f_dentry
->
d_inode
->
i_bdev
,
PAGE_SIZE
);
PAGE_SIZE
);
if
(
error
<
0
)
if
(
error
<
0
)
...
...
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