diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2012-05-17 13:53:29 (GMT) |
---|---|---|
committer | Pavel Shilovsky <pshilovsky@samba.org> | 2012-05-23 08:33:12 (GMT) |
commit | 452757897a311b939ae202744754ffd9ce6704d8 (patch) | |
tree | 29f14cb0476af25d2bcd10883e0d612711462f29 /fs/cifs/cifsglob.h | |
parent | 8aa26f3ed80ddbaf78804b6481fcfdbd447caa1c (diff) | |
download | linux-fsl-qoriq-452757897a311b939ae202744754ffd9ce6704d8.tar.xz |
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.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 1001924..2396456 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. |