Commit a970f5d5 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6

* 'linux-next' of git://git.infradead.org/ubifs-2.6:
  UBIFS: fix compilation warnings when compiling with gcc 4.5
  UBIFS: fix oops when R/O file-system is fsync'ed
parents 7ebfa57f 1dcffad7
...@@ -23,6 +23,12 @@ ...@@ -23,6 +23,12 @@
#ifndef __UBIFS_DEBUG_H__ #ifndef __UBIFS_DEBUG_H__
#define __UBIFS_DEBUG_H__ #define __UBIFS_DEBUG_H__
/* Checking helper functions */
typedef int (*dbg_leaf_callback)(struct ubifs_info *c,
struct ubifs_zbranch *zbr, void *priv);
typedef int (*dbg_znode_callback)(struct ubifs_info *c,
struct ubifs_znode *znode, void *priv);
#ifdef CONFIG_UBIFS_FS_DEBUG #ifdef CONFIG_UBIFS_FS_DEBUG
/** /**
...@@ -270,11 +276,6 @@ void dbg_dump_tnc(struct ubifs_info *c); ...@@ -270,11 +276,6 @@ void dbg_dump_tnc(struct ubifs_info *c);
void dbg_dump_index(struct ubifs_info *c); void dbg_dump_index(struct ubifs_info *c);
void dbg_dump_lpt_lebs(const struct ubifs_info *c); void dbg_dump_lpt_lebs(const struct ubifs_info *c);
/* Checking helper functions */
typedef int (*dbg_leaf_callback)(struct ubifs_info *c,
struct ubifs_zbranch *zbr, void *priv);
typedef int (*dbg_znode_callback)(struct ubifs_info *c,
struct ubifs_znode *znode, void *priv);
int dbg_walk_index(struct ubifs_info *c, dbg_leaf_callback leaf_cb, int dbg_walk_index(struct ubifs_info *c, dbg_leaf_callback leaf_cb,
dbg_znode_callback znode_cb, void *priv); dbg_znode_callback znode_cb, void *priv);
...@@ -295,7 +296,6 @@ int dbg_check_idx_size(struct ubifs_info *c, long long idx_size); ...@@ -295,7 +296,6 @@ int dbg_check_idx_size(struct ubifs_info *c, long long idx_size);
int dbg_check_filesystem(struct ubifs_info *c); int dbg_check_filesystem(struct ubifs_info *c);
void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat, void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat,
int add_pos); int add_pos);
int dbg_check_lprops(struct ubifs_info *c);
int dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode, int dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode,
int row, int col); int row, int col);
int dbg_check_inode_size(struct ubifs_info *c, const struct inode *inode, int dbg_check_inode_size(struct ubifs_info *c, const struct inode *inode,
...@@ -401,58 +401,94 @@ void dbg_debugfs_exit_fs(struct ubifs_info *c); ...@@ -401,58 +401,94 @@ void dbg_debugfs_exit_fs(struct ubifs_info *c);
#define DBGKEY(key) ((char *)(key)) #define DBGKEY(key) ((char *)(key))
#define DBGKEY1(key) ((char *)(key)) #define DBGKEY1(key) ((char *)(key))
#define ubifs_debugging_init(c) 0 static inline int ubifs_debugging_init(struct ubifs_info *c) { return 0; }
#define ubifs_debugging_exit(c) ({}) static inline void ubifs_debugging_exit(struct ubifs_info *c) { return; }
static inline const char *dbg_ntype(int type) { return ""; }
#define dbg_ntype(type) "" static inline const char *dbg_cstate(int cmt_state) { return ""; }
#define dbg_cstate(cmt_state) "" static inline const char *dbg_jhead(int jhead) { return ""; }
#define dbg_jhead(jhead) "" static inline const char *
#define dbg_get_key_dump(c, key) ({}) dbg_get_key_dump(const struct ubifs_info *c,
#define dbg_dump_inode(c, inode) ({}) const union ubifs_key *key) { return ""; }
#define dbg_dump_node(c, node) ({}) static inline void dbg_dump_inode(const struct ubifs_info *c,
#define dbg_dump_lpt_node(c, node, lnum, offs) ({}) const struct inode *inode) { return; }
#define dbg_dump_budget_req(req) ({}) static inline void dbg_dump_node(const struct ubifs_info *c,
#define dbg_dump_lstats(lst) ({}) const void *node) { return; }
#define dbg_dump_budg(c) ({}) static inline void dbg_dump_lpt_node(const struct ubifs_info *c,
#define dbg_dump_lprop(c, lp) ({}) void *node, int lnum,
#define dbg_dump_lprops(c) ({}) int offs) { return; }
#define dbg_dump_lpt_info(c) ({}) static inline void
#define dbg_dump_leb(c, lnum) ({}) dbg_dump_budget_req(const struct ubifs_budget_req *req) { return; }
#define dbg_dump_znode(c, znode) ({}) static inline void
#define dbg_dump_heap(c, heap, cat) ({}) dbg_dump_lstats(const struct ubifs_lp_stats *lst) { return; }
#define dbg_dump_pnode(c, pnode, parent, iip) ({}) static inline void dbg_dump_budg(struct ubifs_info *c) { return; }
#define dbg_dump_tnc(c) ({}) static inline void dbg_dump_lprop(const struct ubifs_info *c,
#define dbg_dump_index(c) ({}) const struct ubifs_lprops *lp) { return; }
#define dbg_dump_lpt_lebs(c) ({}) static inline void dbg_dump_lprops(struct ubifs_info *c) { return; }
static inline void dbg_dump_lpt_info(struct ubifs_info *c) { return; }
#define dbg_walk_index(c, leaf_cb, znode_cb, priv) 0 static inline void dbg_dump_leb(const struct ubifs_info *c,
#define dbg_old_index_check_init(c, zroot) 0 int lnum) { return; }
#define dbg_save_space_info(c) ({}) static inline void
#define dbg_check_space_info(c) 0 dbg_dump_znode(const struct ubifs_info *c,
#define dbg_check_old_index(c, zroot) 0 const struct ubifs_znode *znode) { return; }
#define dbg_check_cats(c) 0 static inline void dbg_dump_heap(struct ubifs_info *c,
#define dbg_check_ltab(c) 0 struct ubifs_lpt_heap *heap,
#define dbg_chk_lpt_free_spc(c) 0 int cat) { return; }
#define dbg_chk_lpt_sz(c, action, len) 0 static inline void dbg_dump_pnode(struct ubifs_info *c,
#define dbg_check_synced_i_size(inode) 0 struct ubifs_pnode *pnode,
#define dbg_check_dir_size(c, dir) 0 struct ubifs_nnode *parent,
#define dbg_check_tnc(c, x) 0 int iip) { return; }
#define dbg_check_idx_size(c, idx_size) 0 static inline void dbg_dump_tnc(struct ubifs_info *c) { return; }
#define dbg_check_filesystem(c) 0 static inline void dbg_dump_index(struct ubifs_info *c) { return; }
#define dbg_check_heap(c, heap, cat, add_pos) ({}) static inline void dbg_dump_lpt_lebs(const struct ubifs_info *c) { return; }
#define dbg_check_lprops(c) 0
#define dbg_check_lpt_nodes(c, cnode, row, col) 0 static inline int dbg_walk_index(struct ubifs_info *c,
#define dbg_check_inode_size(c, inode, size) 0 dbg_leaf_callback leaf_cb,
#define dbg_check_data_nodes_order(c, head) 0 dbg_znode_callback znode_cb,
#define dbg_check_nondata_nodes_order(c, head) 0 void *priv) { return 0; }
static inline void dbg_save_space_info(struct ubifs_info *c) { return; }
static inline int dbg_check_space_info(struct ubifs_info *c) { return 0; }
static inline int dbg_check_lprops(struct ubifs_info *c) { return 0; }
static inline int
dbg_old_index_check_init(struct ubifs_info *c,
struct ubifs_zbranch *zroot) { return 0; }
static inline int
dbg_check_old_index(struct ubifs_info *c,
struct ubifs_zbranch *zroot) { return 0; }
static inline int dbg_check_cats(struct ubifs_info *c) { return 0; }
static inline int dbg_check_ltab(struct ubifs_info *c) { return 0; }
static inline int dbg_chk_lpt_free_spc(struct ubifs_info *c) { return 0; }
static inline int dbg_chk_lpt_sz(struct ubifs_info *c,
int action, int len) { return 0; }
static inline int dbg_check_synced_i_size(struct inode *inode) { return 0; }
static inline int dbg_check_dir_size(struct ubifs_info *c,
const struct inode *dir) { return 0; }
static inline int dbg_check_tnc(struct ubifs_info *c, int extra) { return 0; }
static inline int dbg_check_idx_size(struct ubifs_info *c,
long long idx_size) { return 0; }
static inline int dbg_check_filesystem(struct ubifs_info *c) { return 0; }
static inline void dbg_check_heap(struct ubifs_info *c,
struct ubifs_lpt_heap *heap,
int cat, int add_pos) { return; }
static inline int dbg_check_lpt_nodes(struct ubifs_info *c,
struct ubifs_cnode *cnode, int row, int col) { return 0; }
static inline int dbg_check_inode_size(struct ubifs_info *c,
const struct inode *inode,
loff_t size) { return 0; }
static inline int
dbg_check_data_nodes_order(struct ubifs_info *c,
struct list_head *head) { return 0; }
static inline int
dbg_check_nondata_nodes_order(struct ubifs_info *c,
struct list_head *head) { return 0; }
static inline int dbg_force_in_the_gaps(void) { return 0; }
#define dbg_force_in_the_gaps_enabled 0 #define dbg_force_in_the_gaps_enabled 0
#define dbg_force_in_the_gaps() 0
#define dbg_failure_mode 0 #define dbg_failure_mode 0
#define dbg_debugfs_init() 0 static inline int dbg_debugfs_init(void) { return 0; }
#define dbg_debugfs_exit() static inline void dbg_debugfs_exit(void) { return; }
#define dbg_debugfs_init_fs(c) 0 static inline int dbg_debugfs_init_fs(struct ubifs_info *c) { return 0; }
#define dbg_debugfs_exit_fs(c) 0 static inline int dbg_debugfs_exit_fs(struct ubifs_info *c) { return 0; }
#endif /* !CONFIG_UBIFS_FS_DEBUG */ #endif /* !CONFIG_UBIFS_FS_DEBUG */
#endif /* !__UBIFS_DEBUG_H__ */ #endif /* !__UBIFS_DEBUG_H__ */
...@@ -1312,6 +1312,9 @@ int ubifs_fsync(struct file *file, int datasync) ...@@ -1312,6 +1312,9 @@ int ubifs_fsync(struct file *file, int datasync)
dbg_gen("syncing inode %lu", inode->i_ino); dbg_gen("syncing inode %lu", inode->i_ino);
if (inode->i_sb->s_flags & MS_RDONLY)
return 0;
/* /*
* VFS has already synchronized dirty pages for this inode. Synchronize * VFS has already synchronized dirty pages for this inode. Synchronize
* the inode unless this is a 'datasync()' call. * the inode unless this is a 'datasync()' call.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment