Skip to content

Commit

Permalink
Merge pull request multipath-tcp#59 from namjaejeon/cifsd-for-next
Browse files Browse the repository at this point in the history
Cifsd for next
  • Loading branch information
smfrench committed Jul 10, 2021
2 parents db0e04a + 21dd1fd commit 7c4ed5d
Show file tree
Hide file tree
Showing 13 changed files with 227 additions and 185 deletions.
10 changes: 7 additions & 3 deletions fs/ksmbd/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ static DEFINE_MUTEX(init_lock);

static struct ksmbd_conn_ops default_conn_ops;

static LIST_HEAD(conn_list);
static DEFINE_RWLOCK(conn_list_lock);
LIST_HEAD(conn_list);
DEFINE_RWLOCK(conn_list_lock);

/**
* ksmbd_conn_free() - free resources of the connection instance
Expand Down Expand Up @@ -70,6 +70,9 @@ struct ksmbd_conn *ksmbd_conn_alloc(void)
spin_lock_init(&conn->credits_lock);
ida_init(&conn->async_ida);

spin_lock_init(&conn->llist_lock);
INIT_LIST_HEAD(&conn->lock_list);

write_lock(&conn_list_lock);
list_add(&conn->conns_list, &conn_list);
write_unlock(&conn_list_lock);
Expand Down Expand Up @@ -120,7 +123,8 @@ int ksmbd_conn_try_dequeue_request(struct ksmbd_work *work)
list_empty(&work->async_request_entry))
return 0;

atomic_dec(&conn->req_running);
if (!work->multiRsp)
atomic_dec(&conn->req_running);
spin_lock(&conn->request_lock);
if (!work->multiRsp) {
list_del_init(&work->request_entry);
Expand Down
6 changes: 6 additions & 0 deletions fs/ksmbd/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ struct ksmbd_conn {
char *ntlmssp_cryptkey;
};

spinlock_t llist_lock;
struct list_head lock_list;

struct preauth_integrity_info *preauth_info;

bool need_neg;
Expand Down Expand Up @@ -138,6 +141,9 @@ struct ksmbd_transport {
#define KSMBD_TCP_SEND_TIMEOUT (5 * HZ)
#define KSMBD_TCP_PEER_SOCKADDR(c) ((struct sockaddr *)&((c)->peer_addr))

extern struct list_head conn_list;
extern rwlock_t conn_list_lock;

bool ksmbd_conn_alive(struct ksmbd_conn *conn);
void ksmbd_conn_wait_idle(struct ksmbd_conn *conn);
struct ksmbd_conn *ksmbd_conn_alloc(void);
Expand Down
6 changes: 3 additions & 3 deletions fs/ksmbd/ksmbd_work.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ struct ksmbd_work {
* Current Local FID assigned compound response if SMB2 CREATE
* command is present in compound request
*/
unsigned int compound_fid;
unsigned int compound_pfid;
unsigned int compound_sid;
u64 compound_fid;
u64 compound_pfid;
u64 compound_sid;

const struct cred *saved_cred;

Expand Down
2 changes: 1 addition & 1 deletion fs/ksmbd/oplock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1472,7 +1472,7 @@ struct create_context *smb2_find_context_vals(void *open_req, const char *tag)
next = le32_to_cpu(cc->Next);
} while (next != 0);

return ERR_PTR(-ENOENT);
return NULL;
}

/**
Expand Down
Loading

0 comments on commit 7c4ed5d

Please sign in to comment.