From 68a155d30704c23227ad006c8dba64e53c571749 Mon Sep 17 00:00:00 2001 From: wangdi Date: Tue, 30 May 2006 17:10:52 +0000 Subject: [PATCH] Branch: b1_5 fix fc5 build problems in b1_5 --- lustre/include/linux/lustre_mds.h | 7 +++++- lustre/include/lustre_mds.h | 12 +++++++++- .../patches/vfs_intent-2.6-fc5.patch | 11 ++++++++- lustre/llite/llite_internal.h | 12 +++++++--- lustre/llite/lproc_llite.c | 2 ++ lustre/lvfs/fsfilt_ext3.c | 26 ++++++++++++++-------- lustre/mds/handler.c | 4 ++-- 7 files changed, 57 insertions(+), 17 deletions(-) diff --git a/lustre/include/linux/lustre_mds.h b/lustre/include/linux/lustre_mds.h index f805ae8..cb10f77 100644 --- a/lustre/include/linux/lustre_mds.h +++ b/lustre/include/linux/lustre_mds.h @@ -17,7 +17,12 @@ #ifdef __KERNEL__ # include # include -# include + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)) +#include +#else +#include +#endif #endif struct ldlm_lock_desc; diff --git a/lustre/include/lustre_mds.h b/lustre/include/lustre_mds.h index 3f7d238..78eff75 100644 --- a/lustre/include/lustre_mds.h +++ b/lustre/include/lustre_mds.h @@ -88,9 +88,19 @@ struct mds_file_data { /* ACL */ #ifdef CONFIG_FS_POSIX_ACL +#ifdef CONFIG_FS_POSIX_ACL +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)) +#define MDS_XATTR_NAME_ACL_ACCESS POSIX_ACL_XATTR_ACCESS +#define mds_xattr_acl_size(entry) posix_acl_xattr_size(entry) +#else +#define MDS_XATTR_NAME_ACL_ACCESS XATTR_NAME_ACL_ACCESS +#define mds_xattr_acl_size(entry) acl_xattr_size(entry) +#endif +#endif + #define LUSTRE_POSIX_ACL_MAX_ENTRIES (32) #define LUSTRE_POSIX_ACL_MAX_SIZE \ - (xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES)) + (mds_xattr_acl_size(LUSTRE_POSIX_ACL_MAX_ENTRIES)) #else #define LUSTRE_POSIX_ACL_MAX_SIZE 0 #endif diff --git a/lustre/kernel_patches/patches/vfs_intent-2.6-fc5.patch b/lustre/kernel_patches/patches/vfs_intent-2.6-fc5.patch index 485ab1a..f3e8901 100644 --- a/lustre/kernel_patches/patches/vfs_intent-2.6-fc5.patch +++ b/lustre/kernel_patches/patches/vfs_intent-2.6-fc5.patch @@ -615,7 +615,7 @@ Index: linux-2.6.16.i686/fs/exec.c Index: linux-2.6.16.i686/include/linux/dcache.h =================================================================== --- linux-2.6.16.i686.orig/include/linux/dcache.h 2006-05-30 15:47:11.000000000 +0800 -+++ linux-2.6.16.i686/include/linux/dcache.h 2006-05-30 23:42:41.000000000 +0800 ++++ linux-2.6.16.i686/include/linux/dcache.h 2006-05-31 00:52:42.000000000 +0800 @@ -4,6 +4,7 @@ #ifdef __KERNEL__ @@ -624,6 +624,15 @@ Index: linux-2.6.16.i686/include/linux/dcache.h #include #include #include +@@ -36,6 +37,8 @@ + const unsigned char *name; + }; + ++#include ++ + struct dentry_stat_t { + int nr_dentry; + int nr_unused; Index: linux-2.6.16.i686/include/linux/fs.h =================================================================== --- linux-2.6.16.i686.orig/include/linux/fs.h 2006-05-30 15:47:11.000000000 +0800 diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index f34079f..618b4ed 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -7,7 +7,11 @@ #ifdef CONFIG_FS_POSIX_ACL # include -# include +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)) +#include +#else +#include +#endif #endif #include @@ -24,13 +28,15 @@ struct lustre_intent_data { }; */ #define LL_IT2STR(it) ((it) ? ldlm_it2str((it)->it_op) : "0") - +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16)) +#define LUSTRE_FPRIVATE(file) ((file)->private_data) +#else #if (LUSTRE_KERNEL_VERSION < 46) #define LUSTRE_FPRIVATE(file) ((file)->private_data) #else #define LUSTRE_FPRIVATE(file) ((file)->fs_private) #endif - +#endif static inline struct lookup_intent *ll_nd2it(struct nameidata *nd) { diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index a2f90e4..7ed9b14 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -601,7 +601,9 @@ static int llite_dump_pgcache_seq_show(struct seq_file *seq, void *v) seq_page_flag(seq, page, referenced, has_flags); seq_page_flag(seq, page, uptodate, has_flags); seq_page_flag(seq, page, dirty, has_flags); +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12)) seq_page_flag(seq, page, highmem, has_flags); +#endif if (!has_flags) seq_puts(seq, "-]\n"); else diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index f6e3f67..5bf7a39 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -59,6 +59,14 @@ #include #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) +#define FSFILT_DATA_TRANS_BLOCKS(sb) EXT3_DATA_TRANS_BLOCKS +#define FSFILT_DELETE_TRANS_BLOCKS(sb) EXT3_DELETE_TRANS_BLOCKS +#else +#define FSFILT_DATA_TRANS_BLOCKS(sb) EXT3_DATA_TRANS_BLOCKS(sb) +#define FSFILT_DELETE_TRANS_BLOCKS(sb) EXT3_DELETE_TRANS_BLOCKS(sb) +#endif + static kmem_cache_t *fcb_cache; struct fsfilt_cb_data { @@ -140,7 +148,7 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private, case FSFILT_OP_RMDIR: case FSFILT_OP_UNLINK: /* delete one file + create/update logs for each stripe */ - nblocks += EXT3_DELETE_TRANS_BLOCKS; + nblocks += FSFILT_DELETE_TRANS_BLOCKS(inode->i_sb); nblocks += (EXT3_INDEX_EXTRA_TRANS_BLOCKS + EXT3_SINGLEDATA_TRANS_BLOCKS) * logs; break; @@ -177,7 +185,7 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private, case FSFILT_OP_LINK: /* modify parent directory */ nblocks += EXT3_INDEX_EXTRA_TRANS_BLOCKS + - EXT3_DATA_TRANS_BLOCKS; + FSFILT_DATA_TRANS_BLOCKS(inode->i_sb); /* create/update logs for each stripe */ nblocks += (EXT3_INDEX_EXTRA_TRANS_BLOCKS + EXT3_SINGLEDATA_TRANS_BLOCKS) * logs; @@ -186,7 +194,7 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private, /* Setattr on inode */ nblocks += 1; nblocks += EXT3_INDEX_EXTRA_TRANS_BLOCKS + - EXT3_DATA_TRANS_BLOCKS; + FSFILT_DATA_TRANS_BLOCKS(inode->i_sb); /* quota chown log for each stripe */ nblocks += (EXT3_INDEX_EXTRA_TRANS_BLOCKS + EXT3_SINGLEDATA_TRANS_BLOCKS) * logs; @@ -195,12 +203,12 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private, /* blocks for log header bitmap update OR * blocks for catalog header bitmap update + unlink of logs */ nblocks = (LLOG_CHUNK_SIZE >> inode->i_blkbits) + - EXT3_DELETE_TRANS_BLOCKS * logs; + FSFILT_DELETE_TRANS_BLOCKS(inode->i_sb) * logs; break; case FSFILT_OP_JOIN: /* delete 2 file(file + array id) + create 1 file (array id) * create/update logs for each stripe */ - nblocks += 2 * EXT3_DELETE_TRANS_BLOCKS; + nblocks += 2 * FSFILT_DELETE_TRANS_BLOCKS(inode->i_sb); /*create array log for head file*/ nblocks += 3; @@ -208,7 +216,7 @@ static void *fsfilt_ext3_start(struct inode *inode, int op, void *desc_private, EXT3_SINGLEDATA_TRANS_BLOCKS); /*update head file array */ nblocks += EXT3_INDEX_EXTRA_TRANS_BLOCKS + - EXT3_DATA_TRANS_BLOCKS; + FSFILT_DATA_TRANS_BLOCKS(inode->i_sb); break; default: CERROR("unknown transaction start op %d\n", op); LBUG(); @@ -306,7 +314,7 @@ static int fsfilt_ext3_credits_needed(int objcount, struct fsfilt_objinfo *fso, needed += nbitmaps + ngdblocks; /* last_rcvd update */ - needed += EXT3_DATA_TRANS_BLOCKS; + needed += FSFILT_DATA_TRANS_BLOCKS(sb); #if defined(CONFIG_QUOTA) /* We assume that there will be 1 bit set in s_dquot.flags for each @@ -1165,11 +1173,11 @@ static int fsfilt_ext3_write_record(struct file *file, void *buf, int bufsize, journal = EXT3_SB(inode->i_sb)->s_journal; lock_24kernel(); handle = journal_start(journal, - block_count * EXT3_DATA_TRANS_BLOCKS + 2); + block_count * FSFILT_DATA_TRANS_BLOCKS(inode->i_sb) + 2); unlock_24kernel(); if (IS_ERR(handle)) { CERROR("can't start transaction for %d blocks (%d bytes)\n", - block_count * EXT3_DATA_TRANS_BLOCKS + 2, bufsize); + block_count * FSFILT_DATA_TRANS_BLOCKS(inode->i_sb) + 2, bufsize); return PTR_ERR(handle); } diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 44628ad..dcf5e82 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -590,7 +590,7 @@ int mds_pack_posix_acl(struct inode *inode, struct lustre_msg *repmsg, GOTO(out, 0); lock_24kernel(); - rc = inode->i_op->getxattr(&de, XATTR_NAME_ACL_ACCESS, + rc = inode->i_op->getxattr(&de, MDS_XATTR_NAME_ACL_ACCESS, lustre_msg_buf(repmsg, repoff, buflen), buflen); unlock_24kernel(); @@ -768,7 +768,7 @@ static int mds_getattr_pack_msg(struct ptlrpc_request *req, struct inode *inode, size[bufcount] = 0; if (inode->i_op && inode->i_op->getxattr) { lock_24kernel(); - rc = inode->i_op->getxattr(&de, XATTR_NAME_ACL_ACCESS, + rc = inode->i_op->getxattr(&de, MDS_XATTR_NAME_ACL_ACCESS, NULL, 0); unlock_24kernel(); -- 1.8.3.1