From ca1b9a1db09ead119b7bce51f453d4489add7d8c Mon Sep 17 00:00:00 2001 From: green Date: Thu, 23 Jul 2009 19:19:48 +0000 Subject: [PATCH] b=19860 r=adilger,shadow get rid of ptlrpc_daemonize remove unneeded exports --- .../patches/export_symbols-2.6.18-vanilla.patch | 64 ---------------------- lustre/kernel_patches/series/2.6-rhel5.series | 2 +- lustre/kernel_patches/series/2.6-sles10.series | 2 +- lustre/ldlm/ldlm_pool.c | 2 +- lustre/mds/mds_lov.c | 2 +- lustre/mgc/mgc_request.c | 2 +- lustre/ptlrpc/import.c | 2 +- lustre/ptlrpc/pinger.c | 4 +- lustre/ptlrpc/ptlrpc_module.c | 1 - lustre/ptlrpc/service.c | 16 +----- lustre/quota/quota_check.c | 2 +- lustre/quota/quota_context.c | 2 +- lustre/quota/quota_master.c | 2 +- 13 files changed, 13 insertions(+), 90 deletions(-) delete mode 100644 lustre/kernel_patches/patches/export_symbols-2.6.18-vanilla.patch diff --git a/lustre/kernel_patches/patches/export_symbols-2.6.18-vanilla.patch b/lustre/kernel_patches/patches/export_symbols-2.6.18-vanilla.patch deleted file mode 100644 index 18a9815..0000000 --- a/lustre/kernel_patches/patches/export_symbols-2.6.18-vanilla.patch +++ /dev/null @@ -1,64 +0,0 @@ -Index: linux-2.6/fs/filesystems.c -=================================================================== ---- linux-2.6.orig/fs/filesystems.c 2006-07-15 16:08:35.000000000 +0800 -+++ linux-2.6/fs/filesystems.c 2006-07-15 16:14:19.000000000 +0800 -@@ -29,7 +29,9 @@ - */ - - static struct file_system_type *file_systems; --static DEFINE_RWLOCK(file_systems_lock); -+DEFINE_RWLOCK(file_systems_lock); -+ -+EXPORT_SYMBOL(file_systems_lock); - - /* WARNING: This can be used only if we _already_ own a reference */ - void get_filesystem(struct file_system_type *fs) -Index: linux-2.6/include/linux/fs.h -=================================================================== ---- linux-2.6.orig/include/linux/fs.h 2006-07-15 16:10:37.000000000 +0800 -+++ linux-2.6/include/linux/fs.h 2006-07-15 16:14:19.000000000 +0800 -@@ -1768,6 +1768,7 @@ static inline ssize_t blockdev_direct_IO - - extern const struct file_operations generic_ro_fops; - -+extern rwlock_t file_systems_lock; - #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) - - extern int vfs_readlink(struct dentry *, char __user *, int, const char *); -Index: linux-2.6/fs/namespace.c -=================================================================== ---- linux-2.6.orig/fs/namespace.c 2006-07-15 16:10:33.000000000 +0800 -+++ linux-2.6/fs/namespace.c 2006-07-15 16:14:19.000000000 +0800 -@@ -1641,6 +1641,7 @@ void set_fs_pwd(struct fs_struct *fs, st - mntput(old_pwdmnt); - } - } -+EXPORT_SYMBOL(set_fs_pwd); - - static void chroot_fs_refs(struct nameidata *old_nd, struct nameidata *new_nd) - { -Index: linux-2.6/kernel/exit.c -=================================================================== ---- linux-2.6.orig/kernel/exit.c 2006-07-15 16:08:34.000000000 +0800 -+++ linux-2.6/kernel/exit.c 2006-07-15 16:14:19.000000000 +0800 -@@ -305,6 +305,8 @@ static void reparent_to_init(void) - switch_uid(INIT_USER); - } - -+EXPORT_SYMBOL(reparent_to_init); -+ - void __set_special_pids(pid_t session, pid_t pgrp) - { - struct task_struct *curr = current->group_leader; -Index: linux-2.6/fs/dcache.c -=================================================================== ---- linux-2.6.orig/fs/dcache.c 2006-07-15 16:14:00.000000000 +0800 -+++ linux-2.6/fs/dcache.c 2006-07-15 16:14:19.000000000 +0800 -@@ -1628,6 +1628,7 @@ int is_subdir(struct dentry * new_dentry - - return result; - } -+EXPORT_SYMBOL(is_subdir); - - void d_genocide(struct dentry *root) - { diff --git a/lustre/kernel_patches/series/2.6-rhel5.series b/lustre/kernel_patches/series/2.6-rhel5.series index 41f55fc..7a625f5 100644 --- a/lustre/kernel_patches/series/2.6-rhel5.series +++ b/lustre/kernel_patches/series/2.6-rhel5.series @@ -4,7 +4,7 @@ i_filter_data.patch jbd-jcberr-2.6.18-vanilla.patch export_symbols-2.6.18-vanilla.patch dev_read_only-2.6.18-vanilla.patch -export-2.6.18-vanilla.patch +export-2.6.12.patch export-show_task-2.6.18-vanilla.patch sd_iostats-2.6-rhel5.patch export_symbol_numa-2.6-fc5.patch diff --git a/lustre/kernel_patches/series/2.6-sles10.series b/lustre/kernel_patches/series/2.6-sles10.series index 7003a52..d39895a 100644 --- a/lustre/kernel_patches/series/2.6-sles10.series +++ b/lustre/kernel_patches/series/2.6-sles10.series @@ -1,7 +1,7 @@ lustre_version.patch jbd-2.6.10-jcberr.patch iopen-misc-2.6.12.patch -export_symbols-2.6.12.patch +export_symbols-2.6.12.patch dev_read_only-2.6-fc5.patch export-2.6-fc5.patch export-show_task-2.6-fc5.patch diff --git a/lustre/ldlm/ldlm_pool.c b/lustre/ldlm/ldlm_pool.c index 6779be5..fbe9641a 100644 --- a/lustre/ldlm/ldlm_pool.c +++ b/lustre/ldlm/ldlm_pool.c @@ -1308,7 +1308,7 @@ static int ldlm_pools_thread_start(void) /* * CLONE_VM and CLONE_FILES just avoid a needless copy, because we - * just drop the VM and FILES in ptlrpc_daemonize() right away. + * just drop the VM and FILES in cfs_daemonize() right away. */ rc = cfs_kernel_thread(ldlm_pools_thread_main, ldlm_pools_thread, CLONE_VM | CLONE_FILES); diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index c3875b5..58c15cb 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -1057,7 +1057,7 @@ int mds_lov_synchronize(void *data) char name[20]; snprintf(name, sizeof(name), "ll_sync_%02u", mlsi->mlsi_index); - ptlrpc_daemonize(name); + cfs_daemonize_ctxt(name); RETURN(__mds_lov_synchronize(data)); } diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index 0c5a0af..680a1d5 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -277,7 +277,7 @@ static int mgc_requeue_thread(void *data) int rc = 0; ENTRY; - ptlrpc_daemonize(name); + cfs_daemonize(name); CDEBUG(D_MGC, "Starting requeue thread\n"); diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index cb1eaeaa..8ea8799 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -1220,7 +1220,7 @@ static int ptlrpc_invalidate_import_thread(void *data) ENTRY; - ptlrpc_daemonize("ll_imp_inval"); + cfs_daemonize_ctxt("ll_imp_inval"); CDEBUG(D_HA, "thread invalidate import %s to %s@%s\n", imp->imp_obd->obd_name, obd2cli_tgt(imp->imp_obd), diff --git a/lustre/ptlrpc/pinger.c b/lustre/ptlrpc/pinger.c index 931775b..a69e4e8 100644 --- a/lustre/ptlrpc/pinger.c +++ b/lustre/ptlrpc/pinger.c @@ -331,7 +331,7 @@ int ptlrpc_start_pinger(void) d.thread = pinger_thread; /* CLONE_VM and CLONE_FILES just avoid a needless copy, because we - * just drop the VM and FILES in ptlrpc_daemonize() right away. */ + * just drop the VM and FILES in cfs_daemonize_ctxt() right away. */ rc = cfs_kernel_thread(ptlrpc_pinger_main, &d, CLONE_VM | CLONE_FILES); if (rc < 0) { CERROR("cannot start thread: %d\n", rc); @@ -584,7 +584,7 @@ static int ping_evictor_main(void *arg) time_t expire_time; ENTRY; - ptlrpc_daemonize("ll_evictor"); + cfs_daemonize_ctxt("ll_evictor"); CDEBUG(D_HA, "Starting Ping Evictor\n"); pet_exp = NULL; diff --git a/lustre/ptlrpc/ptlrpc_module.c b/lustre/ptlrpc/ptlrpc_module.c index b33d69d..57f0b81 100644 --- a/lustre/ptlrpc/ptlrpc_module.c +++ b/lustre/ptlrpc/ptlrpc_module.c @@ -200,7 +200,6 @@ EXPORT_SYMBOL(ptlrpc_stop_all_threads); EXPORT_SYMBOL(ptlrpc_start_threads); EXPORT_SYMBOL(ptlrpc_start_thread); EXPORT_SYMBOL(ptlrpc_unregister_service); -EXPORT_SYMBOL(ptlrpc_daemonize); EXPORT_SYMBOL(ptlrpc_service_health_check); EXPORT_SYMBOL(ptlrpc_hpreq_reorder); diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index 0fd0b42..0b1c7b5 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -1542,18 +1542,6 @@ liblustre_check_services (void *arg) #else /* __KERNEL__ */ -/* Don't use daemonize, it removes fs struct from new thread (bug 418) */ -void ptlrpc_daemonize(char *name) -{ - struct fs_struct *fs = current->fs; - - atomic_inc(&fs->count); - cfs_daemonize(name); - exit_fs(cfs_current()); - current->fs = fs; - ll_set_fs_pwd(current->fs, cfs_fs_mnt(init_task.fs), cfs_fs_pwd(init_task.fs)); -} - static void ptlrpc_check_rqbd_pool(struct ptlrpc_service *svc) { @@ -1598,7 +1586,7 @@ static int ptlrpc_main(void *arg) int counter = 0, rc = 0; ENTRY; - ptlrpc_daemonize(data->name); + cfs_daemonize_ctxt(data->name); #if defined(HAVE_NODE_TO_CPUMASK) && defined(CONFIG_NUMA) /* we need to do this before any per-thread allocation is done so that @@ -1853,7 +1841,7 @@ int ptlrpc_start_thread(struct obd_device *dev, struct ptlrpc_service *svc) CDEBUG(D_RPCTRACE, "starting thread '%s'\n", name); /* CLONE_VM and CLONE_FILES just avoid a needless copy, because we - * just drop the VM and FILES in ptlrpc_daemonize() right away. + * just drop the VM and FILES in cfs_daemonize_ctxt() right away. */ rc = cfs_kernel_thread(ptlrpc_main, &d, CLONE_VM | CLONE_FILES); if (rc < 0) { diff --git a/lustre/quota/quota_check.c b/lustre/quota/quota_check.c index 74669ff..4368db4 100644 --- a/lustre/quota/quota_check.c +++ b/lustre/quota/quota_check.c @@ -96,7 +96,7 @@ static int target_quotacheck_thread(void *data) struct lvfs_run_ctxt saved; int rc; - ptlrpc_daemonize("quotacheck"); + cfs_daemonize_ctxt("quotacheck"); exp = qta->qta_exp; obd = exp->exp_obd; diff --git a/lustre/quota/quota_context.c b/lustre/quota/quota_context.c index 423629b..4bd3381 100644 --- a/lustre/quota/quota_context.c +++ b/lustre/quota/quota_context.c @@ -1330,7 +1330,7 @@ static int qslave_recovery_main(void *arg) int rc = 0; ENTRY; - ptlrpc_daemonize("qslave_recovd"); + cfs_daemonize_ctxt("qslave_recovd"); complete(&data->comp); diff --git a/lustre/quota/quota_master.c b/lustre/quota/quota_master.c index 0d88025..6c19d3e 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -1655,7 +1655,7 @@ static int qmaster_recovery_main(void *arg) unsigned short type; ENTRY; - ptlrpc_daemonize("qmaster_recovd"); + cfs_daemonize_ctxt("qmaster_recovd"); class_incref(obd); complete(&data->comp); -- 1.8.3.1