mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 04:53:36 +01:00
Merge cae5da0611
into 0fc810ae3a
This commit is contained in:
commit
c49d68dac8
1 changed files with 17 additions and 16 deletions
|
@ -14,26 +14,27 @@
|
||||||
* not support creation of new blocks, so we return -EIO for this case.
|
* not support creation of new blocks, so we return -EIO for this case.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
adfs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh,
|
adfs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh, int create) {
|
||||||
int create)
|
// If create is false, check if the block number is valid
|
||||||
{
|
if (!create) {
|
||||||
if (!create) {
|
if (block >= inode->i_blocks)
|
||||||
if (block >= inode->i_blocks)
|
return -EFBIG; // The block number is too large, invalid.
|
||||||
goto abort_toobig;
|
|
||||||
|
|
||||||
block = __adfs_block_map(inode->i_sb, ADFS_I(inode)->indaddr,
|
// Map the block using the ADFS block mapping function
|
||||||
block);
|
block = __adfs_block_map(inode->i_sb, ADFS_I(inode)->indaddr, block);
|
||||||
if (block)
|
if (!block)
|
||||||
map_bh(bh, inode->i_sb, block);
|
return -EIO; // Error in block mapping.
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
/* don't support allocation of blocks yet */
|
|
||||||
return -EIO;
|
|
||||||
|
|
||||||
abort_toobig:
|
// Map the buffer head to the block
|
||||||
return 0;
|
map_bh(bh, inode->i_sb, block);
|
||||||
|
return 0; // Success.
|
||||||
|
}
|
||||||
|
|
||||||
|
// Block allocation is not yet supported.
|
||||||
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int adfs_writepages(struct address_space *mapping,
|
static int adfs_writepages(struct address_space *mapping,
|
||||||
struct writeback_control *wbc)
|
struct writeback_control *wbc)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue