From 73d0dcc6cbf5ff80ebe8634091f9d887d7b94623 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Wed, 18 Sep 2024 22:24:42 -0400 Subject: [PATCH] LU-18231 obd: Add a bitmap for the flags We will use this bitmap and convert the current bitfields into bits that are set/cleared/tested using atomic bit operations. Signed-off-by: Ronnie Sahlberg Change-Id: I59ee4621926d0bd79ed0187f6058b888e40315f4 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56412 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin Reviewed-by: Timothy Day Reviewed-by: Andreas Dilger --- lustre/include/obd.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 1e60378..d12a0ae 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -593,6 +593,11 @@ struct obd_llog_group { spinlock_t olg_lock; }; +/* Obd flag bits */ +enum { + OBDF_NUM_FLAGS, +}; + /* corresponds to one of the obd's */ #define OBD_DEVICE_MAGIC 0XAB5CD6EF @@ -607,6 +612,7 @@ struct obd_device { char obd_name[MAX_OBD_NAME]; /* bitfield modification is protected by obd_dev_lock */ + DECLARE_BITMAP(obd_flags, OBDF_NUM_FLAGS); unsigned long obd_attached:1, /* finished attach */ obd_set_up:1, /* finished setup */ -- 1.8.3.1