aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsglob.h
diff options
context:
space:
mode:
authorPavel Shilovsky <piastry@etersoft.ru>2012-05-17 17:53:29 +0400
committerPavel Shilovsky <pshilovsky@samba.org>2012-05-23 12:33:12 +0400
commit452757897a311b939ae202744754ffd9ce6704d8 (patch)
tree29f14cb0476af25d2bcd10883e0d612711462f29 /fs/cifs/cifsglob.h
parentCIFS: Move protocol specific demultiplex thread calls to ops struct (diff)
downloadlinux-dev-452757897a311b939ae202744754ffd9ce6704d8.tar.xz
linux-dev-452757897a311b939ae202744754ffd9ce6704d8.zip
CIFS: Move add/set_credits and get_credits_field to ops structure
Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsglob.h')
-rw-r--r--fs/cifs/cifsglob.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 1001924f594a..2396456c4edc 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -169,6 +169,9 @@ struct smb_version_operations {
/* check response: verify signature, map error */
int (*check_receive)(struct mid_q_entry *, struct TCP_Server_Info *,
bool);
+ void (*add_credits)(struct TCP_Server_Info *, const unsigned int);
+ void (*set_credits)(struct TCP_Server_Info *, const int);
+ int * (*get_credits_field)(struct TCP_Server_Info *);
/* data offset from read response message */
unsigned int (*read_data_offset)(char *);
/* data length from read response message */
@@ -372,16 +375,6 @@ in_flight(struct TCP_Server_Info *server)
return num;
}
-static inline int*
-get_credits_field(struct TCP_Server_Info *server)
-{
- /*
- * This will change to switch statement when we reserve slots for echos
- * and oplock breaks.
- */
- return &server->credits;
-}
-
static inline bool
has_credits(struct TCP_Server_Info *server, int *credits)
{
@@ -392,6 +385,18 @@ has_credits(struct TCP_Server_Info *server, int *credits)
return num > 0;
}
+static inline void
+add_credits(struct TCP_Server_Info *server, const unsigned int add)
+{
+ server->ops->add_credits(server, add);
+}
+
+static inline void
+set_credits(struct TCP_Server_Info *server, const int val)
+{
+ server->ops->set_credits(server, val);
+}
+
/*
* Macros to allow the TCP_Server_Info->net field and related code to drop out
* when CONFIG_NET_NS isn't set.