Show
Ignore:
Timestamp:
04/23/12 15:09:16 (14 months ago)
Author:
wolf
Message:

added additional checks related to linux 3.x support

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/stable/maint/config/kernel.m4

    r9036 r9291  
    817817        ) 
    818818 
    819         dnl generic_permission in 2.6.38 and newer has a four parameter  
    820         dnl signature 
     819        dnl generic_permission in < 2.6.38 has three parameters 
     820        tmp_cflags=$CFLAGS 
     821        CFLAGS="$CFLAGS -Werror" 
     822        AC_MSG_CHECKING(for three-param generic_permission) 
     823        AC_TRY_COMPILE([ 
     824                #define __KERNEL__ 
     825                #include <linux/fs.h> 
     826                struct inode *f; 
     827        ],  
     828        [  
     829                generic_permission(f, 0, NULL); 
     830        ], 
     831        AC_MSG_RESULT(yes) 
     832        AC_DEFINE(HAVE_THREE_PARAM_GENERIC_PERMISSION, 1, [Define if generic_permission takes three parameters]), 
     833        AC_MSG_RESULT(no) 
     834        ) 
     835 
     836        dnl generic_permission in >= 2.6.38 and 3.0.x has four parameters 
    821837        tmp_cflags=$CFLAGS 
    822838        CFLAGS="$CFLAGS -Werror" 
     
    834850        AC_MSG_RESULT(no) 
    835851        ) 
     852 
     853        dnl generic_permission in >= 3.1.x has two parameters 
     854        tmp_cflags=$CFLAGS 
     855        CFLAGS="$CFLAGS -Werror" 
     856        AC_MSG_CHECKING(for two-param generic_permission) 
     857        AC_TRY_COMPILE([ 
     858                #define __KERNEL__ 
     859                #include <linux/fs.h> 
     860                struct inode *f; 
     861        ],  
     862        [  
     863                generic_permission(f, 0); 
     864        ], 
     865        AC_MSG_RESULT(yes) 
     866        AC_DEFINE(HAVE_TWO_PARAM_GENERIC_PERMISSION, 1, [Define if generic_permission takes two parameters]), 
     867        AC_MSG_RESULT(no) 
     868        ) 
     869 
     870        dnl set_nlink is defined in 3.2.x  
     871        tmp_cflags=$CFLAGS 
     872        CFLAGS="$CFLAGS -Werror" 
     873        AC_MSG_CHECKING(for set_nlink) 
     874        AC_TRY_COMPILE([ 
     875                #define __KERNEL__ 
     876                #include <linux/fs.h> 
     877                struct inode *i; 
     878        ],  
     879        [ 
     880                set_nlink(i, 0); 
     881        ], 
     882        AC_MSG_RESULT(yes) 
     883        AC_DEFINE(HAVE_I_SET_NLINK, 1, [Define if set_nlink exists]), 
     884        AC_MSG_RESULT(no) 
     885        ) 
     886 
     887        dnl inc_nlink is defined in 3.2.x  
     888        tmp_cflags=$CFLAGS 
     889        CFLAGS="$CFLAGS -Werror" 
     890        AC_MSG_CHECKING(for inc_nlink) 
     891        AC_TRY_COMPILE([ 
     892                #define __KERNEL__ 
     893                #include <linux/fs.h> 
     894                struct inode *i; 
     895        ],  
     896        [ 
     897                inc_nlink(i); 
     898        ],  
     899        AC_MSG_RESULT(yes) 
     900        AC_DEFINE(HAVE_I_INC_NLINK, 1, [Define if inc_nlink exists]), 
     901        AC_MSG_RESULT(no) 
     902        ) 
     903 
     904        dnl drop_nlink is defined in 3.2.x  
     905        tmp_cflags=$CFLAGS 
     906        CFLAGS="$CFLAGS -Werror" 
     907        AC_MSG_CHECKING(for drop_nlink) 
     908        AC_TRY_COMPILE([ 
     909                #define __KERNEL__ 
     910                #include <linux/fs.h> 
     911                struct inode *i; 
     912        ],  
     913        [ 
     914                drop_nlink(i); 
     915        ],  
     916        AC_MSG_RESULT(yes) 
     917        AC_DEFINE(HAVE_I_DROP_NLINK, 1, [Define if drop_nlink exists]), 
     918        AC_MSG_RESULT(no) 
     919        ) 
     920 
     921        dnl clear_nlink is defined in 3.2.x  
     922        tmp_cflags=$CFLAGS 
     923        CFLAGS="$CFLAGS -Werror" 
     924        AC_MSG_CHECKING(for clear_nlink) 
     925        AC_TRY_COMPILE([ 
     926                #define __KERNEL__ 
     927                #include <linux/fs.h> 
     928                struct inode *i; 
     929        ],  
     930        [ 
     931                clear_nlink(i); 
     932        ],  
     933        AC_MSG_RESULT(yes) 
     934        AC_DEFINE(HAVE_I_CLEAR_NLINK, 1, [Define if clear_nlink exists]), 
     935        AC_MSG_RESULT(no) 
     936        ) 
     937 
     938        dnl check for posix_acl_equiv_mode umode_t type   
     939        tmp_cflags=$CFLAGS 
     940        CFLAGS="$CFLAGS -Werror" 
     941        AC_MSG_CHECKING(for posix_acl_equiv_mode umode_t) 
     942        AC_TRY_COMPILE([ 
     943                #define __KERNEL__ 
     944                #include <linux/fs.h> 
     945                #include <linux/posix_acl.h> 
     946                struct posix_acl *acl; 
     947                umode_t mode = 0; 
     948        ], 
     949        [ 
     950                posix_acl_equiv_mode(acl, &mode); 
     951        ],  
     952        AC_MSG_RESULT(yes) 
     953        AC_DEFINE(HAVE_POSIX_ACL_EQUIV_MODE_UMODE_T, 1, [Define if posix_acl_equiv_mode accepts umode_t type]), 
     954        AC_MSG_RESULT(no) 
     955        ) 
     956 
     957        dnl check for posix_acl_create 
     958        tmp_cflags=$CFLAGS 
     959        CFLAGS="$CFLAGS -Werror" 
     960        AC_MSG_CHECKING(for posix_acl_create) 
     961        AC_TRY_COMPILE([ 
     962                #define __KERNEL__ 
     963                #include <linux/fs.h> 
     964                #include <linux/posix_acl.h> 
     965                struct posix_acl *acl; 
     966                umode_t mode = 0; 
     967        ], 
     968        [ 
     969                posix_acl_create(&acl, GFP_KERNEL, &mode); 
     970        ],  
     971        AC_MSG_RESULT(yes) 
     972        AC_DEFINE(HAVE_POSIX_ACL_CREATE, 1, [Define if posix_acl_create_masq accepts umode_t type]), 
     973        AC_MSG_RESULT(no) 
     974        ) 
     975 
     976        dnl check for posix_acl_chmod 
     977        tmp_cflags=$CFLAGS 
     978        CFLAGS="$CFLAGS -Werror" 
     979        AC_MSG_CHECKING(for posix_acl_chmod) 
     980        AC_TRY_COMPILE([ 
     981                #define __KERNEL__ 
     982                #include <linux/fs.h> 
     983                #include <linux/posix_acl.h> 
     984                struct posix_acl *acl; 
     985                struct inode *inode; 
     986                umode_t mode = 0; 
     987        ], 
     988        [ 
     989                posix_acl_chmod(&acl, GFP_KERNEL, inode->i_mode ); 
     990        ],  
     991        AC_MSG_RESULT(yes) 
     992        AC_DEFINE(HAVE_POSIX_ACL_CHMOD, 1, [Define if posix_acl_chmod exists]), 
     993        AC_MSG_RESULT(no) 
     994        ) 
     995 
     996 
     997        dnl check for posix_acl_clone 
     998        tmp_cflags=$CFLAGS 
     999        CFLAGS="$CFLAGS -Werror" 
     1000        AC_MSG_CHECKING(for posix_acl_clone) 
     1001        AC_TRY_COMPILE([ 
     1002                #define __KERNEL__ 
     1003                #include <linux/fs.h> 
     1004                #include <linux/posix_acl.h> 
     1005                struct posix_acl *acl; 
     1006        ], 
     1007        [ 
     1008                posix_acl_clone(acl, GFP_KERNEL); 
     1009        ],  
     1010        AC_MSG_RESULT(yes) 
     1011        AC_DEFINE(HAVE_POSIX_ACL_CLONE, 1, [Define if posix_acl_clone exists]), 
     1012        AC_MSG_RESULT(no) 
     1013        ) 
     1014 
     1015        dnl check for fsync with loff_t   
     1016        tmp_cflags=$CFLAGS 
     1017        CFLAGS="$CFLAGS -Werror" 
     1018        AC_MSG_CHECKING(for fsync with loff_t) 
     1019        AC_TRY_COMPILE([ 
     1020                #define __KERNEL__ 
     1021                #include <linux/fs.h> 
     1022 
     1023                int my_fsync(struct file *, loff_t, loff_t, int); 
     1024 
     1025                int my_fsync(struct file *f, loff_t start, loff_t end, int datasync) 
     1026                { 
     1027                } 
     1028        ], 
     1029        [ 
     1030                struct file_operations fop; 
     1031                 
     1032                fop.fsync = my_fsync; 
     1033        ],  
     1034        AC_MSG_RESULT(yes) 
     1035        AC_DEFINE(HAVE_FSYNC_LOFF_T_PARAMS, 1, [Define if fsync has loff_t params]), 
     1036        AC_MSG_RESULT(no) 
     1037        ) 
     1038 
    8361039 
    8371040        AC_MSG_CHECKING(for generic_getxattr api in kernel) 
     
    8411044                #define __KERNEL__ 
    8421045                #include <linux/fs.h> 
    843                                 #include <linux/xattr.h> 
     1046                #include <linux/xattr.h> 
    8441047                int generic_getxattr(struct inode *inode) 
    8451048                {