befs: befs: fix style issues in datastream.c
Fixing the following checkpatch.pl errors: ERROR: "foo * bar" should be "foo *bar" + befs_blocknr_t blockno, befs_block_run * run); WARNING: Missing a blank line after declarations + struct buffer_head *bh; + befs_debug(sb, "---> %s length: %llu", __func__, len); WARNING: Block comments use * on subsequent lines + /* + Double indir block, plus all the indirect blocks it maps. (and other instances of these) Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com> Signed-off-by: Salah Triki <salah.triki@gmail.com>
This commit is contained in:
@@ -22,17 +22,17 @@ const befs_inode_addr BAD_IADDR = { 0, 0, 0 };
|
|||||||
|
|
||||||
static int befs_find_brun_direct(struct super_block *sb,
|
static int befs_find_brun_direct(struct super_block *sb,
|
||||||
const befs_data_stream *data,
|
const befs_data_stream *data,
|
||||||
befs_blocknr_t blockno, befs_block_run * run);
|
befs_blocknr_t blockno, befs_block_run *run);
|
||||||
|
|
||||||
static int befs_find_brun_indirect(struct super_block *sb,
|
static int befs_find_brun_indirect(struct super_block *sb,
|
||||||
const befs_data_stream *data,
|
const befs_data_stream *data,
|
||||||
befs_blocknr_t blockno,
|
befs_blocknr_t blockno,
|
||||||
befs_block_run * run);
|
befs_block_run *run);
|
||||||
|
|
||||||
static int befs_find_brun_dblindirect(struct super_block *sb,
|
static int befs_find_brun_dblindirect(struct super_block *sb,
|
||||||
const befs_data_stream *data,
|
const befs_data_stream *data,
|
||||||
befs_blocknr_t blockno,
|
befs_blocknr_t blockno,
|
||||||
befs_block_run * run);
|
befs_block_run *run);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* befs_read_datastream - get buffer_head containing data, starting from pos.
|
* befs_read_datastream - get buffer_head containing data, starting from pos.
|
||||||
@@ -46,7 +46,7 @@ static int befs_find_brun_dblindirect(struct super_block *sb,
|
|||||||
*/
|
*/
|
||||||
struct buffer_head *
|
struct buffer_head *
|
||||||
befs_read_datastream(struct super_block *sb, const befs_data_stream *ds,
|
befs_read_datastream(struct super_block *sb, const befs_data_stream *ds,
|
||||||
befs_off_t pos, uint * off)
|
befs_off_t pos, uint *off)
|
||||||
{
|
{
|
||||||
struct buffer_head *bh;
|
struct buffer_head *bh;
|
||||||
befs_block_run run;
|
befs_block_run run;
|
||||||
@@ -94,7 +94,7 @@ befs_read_datastream(struct super_block *sb, const befs_data_stream *ds,
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
befs_fblock2brun(struct super_block *sb, const befs_data_stream *data,
|
befs_fblock2brun(struct super_block *sb, const befs_data_stream *data,
|
||||||
befs_blocknr_t fblock, befs_block_run * run)
|
befs_blocknr_t fblock, befs_block_run *run)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
befs_off_t pos = fblock << BEFS_SB(sb)->block_shift;
|
befs_off_t pos = fblock << BEFS_SB(sb)->block_shift;
|
||||||
@@ -134,6 +134,7 @@ befs_read_lsymlink(struct super_block *sb, const befs_data_stream *ds,
|
|||||||
befs_off_t bytes_read = 0; /* bytes readed */
|
befs_off_t bytes_read = 0; /* bytes readed */
|
||||||
u16 plen;
|
u16 plen;
|
||||||
struct buffer_head *bh;
|
struct buffer_head *bh;
|
||||||
|
|
||||||
befs_debug(sb, "---> %s length: %llu", __func__, len);
|
befs_debug(sb, "---> %s length: %llu", __func__, len);
|
||||||
|
|
||||||
while (bytes_read < len) {
|
while (bytes_read < len) {
|
||||||
@@ -189,13 +190,13 @@ befs_count_blocks(struct super_block *sb, const befs_data_stream *ds)
|
|||||||
metablocks += ds->indirect.len;
|
metablocks += ds->indirect.len;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Double indir block, plus all the indirect blocks it maps.
|
* Double indir block, plus all the indirect blocks it maps.
|
||||||
In the double-indirect range, all block runs of data are
|
* In the double-indirect range, all block runs of data are
|
||||||
BEFS_DBLINDIR_BRUN_LEN blocks long. Therefore, we know
|
* BEFS_DBLINDIR_BRUN_LEN blocks long. Therefore, we know
|
||||||
how many data block runs are in the double-indirect region,
|
* how many data block runs are in the double-indirect region,
|
||||||
and from that we know how many indirect blocks it takes to
|
* and from that we know how many indirect blocks it takes to
|
||||||
map them. We assume that the indirect blocks are also
|
* map them. We assume that the indirect blocks are also
|
||||||
BEFS_DBLINDIR_BRUN_LEN blocks long.
|
* BEFS_DBLINDIR_BRUN_LEN blocks long.
|
||||||
*/
|
*/
|
||||||
if (ds->size > ds->max_indirect_range && ds->max_indirect_range != 0) {
|
if (ds->size > ds->max_indirect_range && ds->max_indirect_range != 0) {
|
||||||
uint dbl_bytes;
|
uint dbl_bytes;
|
||||||
@@ -249,7 +250,7 @@ befs_count_blocks(struct super_block *sb, const befs_data_stream *ds)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
befs_find_brun_direct(struct super_block *sb, const befs_data_stream *data,
|
befs_find_brun_direct(struct super_block *sb, const befs_data_stream *data,
|
||||||
befs_blocknr_t blockno, befs_block_run * run)
|
befs_blocknr_t blockno, befs_block_run *run)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
const befs_block_run *array = data->direct;
|
const befs_block_run *array = data->direct;
|
||||||
@@ -261,6 +262,7 @@ befs_find_brun_direct(struct super_block *sb, const befs_data_stream *data,
|
|||||||
sum += array[i].len, i++) {
|
sum += array[i].len, i++) {
|
||||||
if (blockno >= sum && blockno < sum + (array[i].len)) {
|
if (blockno >= sum && blockno < sum + (array[i].len)) {
|
||||||
int offset = blockno - sum;
|
int offset = blockno - sum;
|
||||||
|
|
||||||
run->allocation_group = array[i].allocation_group;
|
run->allocation_group = array[i].allocation_group;
|
||||||
run->start = array[i].start + offset;
|
run->start = array[i].start + offset;
|
||||||
run->len = array[i].len - offset;
|
run->len = array[i].len - offset;
|
||||||
@@ -304,7 +306,7 @@ static int
|
|||||||
befs_find_brun_indirect(struct super_block *sb,
|
befs_find_brun_indirect(struct super_block *sb,
|
||||||
const befs_data_stream *data,
|
const befs_data_stream *data,
|
||||||
befs_blocknr_t blockno,
|
befs_blocknr_t blockno,
|
||||||
befs_block_run * run)
|
befs_block_run *run)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
befs_blocknr_t sum = 0;
|
befs_blocknr_t sum = 0;
|
||||||
@@ -413,7 +415,7 @@ static int
|
|||||||
befs_find_brun_dblindirect(struct super_block *sb,
|
befs_find_brun_dblindirect(struct super_block *sb,
|
||||||
const befs_data_stream *data,
|
const befs_data_stream *data,
|
||||||
befs_blocknr_t blockno,
|
befs_blocknr_t blockno,
|
||||||
befs_block_run * run)
|
befs_block_run *run)
|
||||||
{
|
{
|
||||||
int dblindir_indx;
|
int dblindir_indx;
|
||||||
int indir_indx;
|
int indir_indx;
|
||||||
|
Reference in New Issue
Block a user