From: yangsheng Date: Wed, 13 May 2009 04:57:53 +0000 (+0000) Subject: b_release_1_8_1 X-Git-Tag: v1_8_0_110~14 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d7fb7b8629736b1e64aefa7eb1f647d0adea9a73;p=fs%2Flustre-release.git b_release_1_8_1 b=18668 i=johann, shadow Some fixes and cleanup for 2.6.27 support. --- diff --git a/build/autoconf/lustre-build.m4 b/build/autoconf/lustre-build.m4 index 343748d..969db8c 100644 --- a/build/autoconf/lustre-build.m4 +++ b/build/autoconf/lustre-build.m4 @@ -53,7 +53,7 @@ AS_VAR_POPDEF([lb_File])dnl AC_DEFUN([LB_CHECK_FILES], [AC_FOREACH([AC_FILE_NAME], [$1], [LB_CHECK_FILE(AC_FILE_NAME, - [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]AC_FILE_NAME), 1, + [AC_DEFINE_UNQUOTED([AS_TR_CPP(HAVE_[]AC_FILE_NAME)], 1, [Define to 1 if you have the file `]AC_File['.]) $2], diff --git a/lustre/lvfs/upcall_cache.c b/lustre/lvfs/upcall_cache.c index abf6872..6ad44b2 100644 --- a/lustre/lvfs/upcall_cache.c +++ b/lustre/lvfs/upcall_cache.c @@ -216,7 +216,7 @@ static int entry_set_group_info(struct upcall_cache_entry *entry, __u32 primary, entry->ue_primary = primary; for (i = 0; i < ginfo->nblocks; i++) { - int cp_count = min((int)NGROUPS_PER_BLOCK, (int)ngroups); + int cp_count = min_t(int, NGROUPS_PER_BLOCK, ngroups); int off = i * NGROUPS_PER_BLOCK; for (j = 0; j < cp_count; j++) diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c index 2a5f620..13bbfb6 100644 --- a/lustre/mds/mds_fs.c +++ b/lustre/mds/mds_fs.c @@ -743,7 +743,7 @@ int mds_fs_setup(struct obd_device *obd, struct vfsmount *mnt) /* setup the directory tree */ push_ctxt(saved, &obd->obd_lvfs_ctxt, NULL); - dentry = simple_mkdir(current->fs->pwd, mnt, "ROOT", 0755, 0); + dentry = simple_mkdir(cfs_fs_pwd(current->fs), mnt, "ROOT", 0755, 0); if (IS_ERR(dentry)) { rc = PTR_ERR(dentry); CERROR("cannot create ROOT directory: rc = %d\n", rc); @@ -756,7 +756,7 @@ int mds_fs_setup(struct obd_device *obd, struct vfsmount *mnt) dput(dentry); - dentry = lookup_one_len("__iopen__", current->fs->pwd, + dentry = lookup_one_len("__iopen__", cfs_fs_pwd(current->fs), strlen("__iopen__")); if (IS_ERR(dentry)) { rc = PTR_ERR(dentry); @@ -771,7 +771,7 @@ int mds_fs_setup(struct obd_device *obd, struct vfsmount *mnt) GOTO(err_fid, rc); } - dentry = simple_mkdir(current->fs->pwd, mnt, "PENDING", 0777, 1); + dentry = simple_mkdir(cfs_fs_pwd(current->fs), mnt, "PENDING", 0777, 1); if (IS_ERR(dentry)) { rc = PTR_ERR(dentry); CERROR("cannot create PENDING directory: rc = %d\n", rc); @@ -780,7 +780,7 @@ int mds_fs_setup(struct obd_device *obd, struct vfsmount *mnt) mds->mds_pending_dir = dentry; /* COMPAT_146 */ - dentry = simple_mkdir(current->fs->pwd, mnt, MDT_LOGS_DIR, 0777, 1); + dentry = simple_mkdir(cfs_fs_pwd(current->fs), mnt, MDT_LOGS_DIR, 0777, 1); if (IS_ERR(dentry)) { rc = PTR_ERR(dentry); CERROR("cannot create %s directory: rc = %d\n", @@ -790,7 +790,7 @@ int mds_fs_setup(struct obd_device *obd, struct vfsmount *mnt) mds->mds_logs_dir = dentry; /* end COMPAT_146 */ - dentry = simple_mkdir(current->fs->pwd, mnt, "OBJECTS", 0777, 1); + dentry = simple_mkdir(cfs_fs_pwd(current->fs), mnt, "OBJECTS", 0777, 1); if (IS_ERR(dentry)) { rc = PTR_ERR(dentry); CERROR("cannot create OBJECTS directory: rc = %d\n", rc); diff --git a/lustre/mgs/mgs_fs.c b/lustre/mgs/mgs_fs.c index 95a14b4..1b8f1804 100644 --- a/lustre/mgs/mgs_fs.c +++ b/lustre/mgs/mgs_fs.c @@ -215,7 +215,7 @@ int mgs_fs_setup(struct obd_device *obd, struct vfsmount *mnt) push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); /* Setup the configs dir */ - dentry = simple_mkdir(current->fs->pwd, mnt, MOUNT_CONFIGS_DIR, 0777, 1); + dentry = simple_mkdir(cfs_fs_pwd(current->fs), mnt, MOUNT_CONFIGS_DIR, 0777, 1); if (IS_ERR(dentry)) { rc = PTR_ERR(dentry); CERROR("cannot create %s directory: rc = %d\n", @@ -226,7 +226,7 @@ int mgs_fs_setup(struct obd_device *obd, struct vfsmount *mnt) /* Need the iopen dir for fid2dentry, required by LLOG_ORIGIN_HANDLE_READ_HEADER */ - dentry = lookup_one_len("__iopen__", current->fs->pwd, + dentry = lookup_one_len("__iopen__", cfs_fs_pwd(current->fs), strlen("__iopen__")); if (IS_ERR(dentry)) { rc = PTR_ERR(dentry); diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 52a46f1..ac1db3d 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1086,7 +1086,7 @@ static int filter_prep_groups(struct obd_device *obd) int i, rc = 0, cleanup_phase = 0; ENTRY; - O_dentry = simple_mkdir(current->fs->pwd, filter->fo_vfsmnt, + O_dentry = simple_mkdir(cfs_fs_pwd(current->fs), filter->fo_vfsmnt, "O", 0700, 1); CDEBUG(D_INODE, "got/created O: %p\n", O_dentry); if (IS_ERR(O_dentry)) { @@ -1851,9 +1851,7 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf, __u8 *uuid_ptr; char *str, *label; char ns_name[48]; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,9) - request_queue_t *q; -#endif + struct request_queue *q; int rc; ENTRY; @@ -1966,7 +1964,6 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf, if (rc) GOTO(err_post, rc); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,9) q = bdev_get_queue(mnt->mnt_sb->s_bdev); if (q->max_sectors < q->max_hw_sectors && q->max_sectors < PTLRPC_MAX_BRW_SIZE >> 9) @@ -1975,7 +1972,6 @@ int filter_common_setup(struct obd_device *obd, obd_count len, void *buf, "could be up to max_hw_sectors=%u\n", obd->obd_name, mnt->mnt_sb->s_id, q->max_sectors, q->max_hw_sectors); -#endif uuid_ptr = fsfilt_uuid(obd, obd->u.obt.obt_sb); if (uuid_ptr != NULL) {