📄 sread.c
字号:
//////////////////////////////////////////////////////////////////////////////////////////
#include "general.h"
#include "hd_info_struct.h"
#include "dir_entry.h"
#include "msdos_dir_entry.h"
#include "d_inode.h"
#include "m_inode.h"
#include "buffer_head.h"
#include "fat_cache.h"
#include "file.h"
#include "hd_request_struct.h"
#include "super_block.h"
#include "common_head.h"
//////////////////////////////////////////////////////////////////////////////////////////
struct buffer_head * sread(int sector, struct msdos_dir_entry ** res_dir, unsigned char floppy_importflag)
{
struct buffer_head * temp_bh;
int temp_block;
*res_dir = NULL;
temp_block = sector / 2;
if (!(temp_bh = bread(0,temp_block,floppy_importflag)))
return NULL;
if (sector & 0x01)
*res_dir = (struct msdos_dir_entry *)(temp_bh->b_data) + 16;
else
*res_dir = (struct msdos_dir_entry *)(temp_bh->b_data);
return temp_bh;
}
void srelse(struct buffer_head * buf)
{
brelse(buf);
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -