VirtualBox

忽略:
時間撮記:
2020-8-11 下午05:05:29 (5 年 以前)
作者:
vboxsync
svn:sync-xref-src-repo-rev:
139838
訊息:

IPRT,lnx-kmods: Use new linux kernel version checking macros. Moved them to separate wrapper header.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Additions/linux/sharedfolders/lnkops.c

    r82968 r85698  
    108108}
    109109
    110 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
     110#if RTLNX_VER_MIN(4,5,0)
    111111
    112112/**
     
    147147#else /* < 4.5 */
    148148
    149 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 8)
     149# if RTLNX_VER_MAX(2,6,8)
    150150/**
    151151 * Reads the link into the given buffer.
     
    183183 * Follow link in dentry.
    184184 */
    185 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
     185# if RTLNX_VER_MIN(4,2,0)
    186186static const char *vbsf_follow_link(struct dentry *dentry, void **cookie)
    187 # elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
     187# elif RTLNX_VER_MIN(2,6,13)
    188188static void       *vbsf_follow_link(struct dentry *dentry, struct nameidata *nd)
    189189# else
     
    213213                 */
    214214                vbsf_dentry_chain_increase_ttl(dentry);
    215 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
     215# if RTLNX_VER_MIN(4,2,0)
    216216                *cookie = pszTarget;
    217217                return pszTarget;
    218 # elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8)
     218# elif RTLNX_VER_MIN(2,6,8)
    219219                nd_set_link(nd, pszTarget);
    220 #  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
     220#  if RTLNX_VER_MIN(2,6,13)
    221221                return NULL;
    222222#  else
     
    241241        rc = -ENOMEM;
    242242    }
    243 # if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
     243# if RTLNX_VER_MIN(4,2,0)
    244244    *cookie = ERR_PTR(rc);
    245245    return (const char *)ERR_PTR(rc);
    246 # elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8)
     246# elif RTLNX_VER_MIN(2,6,8)
    247247    nd_set_link(nd, (char *)ERR_PTR(rc));
    248 #  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
     248#  if RTLNX_VER_MIN(2,6,13)
    249249    return NULL;
    250250#  else
     
    256256}
    257257
    258 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8)
     258# if RTLNX_VER_MIN(2,6,8)
    259259/**
    260260 * For freeing target link buffer allocated by vbsf_follow_link.
     
    262262 * For kernels before 2.6.8 memory isn't being kept around.
    263263 */
    264 #  if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
     264#  if RTLNX_VER_MIN(4,2,0)
    265265static void vbsf_put_link(struct inode *inode, void *cookie)
    266 #  elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
     266#  elif RTLNX_VER_MIN(2,6,13)
    267267static void vbsf_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
    268268#  else
     
    270270#  endif
    271271{
    272 #  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13)
     272#  if RTLNX_VER_MIN(2,6,13)
    273273    char *page = cookie;
    274274#  else
     
    287287 */
    288288struct inode_operations vbsf_lnk_iops = {
    289 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
    290 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8)
     289#if RTLNX_VER_MAX(4,10,0)
     290# if RTLNX_VER_MIN(2,6,8)
    291291    .readlink    = generic_readlink,
    292292# else
     
    294294# endif
    295295#endif
    296 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
     296#if RTLNX_VER_MIN(4,5,0)
    297297    .get_link    = vbsf_get_link
    298298#else
    299299    .follow_link = vbsf_follow_link,
    300 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8)
     300# if RTLNX_VER_MIN(2,6,8)
    301301    .put_link    = vbsf_put_link,
    302302# endif
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette