Whamcloud - gitweb
LU-1484 lprocfs: handle hidden proc_dir_entry users
authorAndreas Dilger <andreas.dilger@intel.com>
Sat, 2 Feb 2013 00:22:13 +0000 (17:22 -0700)
committerJohann Lombardi <johann.lombardi@intel.com>
Tue, 5 Feb 2013 13:51:44 +0000 (08:51 -0500)
commit2bf1c514b3576acfe4115b6ecb2a5b9fefae052a
tree49ed7bb80035395af7baafc021b0bdbc87a38cee
parent3480bb04a0e4697880e7644a4e51f84ea7f7cdbe
LU-1484 lprocfs: handle hidden proc_dir_entry users

The RHEL 5.9 2.6.18-348.1.1.el5 kernel uses both the new style
"pde_users" and the old style "deleted" flags for marking a
proc_dir_entry as deleted.  Unfortunately, the new "pde_users"
data is hidden in an external structure that is not visible to
the callers or in the headers (for binary compatibility I guess?)
so our configure checks cannot find it.

Instead, just check for proc_fops == NULL in a racy manner on
such kernels, since we cannot do locking and the locking is
mostly just needed as a memory barrier since pde_fops could
become NULL at any time after dropping the lock.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I05cae305e24ffff09a06e3ad17c28c175c3ebbe5
Reviewed-on: http://review.whamcloud.com/5253
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
lustre/include/lprocfs_status.h
lustre/obdclass/lprocfs_status.c