Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2

* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2:
[PATCH 3/3] ocfs2/net: Silence build warnings
[PATCH 2/3] ocfs2/dlm: Silence build warnings
[PATCH 1/3] ocfs2/net: Silence build warnings
ocfs2: Rename 'user_stack' plugin structure to 'ocfs2_user_plugin'

+75 -53
+9 -19
fs/ocfs2/cluster/tcp.c
··· 142 static void o2net_sc_postpone_idle(struct o2net_sock_container *sc); 143 static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc); 144 145 - static void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype, 146 - u32 msgkey, struct task_struct *task, u8 node) 147 - { 148 #ifdef CONFIG_DEBUG_FS 149 INIT_LIST_HEAD(&nst->st_net_debug_item); 150 nst->st_task = task; 151 nst->st_msg_type = msgtype; 152 nst->st_msg_key = msgkey; 153 nst->st_node = node; 154 - #endif 155 } 156 157 - static void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) 158 { 159 - #ifdef CONFIG_DEBUG_FS 160 do_gettimeofday(&nst->st_sock_time); 161 - #endif 162 } 163 164 - static void o2net_set_nst_send_time(struct o2net_send_tracking *nst) 165 { 166 - #ifdef CONFIG_DEBUG_FS 167 do_gettimeofday(&nst->st_send_time); 168 - #endif 169 } 170 171 - static void o2net_set_nst_status_time(struct o2net_send_tracking *nst) 172 { 173 - #ifdef CONFIG_DEBUG_FS 174 do_gettimeofday(&nst->st_status_time); 175 - #endif 176 } 177 178 - static void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, 179 struct o2net_sock_container *sc) 180 { 181 - #ifdef CONFIG_DEBUG_FS 182 nst->st_sc = sc; 183 - #endif 184 } 185 186 - static void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id) 187 { 188 - #ifdef CONFIG_DEBUG_FS 189 nst->st_id = msg_id; 190 - #endif 191 } 192 193 static inline int o2net_reconnect_delay(void) 194 {
··· 142 static void o2net_sc_postpone_idle(struct o2net_sock_container *sc); 143 static void o2net_sc_reset_idle_timer(struct o2net_sock_container *sc); 144 145 #ifdef CONFIG_DEBUG_FS 146 + void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype, 147 + u32 msgkey, struct task_struct *task, u8 node) 148 + { 149 INIT_LIST_HEAD(&nst->st_net_debug_item); 150 nst->st_task = task; 151 nst->st_msg_type = msgtype; 152 nst->st_msg_key = msgkey; 153 nst->st_node = node; 154 } 155 156 + void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) 157 { 158 do_gettimeofday(&nst->st_sock_time); 159 } 160 161 + void o2net_set_nst_send_time(struct o2net_send_tracking *nst) 162 { 163 do_gettimeofday(&nst->st_send_time); 164 } 165 166 + void o2net_set_nst_status_time(struct o2net_send_tracking *nst) 167 { 168 do_gettimeofday(&nst->st_status_time); 169 } 170 171 + void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, 172 struct o2net_sock_container *sc) 173 { 174 nst->st_sc = sc; 175 } 176 177 + void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id) 178 { 179 nst->st_id = msg_id; 180 } 181 + #endif /* CONFIG_DEBUG_FS */ 182 183 static inline int o2net_reconnect_delay(void) 184 {
+6 -6
fs/ocfs2/cluster/tcp.h
··· 128 void o2net_debug_add_sc(struct o2net_sock_container *sc); 129 void o2net_debug_del_sc(struct o2net_sock_container *sc); 130 #else 131 - static int o2net_debugfs_init(void) 132 { 133 return 0; 134 } 135 - static void o2net_debugfs_exit(void) 136 { 137 } 138 - static void o2net_debug_add_nst(struct o2net_send_tracking *nst) 139 { 140 } 141 - static void o2net_debug_del_nst(struct o2net_send_tracking *nst) 142 { 143 } 144 - static void o2net_debug_add_sc(struct o2net_sock_container *sc) 145 { 146 } 147 - static void o2net_debug_del_sc(struct o2net_sock_container *sc) 148 { 149 } 150 #endif /* CONFIG_DEBUG_FS */
··· 128 void o2net_debug_add_sc(struct o2net_sock_container *sc); 129 void o2net_debug_del_sc(struct o2net_sock_container *sc); 130 #else 131 + static inline int o2net_debugfs_init(void) 132 { 133 return 0; 134 } 135 + static inline void o2net_debugfs_exit(void) 136 { 137 } 138 + static inline void o2net_debug_add_nst(struct o2net_send_tracking *nst) 139 { 140 } 141 + static inline void o2net_debug_del_nst(struct o2net_send_tracking *nst) 142 { 143 } 144 + static inline void o2net_debug_add_sc(struct o2net_sock_container *sc) 145 { 146 } 147 + static inline void o2net_debug_del_sc(struct o2net_sock_container *sc) 148 { 149 } 150 #endif /* CONFIG_DEBUG_FS */
+32
fs/ocfs2/cluster/tcp_internal.h
··· 224 struct timeval st_send_time; 225 struct timeval st_status_time; 226 }; 227 #else 228 struct o2net_send_tracking { 229 u32 dummy; 230 }; 231 #endif /* CONFIG_DEBUG_FS */ 232 233 #endif /* O2CLUSTER_TCP_INTERNAL_H */
··· 224 struct timeval st_send_time; 225 struct timeval st_status_time; 226 }; 227 + 228 + void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype, 229 + u32 msgkey, struct task_struct *task, u8 node); 230 + void o2net_set_nst_sock_time(struct o2net_send_tracking *nst); 231 + void o2net_set_nst_send_time(struct o2net_send_tracking *nst); 232 + void o2net_set_nst_status_time(struct o2net_send_tracking *nst); 233 + void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, 234 + struct o2net_sock_container *sc); 235 + void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, u32 msg_id); 236 + 237 #else 238 struct o2net_send_tracking { 239 u32 dummy; 240 }; 241 + 242 + static inline void o2net_init_nst(struct o2net_send_tracking *nst, u32 msgtype, 243 + u32 msgkey, struct task_struct *task, u8 node) 244 + { 245 + } 246 + static inline void o2net_set_nst_sock_time(struct o2net_send_tracking *nst) 247 + { 248 + } 249 + static inline void o2net_set_nst_send_time(struct o2net_send_tracking *nst) 250 + { 251 + } 252 + static inline void o2net_set_nst_status_time(struct o2net_send_tracking *nst) 253 + { 254 + } 255 + static inline void o2net_set_nst_sock_container(struct o2net_send_tracking *nst, 256 + struct o2net_sock_container *sc) 257 + { 258 + } 259 + static inline void o2net_set_nst_msg_id(struct o2net_send_tracking *nst, 260 + u32 msg_id) 261 + { 262 + } 263 #endif /* CONFIG_DEBUG_FS */ 264 265 #endif /* O2CLUSTER_TCP_INTERNAL_H */
+11 -11
fs/ocfs2/dlm/dlmdebug.h
··· 60 61 #else 62 63 - static int dlm_debug_init(struct dlm_ctxt *dlm) 64 { 65 return 0; 66 } 67 - static void dlm_debug_shutdown(struct dlm_ctxt *dlm) 68 { 69 } 70 - static int dlm_create_debugfs_subroot(struct dlm_ctxt *dlm) 71 - { 72 - return 0; 73 - } 74 - static void dlm_destroy_debugfs_subroot(struct dlm_ctxt *dlm) 75 - { 76 - } 77 - static int dlm_create_debugfs_root(void) 78 { 79 return 0; 80 } 81 - static void dlm_destroy_debugfs_root(void) 82 { 83 } 84
··· 60 61 #else 62 63 + static inline int dlm_debug_init(struct dlm_ctxt *dlm) 64 { 65 return 0; 66 } 67 + static inline void dlm_debug_shutdown(struct dlm_ctxt *dlm) 68 { 69 } 70 + static inline int dlm_create_debugfs_subroot(struct dlm_ctxt *dlm) 71 { 72 return 0; 73 } 74 + static inline void dlm_destroy_debugfs_subroot(struct dlm_ctxt *dlm) 75 + { 76 + } 77 + static inline int dlm_create_debugfs_root(void) 78 + { 79 + return 0; 80 + } 81 + static inline void dlm_destroy_debugfs_root(void) 82 { 83 } 84
+17 -17
fs/ocfs2/stack_user.c
··· 61 * negotiated by the client. The client negotiates based on the maximum 62 * version advertised in /sys/fs/ocfs2/max_locking_protocol. The major 63 * number from the "SETV" message must match 64 - * user_stack.sp_proto->lp_max_version.pv_major, and the minor number 65 * must be less than or equal to ...->lp_max_version.pv_minor. 66 * 67 * Once this information has been set, mounts will be allowed. From this ··· 153 struct ocfs2_control_message_down u_down; 154 }; 155 156 - static struct ocfs2_stack_plugin user_stack; 157 158 static atomic_t ocfs2_control_opened; 159 static int ocfs2_control_this_node = -1; ··· 399 char *ptr = NULL; 400 struct ocfs2_control_private *p = file->private_data; 401 struct ocfs2_protocol_version *max = 402 - &user_stack.sp_proto->lp_max_version; 403 404 if (ocfs2_control_get_handshake_state(file) != 405 OCFS2_CONTROL_HANDSHAKE_PROTOCOL) ··· 680 struct dlm_lksb *lksb = fsdlm_astarg_to_lksb(astarg); 681 int status = lksb->sb_status; 682 683 - BUG_ON(user_stack.sp_proto == NULL); 684 685 /* 686 * For now we're punting on the issue of other non-standard errors ··· 693 */ 694 695 if (status == -DLM_EUNLOCK || status == -DLM_ECANCEL) 696 - user_stack.sp_proto->lp_unlock_ast(astarg, 0); 697 else 698 - user_stack.sp_proto->lp_lock_ast(astarg); 699 } 700 701 static void fsdlm_blocking_ast_wrapper(void *astarg, int level) 702 { 703 - BUG_ON(user_stack.sp_proto == NULL); 704 705 - user_stack.sp_proto->lp_blocking_ast(astarg, level); 706 } 707 708 static int user_dlm_lock(struct ocfs2_cluster_connection *conn, ··· 838 return 0; 839 } 840 841 - static struct ocfs2_stack_operations user_stack_ops = { 842 .connect = user_cluster_connect, 843 .disconnect = user_cluster_disconnect, 844 .this_node = user_cluster_this_node, ··· 849 .dump_lksb = user_dlm_dump_lksb, 850 }; 851 852 - static struct ocfs2_stack_plugin user_stack = { 853 .sp_name = "user", 854 - .sp_ops = &user_stack_ops, 855 .sp_owner = THIS_MODULE, 856 }; 857 858 859 - static int __init user_stack_init(void) 860 { 861 int rc; 862 863 rc = ocfs2_control_init(); 864 if (!rc) { 865 - rc = ocfs2_stack_glue_register(&user_stack); 866 if (rc) 867 ocfs2_control_exit(); 868 } ··· 870 return rc; 871 } 872 873 - static void __exit user_stack_exit(void) 874 { 875 - ocfs2_stack_glue_unregister(&user_stack); 876 ocfs2_control_exit(); 877 } 878 879 MODULE_AUTHOR("Oracle"); 880 MODULE_DESCRIPTION("ocfs2 driver for userspace cluster stacks"); 881 MODULE_LICENSE("GPL"); 882 - module_init(user_stack_init); 883 - module_exit(user_stack_exit);
··· 61 * negotiated by the client. The client negotiates based on the maximum 62 * version advertised in /sys/fs/ocfs2/max_locking_protocol. The major 63 * number from the "SETV" message must match 64 + * ocfs2_user_plugin.sp_proto->lp_max_version.pv_major, and the minor number 65 * must be less than or equal to ...->lp_max_version.pv_minor. 66 * 67 * Once this information has been set, mounts will be allowed. From this ··· 153 struct ocfs2_control_message_down u_down; 154 }; 155 156 + static struct ocfs2_stack_plugin ocfs2_user_plugin; 157 158 static atomic_t ocfs2_control_opened; 159 static int ocfs2_control_this_node = -1; ··· 399 char *ptr = NULL; 400 struct ocfs2_control_private *p = file->private_data; 401 struct ocfs2_protocol_version *max = 402 + &ocfs2_user_plugin.sp_proto->lp_max_version; 403 404 if (ocfs2_control_get_handshake_state(file) != 405 OCFS2_CONTROL_HANDSHAKE_PROTOCOL) ··· 680 struct dlm_lksb *lksb = fsdlm_astarg_to_lksb(astarg); 681 int status = lksb->sb_status; 682 683 + BUG_ON(ocfs2_user_plugin.sp_proto == NULL); 684 685 /* 686 * For now we're punting on the issue of other non-standard errors ··· 693 */ 694 695 if (status == -DLM_EUNLOCK || status == -DLM_ECANCEL) 696 + ocfs2_user_plugin.sp_proto->lp_unlock_ast(astarg, 0); 697 else 698 + ocfs2_user_plugin.sp_proto->lp_lock_ast(astarg); 699 } 700 701 static void fsdlm_blocking_ast_wrapper(void *astarg, int level) 702 { 703 + BUG_ON(ocfs2_user_plugin.sp_proto == NULL); 704 705 + ocfs2_user_plugin.sp_proto->lp_blocking_ast(astarg, level); 706 } 707 708 static int user_dlm_lock(struct ocfs2_cluster_connection *conn, ··· 838 return 0; 839 } 840 841 + static struct ocfs2_stack_operations ocfs2_user_plugin_ops = { 842 .connect = user_cluster_connect, 843 .disconnect = user_cluster_disconnect, 844 .this_node = user_cluster_this_node, ··· 849 .dump_lksb = user_dlm_dump_lksb, 850 }; 851 852 + static struct ocfs2_stack_plugin ocfs2_user_plugin = { 853 .sp_name = "user", 854 + .sp_ops = &ocfs2_user_plugin_ops, 855 .sp_owner = THIS_MODULE, 856 }; 857 858 859 + static int __init ocfs2_user_plugin_init(void) 860 { 861 int rc; 862 863 rc = ocfs2_control_init(); 864 if (!rc) { 865 + rc = ocfs2_stack_glue_register(&ocfs2_user_plugin); 866 if (rc) 867 ocfs2_control_exit(); 868 } ··· 870 return rc; 871 } 872 873 + static void __exit ocfs2_user_plugin_exit(void) 874 { 875 + ocfs2_stack_glue_unregister(&ocfs2_user_plugin); 876 ocfs2_control_exit(); 877 } 878 879 MODULE_AUTHOR("Oracle"); 880 MODULE_DESCRIPTION("ocfs2 driver for userspace cluster stacks"); 881 MODULE_LICENSE("GPL"); 882 + module_init(ocfs2_user_plugin_init); 883 + module_exit(ocfs2_user_plugin_exit);