Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 255071
b: refs/heads/master
c: 891a54a
h: refs/heads/master
i:
  255069: 4480e8d
  255067: 40462f1
  255063: b311243
  255055: 3cd190a
  255039: 1888454
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Jul 4, 2011
1 parent bf5593a commit 7d39722
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 58 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e7717060ddd509e6c305ad7bf5a090a95e91c8cf
refs/heads/master: 891a54a153646f9b16bffe5df6cb74cb3f1e9dc6
33 changes: 2 additions & 31 deletions trunk/fs/ubifs/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -2718,16 +2718,8 @@ static void cut_data(const void *buf, int len)
p[i] = 0xff;
}

int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
int len, int check)
{
if (in_failure_mode(desc))
return -EROFS;
return ubi_leb_read(desc, lnum, buf, offset, len, check);
}

int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
int offset, int len, int dtype)
int offs, int len, int dtype)
{
int err, failing;

Expand All @@ -2736,7 +2728,7 @@ int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
failing = do_fail(desc, lnum, 1);
if (failing)
cut_data(buf, len);
err = ubi_leb_write(desc, lnum, buf, offset, len, dtype);
err = ubi_leb_write(desc, lnum, buf, offs, len, dtype);
if (err)
return err;
if (failing)
Expand All @@ -2759,20 +2751,6 @@ int dbg_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf,
return 0;
}

int dbg_leb_erase(struct ubi_volume_desc *desc, int lnum)
{
int err;

if (do_fail(desc, lnum, 0))
return -EROFS;
err = ubi_leb_erase(desc, lnum);
if (err)
return err;
if (do_fail(desc, lnum, 0))
return -EROFS;
return 0;
}

int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum)
{
int err;
Expand All @@ -2787,13 +2765,6 @@ int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum)
return 0;
}

int dbg_is_mapped(struct ubi_volume_desc *desc, int lnum)
{
if (in_failure_mode(desc))
return -EROFS;
return ubi_is_mapped(desc, lnum);
}

int dbg_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype)
{
int err;
Expand Down
27 changes: 1 addition & 26 deletions trunk/fs/ubifs/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,44 +302,19 @@ int dbg_check_data_nodes_order(struct ubifs_info *c, struct list_head *head);
int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head);

#ifndef UBIFS_DBG_PRESERVE_UBI
#define ubi_leb_read dbg_leb_read
#define ubi_leb_write dbg_leb_write
#define ubi_leb_change dbg_leb_change
#define ubi_leb_erase dbg_leb_erase
#define ubi_leb_unmap dbg_leb_unmap
#define ubi_is_mapped dbg_is_mapped
#define ubi_leb_map dbg_leb_map
#endif

int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
int len, int check);
int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
int offset, int len, int dtype);
int offs, int len, int dtype);
int dbg_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf,
int len, int dtype);
int dbg_leb_erase(struct ubi_volume_desc *desc, int lnum);
int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum);
int dbg_is_mapped(struct ubi_volume_desc *desc, int lnum);
int dbg_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype);

static inline int dbg_read(struct ubi_volume_desc *desc, int lnum, char *buf,
int offset, int len)
{
return dbg_leb_read(desc, lnum, buf, offset, len, 0);
}

static inline int dbg_write(struct ubi_volume_desc *desc, int lnum,
const void *buf, int offset, int len)
{
return dbg_leb_write(desc, lnum, buf, offset, len, UBI_UNKNOWN);
}

static inline int dbg_change(struct ubi_volume_desc *desc, int lnum,
const void *buf, int len)
{
return dbg_leb_change(desc, lnum, buf, len, UBI_UNKNOWN);
}

/* Debugfs-related stuff */
int dbg_debugfs_init(void);
void dbg_debugfs_exit(void);
Expand Down

0 comments on commit 7d39722

Please sign in to comment.