Whamcloud - gitweb
Branch: b1_5
authorwangdi <wangdi>
Tue, 30 May 2006 17:10:52 +0000 (17:10 +0000)
committerwangdi <wangdi>
Tue, 30 May 2006 17:10:52 +0000 (17:10 +0000)
fix fc5 build problems in b1_5

lustre/include/linux/lustre_mds.h
lustre/include/lustre_mds.h
lustre/kernel_patches/patches/vfs_intent-2.6-fc5.patch
lustre/llite/llite_internal.h
lustre/llite/lproc_llite.c
lustre/lvfs/fsfilt_ext3.c
lustre/mds/handler.c

index f805ae8..cb10f77 100644 (file)
 #ifdef __KERNEL__
 # include <linux/fs.h>
 # include <linux/dcache.h>
-# include <linux/xattr_acl.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16))
+#include <linux/posix_acl_xattr.h>
+#else
+#include <linux/xattr_acl.h>        
+#endif
 #endif
 
 struct ldlm_lock_desc;
index 3f7d238..78eff75 100644 (file)
@@ -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
index 485ab1a..f3e8901 100644 (file)
@@ -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 <linux/list.h>
  #include <linux/spinlock.h>
  #include <linux/cache.h>
+@@ -36,6 +37,8 @@
+       const unsigned char *name;
+ };
++#include <linux/namei.h>
++
+ 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
index f34079f..618b4ed 100644 (file)
@@ -7,7 +7,11 @@
 
 #ifdef CONFIG_FS_POSIX_ACL
 # include <linux/fs.h>
-# include <linux/xattr_acl.h>
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16))
+#include <linux/posix_acl_xattr.h>
+#else
+#include <linux/xattr_acl.h>        
+#endif
 #endif
 
 #include <lustre_debug.h>
@@ -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)
 {
index a2f90e4..7ed9b14 100644 (file)
@@ -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 
index f6e3f67..5bf7a39 100644 (file)
 #include <linux/ext3_extents.h>
 #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);
         }
 
index 44628ad..dcf5e82 100644 (file)
@@ -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();