Whamcloud - gitweb
LU-16118 build: Use pde_data() when available 63/48363/9
authorShaun Tancheff <shaun.tancheff@hpe.com>
Sat, 12 Nov 2022 09:29:42 +0000 (03:29 -0600)
committerOleg Drokin <green@whamcloud.com>
Sat, 7 Jan 2023 07:53:55 +0000 (07:53 +0000)
Linux commit v5.16-11573-g6dfbbae14a7b
   introduce pde_data() and
Linux commit v5.16-11574-g359745d78351
   remove PDE_DATA()

Use PDE_DATA() when pde_data is not available.

Test-Parameters: trivial
HPE-bug-id: LUS-11193
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: Ida570462acd466a251adc81a14bc1fbf35d96b00
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/48363
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
14 files changed:
libcfs/autoconf/lustre-libcfs.m4
lnet/klnds/gnilnd/gnilnd_proc.c
lustre/include/lprocfs_status.h
lustre/lmv/lproc_lmv.c
lustre/lod/lod_pool.c
lustre/lod/lproc_lod.c
lustre/lov/lov_pool.c
lustre/lov/lproc_lov.c
lustre/mdt/mdt_lproc.c
lustre/obdclass/lprocfs_jobstats.c
lustre/obdclass/lprocfs_status.c
lustre/obdclass/lprocfs_status_server.c
lustre/ptlrpc/nodemap_lproc.c
lustre/quota/lproc_quota.c

index 459ca0d..7a533ad 100644 (file)
@@ -1982,6 +1982,30 @@ EXTRA_KCFLAGS="$tmp_flags"
 ]) # LIBCFS_LINUX_BLK_INTEGRITY_HEADER
 
 #
+# LIBCFS_PDE_DATA_EXISTS
+#
+# Linux commit v5.16-11573-g6dfbbae14a7b
+#    introduce pde_data()
+# Linux commit v5.16-11574-g359745d78351
+#    remove PDE_DATA()
+#
+AC_DEFUN([LIBCFS_PDE_DATA_EXISTS],[
+LB_CHECK_COMPILE([does function 'pde_data' exist],
+pde_data, [
+               #include <linux/proc_fs.h>
+       ],[
+               struct inode *inode = NULL;
+               void *data =pde_data(inode);
+               (void)data;
+       ],[
+               AC_DEFINE(HAVE_pde_data, 1, [function pde_data() available])
+       ],[
+               AC_DEFINE(pde_data(inode), PDE_DATA(inode),
+                         [function pde_data() unavailable])
+       ])
+]) # LIBCFS_PDE_DATA_EXISTS
+
+#
 # LIBCFS_PROG_LINUX
 #
 # LibCFS linux kernel checks
@@ -2130,6 +2154,8 @@ LIBCFS_HAVE_PANIC_NOTIFIER_HEADER
 # 5.15
 LIBCFS_PARAM_SET_UINT_MINMAX
 LIBCFS_LINUX_BLK_INTEGRITY_HEADER
+# 5.17
+LIBCFS_PDE_DATA_EXISTS
 ]) # LIBCFS_PROG_LINUX
 
 #
