Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00600056 authored by Adrian Bunk's avatar Adrian Bunk Committed by Mark Fasheh
Browse files

[2.6 patch] fs/ocfs2/: possible cleanups



This patch contains the following cleanups that are now possible:
- make the following needlessly global functions static:
  - dlmglue.c:ocfs2_process_blocked_lock()
  - heartbeat.c:ocfs2_node_map_init()
- #if 0 the following unused global function plus support functions:
  - heartbeat.c:ocfs2_node_map_is_only()

Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarMark Fasheh <mark.fasheh@oracle.com>
parent 0dd3256e
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3219,7 +3219,7 @@ static int ocfs2_dentry_convert_worker(struct ocfs2_lock_res *lockres,
	return UNBLOCK_CONTINUE_POST;
	return UNBLOCK_CONTINUE_POST;
}
}


void ocfs2_process_blocked_lock(struct ocfs2_super *osb,
static void ocfs2_process_blocked_lock(struct ocfs2_super *osb,
				       struct ocfs2_lock_res *lockres)
				       struct ocfs2_lock_res *lockres)
{
{
	int status;
	int status;
+0 −2
Original line number Original line Diff line number Diff line
@@ -109,8 +109,6 @@ void ocfs2_simple_drop_lockres(struct ocfs2_super *osb,
			       struct ocfs2_lock_res *lockres);
			       struct ocfs2_lock_res *lockres);


/* for the downconvert thread */
/* for the downconvert thread */
void ocfs2_process_blocked_lock(struct ocfs2_super *osb,
				struct ocfs2_lock_res *lockres);
void ocfs2_wake_downconvert_thread(struct ocfs2_super *osb);
void ocfs2_wake_downconvert_thread(struct ocfs2_super *osb);


struct ocfs2_dlm_debug *ocfs2_new_dlm_debug(void);
struct ocfs2_dlm_debug *ocfs2_new_dlm_debug(void);
+13 −13
Original line number Original line Diff line number Diff line
@@ -49,10 +49,15 @@ static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map,
static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map,
static inline void __ocfs2_node_map_clear_bit(struct ocfs2_node_map *map,
					      int bit);
					      int bit);
static inline int __ocfs2_node_map_is_empty(struct ocfs2_node_map *map);
static inline int __ocfs2_node_map_is_empty(struct ocfs2_node_map *map);
static void __ocfs2_node_map_dup(struct ocfs2_node_map *target,

				 struct ocfs2_node_map *from);
/* special case -1 for now
static void __ocfs2_node_map_set(struct ocfs2_node_map *target,
 * TODO: should *really* make sure the calling func never passes -1!!  */
				 struct ocfs2_node_map *from);
static void ocfs2_node_map_init(struct ocfs2_node_map *map)
{
	map->num_nodes = OCFS2_NODE_MAP_MAX_NODES;
	memset(map->map, 0, BITS_TO_LONGS(OCFS2_NODE_MAP_MAX_NODES) *
	       sizeof(unsigned long));
}


void ocfs2_init_node_maps(struct ocfs2_super *osb)
void ocfs2_init_node_maps(struct ocfs2_super *osb)
{
{
@@ -136,15 +141,6 @@ void ocfs2_stop_heartbeat(struct ocfs2_super *osb)
		mlog_errno(ret);
		mlog_errno(ret);
}
}


/* special case -1 for now
 * TODO: should *really* make sure the calling func never passes -1!!  */
void ocfs2_node_map_init(struct ocfs2_node_map *map)
{
	map->num_nodes = OCFS2_NODE_MAP_MAX_NODES;
	memset(map->map, 0, BITS_TO_LONGS(OCFS2_NODE_MAP_MAX_NODES) *
	       sizeof(unsigned long));
}

static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map,
static inline void __ocfs2_node_map_set_bit(struct ocfs2_node_map *map,
					    int bit)
					    int bit)
{
{
@@ -216,6 +212,8 @@ int ocfs2_node_map_is_empty(struct ocfs2_super *osb,
	return ret;
	return ret;
}
}


#if 0

static void __ocfs2_node_map_dup(struct ocfs2_node_map *target,
static void __ocfs2_node_map_dup(struct ocfs2_node_map *target,
				 struct ocfs2_node_map *from)
				 struct ocfs2_node_map *from)
{
{
@@ -254,6 +252,8 @@ static void __ocfs2_node_map_set(struct ocfs2_node_map *target,
		target->map[i] = from->map[i];
		target->map[i] = from->map[i];
}
}


#endif  /*  0  */

/* Returns whether the recovery bit was actually set - it may not be
/* Returns whether the recovery bit was actually set - it may not be
 * if a node is still marked as needing recovery */
 * if a node is still marked as needing recovery */
int ocfs2_recovery_map_set(struct ocfs2_super *osb,
int ocfs2_recovery_map_set(struct ocfs2_super *osb,
+0 −5
Original line number Original line Diff line number Diff line
@@ -33,7 +33,6 @@ void ocfs2_stop_heartbeat(struct ocfs2_super *osb);


/* node map functions - used to keep track of mounted and in-recovery
/* node map functions - used to keep track of mounted and in-recovery
 * nodes. */
 * nodes. */
void ocfs2_node_map_init(struct ocfs2_node_map *map);
int ocfs2_node_map_is_empty(struct ocfs2_super *osb,
int ocfs2_node_map_is_empty(struct ocfs2_super *osb,
			    struct ocfs2_node_map *map);
			    struct ocfs2_node_map *map);
void ocfs2_node_map_set_bit(struct ocfs2_super *osb,
void ocfs2_node_map_set_bit(struct ocfs2_super *osb,
@@ -57,9 +56,5 @@ int ocfs2_recovery_map_set(struct ocfs2_super *osb,
			   int num);
			   int num);
void ocfs2_recovery_map_clear(struct ocfs2_super *osb,
void ocfs2_recovery_map_clear(struct ocfs2_super *osb,
			      int num);
			      int num);
/* returns 1 if bit is the only bit set in target, 0 otherwise */
int ocfs2_node_map_is_only(struct ocfs2_super *osb,
			   struct ocfs2_node_map *target,
			   int bit);


#endif /* OCFS2_HEARTBEAT_H */
#endif /* OCFS2_HEARTBEAT_H */