Skip to content

Commit 01c7a59

Browse files
Alexander Aringteigland
authored andcommitted
fs: dlm: remove deprecated code parts
This patch removes code parts which was declared deprecated by commit 6b0afc0 ("fs: dlm: don't use deprecated timeout features by default"). This contains the following dlm functionality: - start a cancel of a dlm request did not complete after certain timeout: The current way how dlm cancellation works and interfering with other dlm requests triggered by the user can end in an overlapping and returning in -EBUSY. The most user don't handle this case and are unaware that DLM can return such errno in such situation. Due the timeout the user are mostly unaware when this happens. - start a netlink warning messages for user space if dlm requests did not complete after certain timeout: This feature was never being built in the only known dlm user space side. As we are to remove the timeout cancellation feature we can directly remove this feature as well. There might be the possibility to bring the timeout cancellation feature back. However the current way of handling the -EBUSY case which is only a software limitation and not a hardware limitation should be changed. We minimize the current code base in DLM cancellation feature to not have to deal with those existing features while solving the DLM cancellation feature in general. UAPI define DLM_LSFL_TIMEWARN is commented as deprecated and reserved value. We should avoid at first to give it a new meaning but let possible users still compile by keeping this define. In far future we can give this flag a new meaning. The same for the DLM_LKF_TIMEOUT lock request flag. Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
1 parent 7386457 commit 01c7a59

16 files changed

Lines changed: 6 additions & 533 deletions

File tree

fs/dlm/Kconfig

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,6 @@ menuconfig DLM
88
A general purpose distributed lock manager for kernel or userspace
99
applications.
1010

11-
config DLM_DEPRECATED_API
12-
bool "DLM deprecated API"
13-
depends on DLM
14-
help
15-
Enables deprecated DLM timeout features that will be removed in
16-
later Linux kernel releases.
17-
18-
If you are unsure, say N.
19-
2011
config DLM_DEBUG
2112
bool "DLM debugging"
2213
depends on DLM

fs/dlm/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ dlm-y := ast.o \
1717
requestqueue.o \
1818
user.o \
1919
util.o
20-
dlm-$(CONFIG_DLM_DEPRECATED_API) += netlink.o
2120
dlm-$(CONFIG_DLM_DEBUG) += debug_fs.o
2221

