Whamcloud - gitweb
LU-11783 utils: fix warnings when lustre_user.h included 64/34064/2
authorAndreas Dilger <adilger@whamcloud.com>
Fri, 14 Dec 2018 22:53:25 +0000 (15:53 -0700)
committerOleg Drokin <green@whamcloud.com>
Fri, 15 Feb 2019 01:28:28 +0000 (01:28 +0000)
commit3cf95c0bd388489c75382083a5b9a9b99d769415
tree16c3d4682a9dfde6749950692dfb525b8c34ebb5
parent25cde5b5b0dbedfba5227752169313004ebbcd35
LU-11783 utils: fix warnings when lustre_user.h included

Checking for lustre/lustre_user.h in a configure script
generates a warning because of the included <sys/quota.h>

  checking lustre/lustre_user.h usability... no
  checking lustre/lustre_user.h presence... yes
  WARNING: present but cannot be compiled
  WARNING: check for missing prerequisite headers?
  WARNING: see the Autoconf documentation
  WARNING: section "Present But Cannot Be Compiled"
  WARNING: proceeding with the preprocessor's result
  WARNING: in the future, the compiler will take precedence

Looking into config.log it shows:

  In file included from /usr/include/lustre/lustre_user.h:59,
                   from conftest.c:91:
  /usr/include/sys/quota.h:221: error: expected declaration
    specifiers or '...' before 'caddr_t'

Since we don't really need much from the <sys/quota.h> header,
add conditional #defines for the few needed fields.

The FASYNC constant is not declared everywhere in userspace,
provide a compat declaration if unavailable.

Lustre-change: https://review.whamcloud.com/33876
Lustre-commit: db0592145574c5ad22a7b7372b06ba2da7d85a60

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I9cd2b0fcbaf16fe8a5a4a7a0309aada3a72cab07
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34064
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/lustre/lustre_user.h