index 901392f..c1e9c23 100644 (file)
@@ -192,7 +192,7 @@ kgnilnd_proc_cksum_test_write(struct file *file, const char __user *ubuffer,
 static int
 kgnilnd_cksum_test_seq_open(struct inode *inode, struct file *file)
 {
-       return single_open(file, NULL, PDE_DATA(inode));
+       return single_open(file, NULL, pde_data(inode));
 }
 
 static const struct file_operations kgn_cksum_test_fops = {
@@ -337,7 +337,7 @@ kgnilnd_proc_stats_write(struct file *file, const char __user *ubuffer,
 static int
 kgnilnd_stats_seq_open(struct inode *inode, struct file *file)
 {
-       return single_open(file, kgnilnd_stats_seq_show, PDE_DATA(inode));
+       return single_open(file, kgnilnd_stats_seq_show, pde_data(inode));
 }
 
 static const struct file_operations kgn_stats_fops = {
@@ -729,7 +729,7 @@ kgnilnd_smsg_seq_open(struct inode *inode, struct file *file)
        rc = seq_open(file, &kgn_smsg_sops);
        if (rc == 0) {
                sf = file->private_data;
-               sf->private = PDE_DATA(inode);
+               sf->private = pde_data(inode);
        }
 
        return rc;
@@ -1060,7 +1060,7 @@ static int
 kgnilnd_peer_conns_seq_open(struct inode *inode, struct file *file)
 {
        return single_open(file, kgnilnd_proc_peer_conns_seq_show,
-                          PDE_DATA(inode));
+                          pde_data(inode));
 }
 
 static const struct file_operations kgn_peer_conns_fops = {
@@ -1081,7 +1081,7 @@ kgnilnd_conn_seq_open(struct inode *inode, struct file *file)
        rc = seq_open(file, &kgn_conn_sops);
        if (rc == 0) {
                sf = file->private_data;
-               sf->private = PDE_DATA(inode);
+               sf->private = pde_data(inode);
        }
 
        return rc;
@@ -1302,7 +1302,7 @@ kgnilnd_peer_seq_open(struct inode *inode, struct file *file)
        rc = seq_open(file, &kgn_peer_sops);
        if (rc == 0) {
                sf = file->private_data;
-               sf->private = PDE_DATA(inode);
+               sf->private = pde_data(inode);
        }
 
        return rc;
index 7231905..9d2d092 100644 (file)
@@ -794,7 +794,7 @@ static int name##_single_open(struct inode *inode, struct file *file)       \
 {                                                                      \
        return single_open(file, name##_seq_show,                       \
                           inode->i_private ? inode->i_private :        \
-                                             PDE_DATA(inode));         \
+                                             pde_data(inode));         \
 }                                                                      \
 static const struct proc_ops name##_fops = {                           \
        PROC_OWNER(THIS_MODULE)                                         \
@@ -841,7 +841,7 @@ static const struct proc_ops name##_fops = {                                \
        {                                                               \
                return single_open(file, NULL,                          \
                                   inode->i_private ? inode->i_private : \
-                                  PDE_DATA(inode));                    \
+                                  pde_data(inode));                    \
        }                                                               \
        static const struct proc_ops name##_##type##_fops = {           \
                .proc_open      = name##_##type##_open,                 \
index 3dee359..c2a5db2 100644 (file)
@@ -267,7 +267,7 @@ static int lmv_target_seq_open(struct inode *inode, struct file *file)
                 return rc;
 
        seq = file->private_data;
-       seq->private = PDE_DATA(inode);
+       seq->private = pde_data(inode);
        return 0;
 }
 
index 8ac5eb3..9db33cd 100644 (file)
@@ -312,7 +312,7 @@ static int pool_proc_open(struct inode *inode, struct file *file)
        rc = seq_open(file, &pool_proc_ops);
        if (!rc) {
                struct seq_file *seq = file->private_data;
-               seq->private = PDE_DATA(inode);
+               seq->private = pde_data(inode);
        }
        return rc;
 }
index 2a164d8..d7004a3 100644 (file)
@@ -997,7 +997,7 @@ static int lod_mdts_seq_open(struct inode *inode, struct file *file)
                return rc;
 
        seq = file->private_data;
-       seq->private = PDE_DATA(inode);
+       seq->private = pde_data(inode);
        return 0;
 }
 
@@ -1011,7 +1011,7 @@ static int lod_osts_seq_open(struct inode *inode, struct file *file)
                return rc;
 
        seq = file->private_data;
-       seq->private = PDE_DATA(inode);
+       seq->private = pde_data(inode);
        return 0;
 }
 
index 500846f..afccd05 100644 (file)
@@ -218,7 +218,7 @@ static int pool_proc_open(struct inode *inode, struct file *file)
         rc = seq_open(file, &pool_proc_ops);
         if (!rc) {
                 struct seq_file *s = file->private_data;
-               s->private = PDE_DATA(inode);
+               s->private = pde_data(inode);
         }
         return rc;
 }
