1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright (C) 2018 Samsung Electronics Co., Ltd.
8 static inline int __acquire_id(struct ida *ida, int from, int to)
10 return ida_simple_get(ida, from, to, GFP_KERNEL);
13 int ksmbd_acquire_smb2_tid(struct ida *ida)
17 id = __acquire_id(ida, 1, 0xFFFFFFFF);
22 int ksmbd_acquire_smb2_uid(struct ida *ida)
26 id = __acquire_id(ida, 1, 0);
28 id = __acquire_id(ida, 1, 0);
33 int ksmbd_acquire_async_msg_id(struct ida *ida)
35 return __acquire_id(ida, 1, 0);
38 int ksmbd_acquire_id(struct ida *ida)
40 return __acquire_id(ida, 0, 0);
43 void ksmbd_release_id(struct ida *ida, int id)
45 ida_simple_remove(ida, id);