/* * initialise the AFS client FS module */ static int __init afs_init(void) { int ret = -ENOMEM; printk(KERN_INFO "kAFS: Red Hat AFS client v0.1 registering.\n"); afs_wq = alloc_workqueue("afs", 0, 0); if (!afs_wq) goto error_afs_wq; afs_async_calls = alloc_workqueue("kafsd", WQ_MEM_RECLAIM, 0); if (!afs_async_calls) goto error_async; afs_lock_manager = alloc_workqueue("kafs_lockd", WQ_MEM_RECLAIM, 0); if (!afs_lock_manager) goto error_lockmgr; #ifdef CONFIG_AFS_FSCACHE /* we want to be able to cache */ ret = fscache_register_netfs(&afs_cache_netfs); if (ret < 0) goto error_cache; #endif ret = afs_net_init(&__afs_net); if (ret < 0) goto error_net; /* register the filesystems */ ret = afs_fs_init(); if (ret < 0) goto error_fs; return ret; error_fs: afs_net_exit(&__afs_net); error_net: #ifdef CONFIG_AFS_FSCACHE fscache_unregister_netfs(&afs_cache_netfs); error_cache: #endif destroy_workqueue(afs_lock_manager); error_lockmgr: destroy_workqueue(afs_async_calls); error_async: destroy_workqueue(afs_wq); error_afs_wq: rcu_barrier(); printk(KERN_ERR "kAFS: failed to register: %d\n", ret); return ret; }
/* * Register CIFS for caching with FS-Cache */ int cifs_fscache_register(void) { return fscache_register_netfs(&cifs_fscache_netfs); }
/* * initialise the AFS client FS module */ static int __init afs_init(void) { int ret; printk(KERN_INFO "kAFS: Red Hat AFS client v0.1 registering.\n"); ret = afs_get_client_UUID(); if (ret < 0) return ret; /* create workqueue */ ret = -ENOMEM; afs_wq = alloc_workqueue("afs", 0, 0); if (!afs_wq) return ret; /* register the /proc stuff */ ret = afs_proc_init(); if (ret < 0) goto error_proc; #ifdef CONFIG_AFS_FSCACHE /* we want to be able to cache */ ret = fscache_register_netfs(&afs_cache_netfs); if (ret < 0) goto error_cache; #endif /* initialise the cell DB */ ret = afs_cell_init(rootcell); if (ret < 0) goto error_cell_init; /* initialise the VL update process */ ret = afs_vlocation_update_init(); if (ret < 0) goto error_vl_update_init; /* initialise the callback update process */ ret = afs_callback_update_init(); if (ret < 0) goto error_callback_update_init; /* create the RxRPC transport */ ret = afs_open_socket(); if (ret < 0) goto error_open_socket; /* register the filesystems */ ret = afs_fs_init(); if (ret < 0) goto error_fs; return ret; error_fs: afs_close_socket(); error_open_socket: afs_callback_update_kill(); error_callback_update_init: afs_vlocation_purge(); error_vl_update_init: afs_cell_purge(); error_cell_init: #ifdef CONFIG_AFS_FSCACHE fscache_unregister_netfs(&afs_cache_netfs); error_cache: #endif afs_proc_cleanup(); error_proc: destroy_workqueue(afs_wq); rcu_barrier(); printk(KERN_ERR "kAFS: failed to register: %d\n", ret); return ret; }
static int __init afs_init(void) { int ret; printk(KERN_INFO "kAFS: Red Hat AFS client v0.1 registering.\n"); ret = afs_get_client_UUID(); if (ret < 0) return ret; /* */ ret = -ENOMEM; afs_wq = alloc_workqueue("afs", 0, 0); if (!afs_wq) return ret; /* */ ret = afs_proc_init(); if (ret < 0) goto error_proc; #ifdef CONFIG_AFS_FSCACHE /* */ ret = fscache_register_netfs(&afs_cache_netfs); if (ret < 0) goto error_cache; #endif /* */ ret = afs_cell_init(rootcell); if (ret < 0) goto error_cell_init; /* */ ret = afs_vlocation_update_init(); if (ret < 0) goto error_vl_update_init; /* */ ret = afs_callback_update_init(); if (ret < 0) goto error_callback_update_init; /* */ ret = afs_open_socket(); if (ret < 0) goto error_open_socket; /* */ ret = afs_fs_init(); if (ret < 0) goto error_fs; return ret; error_fs: afs_close_socket(); error_open_socket: afs_callback_update_kill(); error_callback_update_init: afs_vlocation_purge(); error_vl_update_init: afs_cell_purge(); error_cell_init: #ifdef CONFIG_AFS_FSCACHE fscache_unregister_netfs(&afs_cache_netfs); error_cache: #endif afs_proc_cleanup(); error_proc: destroy_workqueue(afs_wq); rcu_barrier(); printk(KERN_ERR "kAFS: failed to register: %d\n", ret); return ret; }