index 3898868..ac73581 100644 (file)
@@ -252,7 +252,7 @@ static int lov_target_seq_open(struct inode *inode, struct file *file)
                return rc;
 
        seq = file->private_data;
-       seq->private = PDE_DATA(inode);
+       seq->private = pde_data(inode);
        return 0;
 }
 
index 8ca3a52..64be129 100644 (file)
@@ -1607,7 +1607,7 @@ int lprocfs_mdt_open_files_seq_open(struct inode *inode, struct file *file)
                return rc;
 
        seq = file->private_data;
-       seq->private = PDE_DATA(inode);
+       seq->private = pde_data(inode);
 
        return 0;
 }
index 3ea1550..757099f 100644 (file)
@@ -549,7 +549,7 @@ static int lprocfs_jobstats_seq_open(struct inode *inode, struct file *file)
        if (rc)
                return rc;
        seq = file->private_data;
-       seq->private = PDE_DATA(inode);
+       seq->private = pde_data(inode);
        return 0;
 }
 
index af73986..6c25239 100644 (file)
@@ -1462,7 +1462,7 @@ static int lprocfs_stats_seq_open(struct inode *inode, struct file *file)
        if (rc)
                return rc;
        seq = file->private_data;
-       seq->private = inode->i_private ? inode->i_private : PDE_DATA(inode);
+       seq->private = inode->i_private ? inode->i_private : pde_data(inode);
        return 0;
 }
 
index 5dbb806..423971e 100644 (file)
@@ -83,7 +83,7 @@ EXPORT_SYMBOL(ldebugfs_add_symlink);
 
 int lprocfs_evict_client_open(struct inode *inode, struct file *f)
 {
-       struct obd_device *obd = PDE_DATA(file_inode(f));
+       struct obd_device *obd = pde_data(file_inode(f));
 
        atomic_inc(&obd->obd_evict_inprogress);
        return 0;
@@ -91,7 +91,7 @@ int lprocfs_evict_client_open(struct inode *inode, struct file *f)
 
 int lprocfs_evict_client_release(struct inode *inode, struct file *f)
 {
-       struct obd_device *obd = PDE_DATA(file_inode(f));
+       struct obd_device *obd = pde_data(file_inode(f));
 
        atomic_dec(&obd->obd_evict_inprogress);
        wake_up(&obd->obd_evict_inprogress_waitq);
index ec55dee..795d3bb 100644 (file)
@@ -115,7 +115,7 @@ static int nodemap_idmap_show(struct seq_file *m, void *data)
  */
 static int nodemap_idmap_open(struct inode *inode, struct file *file)
 {
-       return single_open(file, nodemap_idmap_show, PDE_DATA(inode));
+       return single_open(file, nodemap_idmap_show, pde_data(inode));
 }
 
 /**
@@ -173,7 +173,7 @@ static int nodemap_ranges_show(struct seq_file *m, void *data)
  */
 static int nodemap_ranges_open(struct inode *inode, struct file *file)
 {
-       return single_open(file, nodemap_ranges_show, PDE_DATA(inode));
+       return single_open(file, nodemap_ranges_show, pde_data(inode));
 }
 
 /**
@@ -372,7 +372,7 @@ static int nodemap_exports_show(struct seq_file *m, void *data)
  */
 static int nodemap_exports_open(struct inode *inode, struct file *file)
 {
-       return single_open(file, nodemap_exports_show, PDE_DATA(inode));
+       return single_open(file, nodemap_exports_show, pde_data(inode));
 }
 
 /**
index 651ed88..28bbff8 100644 (file)
@@ -285,7 +285,7 @@ static int lprocfs_quota_seq_open(struct inode *inode, struct file *file)
                return -ENOMEM;
 
        /* store pointer to object we would like to iterate over */
-       lqp->lqp_obj = (struct dt_object *)PDE_DATA(inode);
+       lqp->lqp_obj = (struct dt_object *)pde_data(inode);
 
        /* Initialize the common environment to be used in the seq operations */
        rc = lu_env_init(&lqp->lqp_env, LCT_LOCAL);