From 2c7471af644c1ed58578bac7504909fe0184fe71 Mon Sep 17 00:00:00 2001 From: green Date: Sat, 18 Jul 2009 20:02:21 +0000 Subject: [PATCH] b=19860 r=adilger,rread Get rid of ptlrpc_daemonize, drop unneeded export from kernel patches. --- libcfs/libcfs/linux/linux-prim.c | 7 --- .../patches/export_symbols-2.6.18-vanilla.patch | 64 ---------------------- lustre/kernel_patches/series/2.6-rhel5.series | 3 +- lustre/kernel_patches/series/2.6-sles10.series | 3 +- lustre/ldlm/ldlm_pool.c | 2 +- lustre/mds/mds_lov.c | 2 +- lustre/mdt/mdt_capa.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/sec_gc.c | 2 +- lustre/ptlrpc/service.c | 20 ++----- lustre/quota/quota_check.c | 2 +- lustre/quota/quota_context.c | 2 +- lustre/quota/quota_master.c | 2 +- 16 files changed, 17 insertions(+), 103 deletions(-) diff --git a/libcfs/libcfs/linux/linux-prim.c b/libcfs/libcfs/linux/linux-prim.c index 18f81b4..f8e2775 100644 --- a/libcfs/libcfs/linux/linux-prim.c +++ b/libcfs/libcfs/linux/linux-prim.c @@ -224,14 +224,7 @@ void cfs_daemonize(char *str) { unsigned long flags; lock_kernel(); -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,63)) daemonize(str); -#else - daemonize(); - exit_files(current); - reparent_to_init(); - snprintf (current->comm, sizeof (current->comm), "%s", str); -#endif SIGNAL_MASK_LOCK(current, flags); sigfillset(¤t->blocked); RECALC_SIGPENDING; 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 index 18a9815..e69de29 100644 --- a/lustre/kernel_patches/patches/export_symbols-2.6.18-vanilla.patch +++ b/lustre/kernel_patches/patches/export_symbols-2.6.18-vanilla.patch @@ -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 227bcda..ecc620e 100644 --- a/lustre/kernel_patches/series/2.6-rhel5.series +++ b/lustre/kernel_patches/series/2.6-rhel5.series @@ -2,14 +2,13 @@ lustre_version.patch vfs_races-2.6-rhel5.patch i_filter_data.patch jbd-jcberr-2.6.18-vanilla.patch -export_symbols-2.6.18-vanilla.patch +export_symbols-2.6.12.patch dev_read_only-2.6.18-vanilla.patch export-2.6.18-vanilla.patch export-show_task-2.6.18-vanilla.patch sd_iostats-2.6-rhel5.patch export_symbol_numa-2.6-fc5.patch jbd-stats-2.6-rhel5.patch -export-nr_free_buffer_pages.patch raid5-stats-rhel5.patch raid5-configurable-cachesize-rhel5.patch raid5-large-io-rhel5.patch diff --git a/lustre/kernel_patches/series/2.6-sles10.series b/lustre/kernel_patches/series/2.6-sles10.series index cf1254c..fbab643 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 @@ -12,7 +12,6 @@ jbd-stats-2.6-sles10.patch quota-fix-oops-in-invalidate_dquots.patch jbd-journal-chksum-2.6-sles10.patch proc-sleep-2.6.16-sles10.patch -export-nr_free_buffer_pages.patch quota-large-limits-sles10.patch raid5-mmp-unplug-dev-sles10.patch prune-icache-use-trylock-sles10.patch diff --git a/lustre/ldlm/ldlm_pool.c b/lustre/ldlm/ldlm_pool.c index 54c0cf5..3542a55 100644 --- a/lustre/ldlm/ldlm_pool.c +++ b/lustre/ldlm/ldlm_pool.c @@ -1315,7 +1315,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 e57a1e2..39f2092 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -907,7 +907,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/mdt/mdt_capa.c b/lustre/mdt/mdt_capa.c index 3592985..9672420 100644 --- a/lustre/mdt/mdt_capa.c +++ b/lustre/mdt/mdt_capa.c @@ -212,7 +212,7 @@ static int mdt_ck_thread_main(void *args) int rc; ENTRY; - ptlrpc_daemonize("mdt_ck"); + cfs_daemonize_ctxt("mdt_ck"); cfs_block_allsigs(); thread->t_flags = SVC_RUNNING; diff --git a/lustre/mgc/mgc_request.c b/lustre/mgc/mgc_request.c index c28488e..884fda9 100644 --- a/lustre/mgc/mgc_request.c +++ b/lustre/mgc/mgc_request.c @@ -395,7 +395,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 4824569..52b6ef9 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -1215,7 +1215,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 af1924a..0485496 100644 --- a/lustre/ptlrpc/pinger.c +++ b/lustre/ptlrpc/pinger.c @@ -360,7 +360,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); @@ -607,7 +607,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 cd8ca0e..05bcdfc 100644 --- a/lustre/ptlrpc/ptlrpc_module.c +++ b/lustre/ptlrpc/ptlrpc_module.c @@ -219,7 +219,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/sec_gc.c b/lustre/ptlrpc/sec_gc.c index 76c4296..a5245e9 100644 --- a/lustre/ptlrpc/sec_gc.c +++ b/lustre/ptlrpc/sec_gc.c @@ -172,7 +172,7 @@ static int sec_gc_main(void *arg) struct ptlrpc_thread *thread = (struct ptlrpc_thread *) arg; struct l_wait_info lwi; - cfs_daemonize("sptlrpc_gc"); + cfs_daemonize_ctxt("sptlrpc_gc"); /* Record that the thread is running */ thread->t_flags = SVC_RUNNING; diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index bae2756..d86ec52 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -1797,18 +1797,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, init_task.fs->pwdmnt, init_task.fs->pwd); -} - static void ptlrpc_check_rqbd_pool(struct ptlrpc_service *svc) { @@ -1854,7 +1842,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 @@ -2043,7 +2031,7 @@ static int ptlrpc_hr_main(void *arg) snprintf(threadname, sizeof(threadname), "ptlrpc_hr_%d", hr_args->thread_index); - ptlrpc_daemonize(threadname); + cfs_daemonize_ctxt(threadname); #if defined(HAVE_NODE_TO_CPUMASK) set_cpus_allowed(cfs_current(), node_to_cpumask(cpu_to_node(hr_args->cpu_index))); @@ -2257,8 +2245,8 @@ 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. + /* CLONE_VM and CLONE_FILES just avoid a needless copy, because we + * 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 93b578c..4d0e67a 100644 --- a/lustre/quota/quota_check.c +++ b/lustre/quota/quota_check.c @@ -99,7 +99,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 = qta->qta_obd; diff --git a/lustre/quota/quota_context.c b/lustre/quota/quota_context.c index 01f09e9..29e2f3a 100644 --- a/lustre/quota/quota_context.c +++ b/lustre/quota/quota_context.c @@ -1345,7 +1345,7 @@ static int qslave_recovery_main(void *arg) int rc = 0; ENTRY; - ptlrpc_daemonize("qslave_recovd"); + cfs_daemonize_ctxt("qslave_recovd"); /* for obdfilter */ class_incref(obd, "qslave_recovd_filter", obd); diff --git a/lustre/quota/quota_master.c b/lustre/quota/quota_master.c index 51b6d65..2001ced 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -1691,7 +1691,7 @@ static int qmaster_recovery_main(void *arg) unsigned short type; ENTRY; - ptlrpc_daemonize("qmaster_recovd"); + cfs_daemonize_ctxt("qmaster_recovd"); /* for mds */ class_incref(obd, "qmaster_recovd_mds", obd); -- 1.8.3.1