fs/dlm/config.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ struct dlm_cluster {
7575
unsigned int cl_log_info;
7676
unsigned int cl_protocol;
7777
unsigned int cl_mark;
78-
#ifdef CONFIG_DLM_DEPRECATED_API
79-
unsigned int cl_timewarn_cs;
80-
#endif
8178
unsigned int cl_new_rsb_count;
8279
unsigned int cl_recover_callbacks;
8380
char cl_cluster_name[DLM_LOCKSPACE_LEN];
@@ -103,9 +100,6 @@ enum {
103100
CLUSTER_ATTR_LOG_INFO,
104101
CLUSTER_ATTR_PROTOCOL,
105102
CLUSTER_ATTR_MARK,
106-
#ifdef CONFIG_DLM_DEPRECATED_API
107-
CLUSTER_ATTR_TIMEWARN_CS,
108-
#endif
109103
CLUSTER_ATTR_NEW_RSB_COUNT,
110104
CLUSTER_ATTR_RECOVER_CALLBACKS,
111105
CLUSTER_ATTR_CLUSTER_NAME,
@@ -226,9 +220,6 @@ CLUSTER_ATTR(log_debug, NULL);
226220
CLUSTER_ATTR(log_info, NULL);
227221
CLUSTER_ATTR(protocol, dlm_check_protocol_and_dlm_running);
228222
CLUSTER_ATTR(mark, NULL);
229-
#ifdef CONFIG_DLM_DEPRECATED_API
230-
CLUSTER_ATTR(timewarn_cs, dlm_check_zero);
231-
#endif
232223
CLUSTER_ATTR(new_rsb_count, NULL);
233224
CLUSTER_ATTR(recover_callbacks, NULL);
234225

@@ -243,9 +234,6 @@ static struct configfs_attribute *cluster_attrs[] = {
243234
[CLUSTER_ATTR_LOG_INFO] = &cluster_attr_log_info,
244235
[CLUSTER_ATTR_PROTOCOL] = &cluster_attr_protocol,
245236
[CLUSTER_ATTR_MARK] = &cluster_attr_mark,
246-
#ifdef CONFIG_DLM_DEPRECATED_API
247-
[CLUSTER_ATTR_TIMEWARN_CS] = &cluster_attr_timewarn_cs,
248-
#endif
249237
[CLUSTER_ATTR_NEW_RSB_COUNT] = &cluster_attr_new_rsb_count,
250238
[CLUSTER_ATTR_RECOVER_CALLBACKS] = &cluster_attr_recover_callbacks,
251239
[CLUSTER_ATTR_CLUSTER_NAME] = &cluster_attr_cluster_name,
@@ -436,9 +424,6 @@ static struct config_group *make_cluster(struct config_group *g,
436424
cl->cl_log_debug = dlm_config.ci_log_debug;
437425
cl->cl_log_info = dlm_config.ci_log_info;
438426
cl->cl_protocol = dlm_config.ci_protocol;
439-
#ifdef CONFIG_DLM_DEPRECATED_API
440-
cl->cl_timewarn_cs = dlm_config.ci_timewarn_cs;
441-
#endif
442427
cl->cl_new_rsb_count = dlm_config.ci_new_rsb_count;
443428
cl->cl_recover_callbacks = dlm_config.ci_recover_callbacks;
444429
memcpy(cl->cl_cluster_name, dlm_config.ci_cluster_name,
@@ -959,9 +944,6 @@ int dlm_our_addr(struct sockaddr_storage *addr, int num)
959944
#define DEFAULT_LOG_INFO 1
960945
#define DEFAULT_PROTOCOL DLM_PROTO_TCP
961946
#define DEFAULT_MARK 0
962-
#ifdef CONFIG_DLM_DEPRECATED_API
963-
#define DEFAULT_TIMEWARN_CS 500 /* 5 sec = 500 centiseconds */
964-
#endif
965947
#define DEFAULT_NEW_RSB_COUNT 128
966948
#define DEFAULT_RECOVER_CALLBACKS 0
967949
#define DEFAULT_CLUSTER_NAME ""
@@ -977,9 +959,6 @@ struct dlm_config_info dlm_config = {
977959
.ci_log_info = DEFAULT_LOG_INFO,
978960
.ci_protocol = DEFAULT_PROTOCOL,
979961
.ci_mark = DEFAULT_MARK,
980-
#ifdef CONFIG_DLM_DEPRECATED_API
981-
.ci_timewarn_cs = DEFAULT_TIMEWARN_CS,
982-
#endif
983962
.ci_new_rsb_count = DEFAULT_NEW_RSB_COUNT,
984963
.ci_recover_callbacks = DEFAULT_RECOVER_CALLBACKS,
985964
.ci_cluster_name = DEFAULT_CLUSTER_NAME

fs/dlm/config.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ struct dlm_config_info {
3737
int ci_log_info;
3838
int ci_protocol;
3939
int ci_mark;
40-
#ifdef CONFIG_DLM_DEPRECATED_API
41-
int ci_timewarn_cs;
42-
#endif
4340
int ci_new_rsb_count;
4441
int ci_recover_callbacks;
4542
char ci_cluster_name[DLM_LOCKSPACE_LEN];

fs/dlm/dlm_internal.h

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,6 @@ struct dlm_args {
145145
void (*bastfn) (void *astparam, int mode);
146146
int mode;
147147
struct dlm_lksb *lksb;
148-
#ifdef CONFIG_DLM_DEPRECATED_API
149-
unsigned long timeout;
150-
#endif
151148
};
152149

153150

@@ -205,10 +202,6 @@ struct dlm_args {
205202
#define DLM_IFL_OVERLAP_UNLOCK 0x00080000
206203
#define DLM_IFL_OVERLAP_CANCEL 0x00100000
207204
#define DLM_IFL_ENDOFLIFE 0x00200000
208-
#ifdef CONFIG_DLM_DEPRECATED_API
209-
#define DLM_IFL_WATCH_TIMEWARN 0x00400000
210-
#define DLM_IFL_TIMEOUT_CANCEL 0x00800000
211-
#endif
212205
#define DLM_IFL_DEADLOCK_CANCEL 0x01000000
213206
#define DLM_IFL_STUB_MS 0x02000000 /* magic number for m_flags */
214207

@@ -266,11 +259,6 @@ struct dlm_lkb {
266259
struct list_head lkb_ownqueue; /* list of locks for a process */
267260
ktime_t lkb_timestamp;
268261

269-
#ifdef CONFIG_DLM_DEPRECATED_API
270-
struct list_head lkb_time_list;
271-
unsigned long lkb_timeout_cs;
272-
#endif
273-
274262
spinlock_t lkb_cb_lock;
275263
struct work_struct lkb_cb_work;
276264
struct list_head lkb_cb_list; /* for ls_cb_delay or proc->asts */
@@ -586,11 +574,6 @@ struct dlm_ls {
586574
struct mutex ls_orphans_mutex;
587575
struct list_head ls_orphans;
588576

589-
#ifdef CONFIG_DLM_DEPRECATED_API
590-
struct mutex ls_timeout_mutex;
591-
struct list_head ls_timeout;
592-
#endif
593-
594577
spinlock_t ls_new_rsb_spin;
595578
int ls_new_rsb_count;
596579
struct list_head ls_new_rsb; /* new rsb structs */
@@ -704,9 +687,6 @@ struct dlm_ls {
704687
#define LSFL_RCOM_READY 5
705688
#define LSFL_RCOM_WAIT 6
706689
#define LSFL_UEVENT_WAIT 7
707-
#ifdef CONFIG_DLM_DEPRECATED_API
708-
#define LSFL_TIMEWARN 8
709-
#endif
710690
#define LSFL_CB_DELAY 9
711691
#define LSFL_NODIR 10
712692

@@ -759,15 +739,6 @@ static inline int dlm_no_directory(struct dlm_ls *ls)
759739
return test_bit(LSFL_NODIR, &ls->ls_flags);
760740
}
761741

762-
#ifdef CONFIG_DLM_DEPRECATED_API
763-
int dlm_netlink_init(void);
764-
void dlm_netlink_exit(void);
765-
void dlm_timeout_warn(struct dlm_lkb *lkb);
766-
#else
767-
static inline int dlm_netlink_init(void) { return 0; }
768-
static inline void dlm_netlink_exit(void) { };
769-
static inline void dlm_timeout_warn(struct dlm_lkb *lkb) { };
770-
#endif
771742
int dlm_plock_init(void);
772743
void dlm_plock_exit(void);
773744

0 commit comments

Comments
 (0)