cifs: multichannel: move channel selection in function
[linux-2.6-microblaze.git] / fs / cifs / cifsproto.h
index 12a895e..9767f9b 100644 (file)
@@ -45,25 +45,25 @@ extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
                        unsigned int /* length */);
 extern unsigned int _get_xid(void);
 extern void _free_xid(unsigned int);
-#define get_xid()                                              \
-({                                                             \
+#define get_xid()                                                      \
+({                                                                     \
        unsigned int __xid = _get_xid();                                \
-       cifs_dbg(FYI, "CIFS VFS: in %s as Xid: %u with uid: %d\n",      \
+       cifs_dbg(FYI, "VFS: in %s as Xid: %u with uid: %d\n",           \
                 __func__, __xid,                                       \
                 from_kuid(&init_user_ns, current_fsuid()));            \
-       trace_smb3_enter(__xid, __func__);                      \
-       __xid;                                                  \
+       trace_smb3_enter(__xid, __func__);                              \
+       __xid;                                                          \
 })
 
-#define free_xid(curr_xid)                                     \
-do {                                                           \
-       _free_xid(curr_xid);                                    \
-       cifs_dbg(FYI, "CIFS VFS: leaving %s (xid = %u) rc = %d\n",      \
-                __func__, curr_xid, (int)rc);                  \
-       if (rc)                                                 \
+#define free_xid(curr_xid)                                             \
+do {                                                                   \
+       _free_xid(curr_xid);                                            \
+       cifs_dbg(FYI, "VFS: leaving %s (xid = %u) rc = %d\n",           \
+                __func__, curr_xid, (int)rc);                          \
+       if (rc)                                                         \
                trace_smb3_exit_err(curr_xid, __func__, (int)rc);       \
-       else                                                    \
-               trace_smb3_exit_done(curr_xid, __func__);       \
+       else                                                            \
+               trace_smb3_exit_done(curr_xid, __func__);               \
 } while (0)
 extern int init_cifs_idmap(void);
 extern void exit_cifs_idmap(void);
@@ -89,12 +89,14 @@ extern void cifs_mid_q_entry_release(struct mid_q_entry *midEntry);
 extern void cifs_wake_up_task(struct mid_q_entry *mid);
 extern int cifs_handle_standard(struct TCP_Server_Info *server,
                                struct mid_q_entry *mid);
+extern bool cifs_match_ipaddr(struct sockaddr *srcaddr, struct sockaddr *rhs);
 extern int cifs_discard_remaining_data(struct TCP_Server_Info *server);
 extern int cifs_call_async(struct TCP_Server_Info *server,
                        struct smb_rqst *rqst,
                        mid_receive_t *receive, mid_callback_t *callback,
                        mid_handle_t *handle, void *cbdata, const int flags,
                        const struct cifs_credits *exist_credits);
+extern struct TCP_Server_Info *cifs_pick_channel(struct cifs_ses *ses);
 extern int cifs_send_recv(const unsigned int xid, struct cifs_ses *ses,
                          struct smb_rqst *rqst, int *resp_buf_type,
                          const int flags, struct kvec *resp_iov);
@@ -616,6 +618,10 @@ static inline int get_dfs_path(const unsigned int xid, struct cifs_ses *ses,
        return dfs_cache_find(xid, ses, nls_codepage, remap, old_path,
                              referral, NULL);
 }
+
+int match_target_ip(struct TCP_Server_Info *server,
+                   const char *share, size_t share_len,
+                   bool *result);
 #endif
 
 static inline int cifs_create_options(struct cifs_sb_info *cifs_sb, int options)