X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_hsm_cdt_agent.c;h=2bce139f4b7f4cb10e0af8761acf2357c45742c4;hb=6c6f247bc08bb6c3a3c07d2da2774a54fd244c9a;hp=f863ecae1f658b323899c7b5a1e8308f1817cb32;hpb=9ee81f920bb3f032e9b3e63bc93cd4d776396059;p=fs%2Flustre-release.git diff --git a/lustre/mdt/mdt_hsm_cdt_agent.c b/lustre/mdt/mdt_hsm_cdt_agent.c index f863eca..2bce139 100644 --- a/lustre/mdt/mdt_hsm_cdt_agent.c +++ b/lustre/mdt/mdt_hsm_cdt_agent.c @@ -140,6 +140,10 @@ out_free: if (ha != NULL) OBD_FREE_PTR(ha); out: + /* wake the coordinator to potentially schedule requests */ + if (rc == -EEXIST || rc == 0) + mdt_hsm_cdt_event(cdt); + return rc; } @@ -556,7 +560,7 @@ int mdt_hsm_agent_send(struct mdt_thread_info *mti, * the ldlm_callback_handler. Note this sends a request RPC * from a server (MDT) to a client (MDC), backwards of normal comms. */ - exp = cfs_hash_lookup(mdt2obd_dev(mdt)->obd_uuid_hash, &uuid); + exp = obd_uuid_lookup(mdt2obd_dev(mdt), &uuid); if (exp == NULL || exp->exp_disconnected) { if (exp != NULL) class_export_put(exp); @@ -606,9 +610,9 @@ out_buf: } /** - * seq_file method called to start access to /proc file + * seq_file method called to start access to debugfs file */ -static void *mdt_hsm_agent_proc_start(struct seq_file *s, loff_t *off) +static void *mdt_hsm_agent_debugfs_start(struct seq_file *s, loff_t *off) { struct mdt_device *mdt = s->private; struct coordinator *cdt = &mdt->mdt_coordinator; @@ -638,7 +642,7 @@ static void *mdt_hsm_agent_proc_start(struct seq_file *s, loff_t *off) * seq_file method called to get next item * just returns NULL at eof */ -static void *mdt_hsm_agent_proc_next(struct seq_file *s, void *v, loff_t *p) +static void *mdt_hsm_agent_debugfs_next(struct seq_file *s, void *v, loff_t *p) { struct mdt_device *mdt = s->private; struct coordinator *cdt = &mdt->mdt_coordinator; @@ -659,7 +663,7 @@ static void *mdt_hsm_agent_proc_next(struct seq_file *s, void *v, loff_t *p) /** */ -static int mdt_hsm_agent_proc_show(struct seq_file *s, void *v) +static int mdt_hsm_agent_debugfs_show(struct seq_file *s, void *v) { struct list_head *pos = v; struct hsm_agent *ha; @@ -687,9 +691,9 @@ static int mdt_hsm_agent_proc_show(struct seq_file *s, void *v) } /** - * seq_file method called to stop access to /proc file + * seq_file method called to stop access to debugfs file */ -static void mdt_hsm_agent_proc_stop(struct seq_file *s, void *v) +static void mdt_hsm_agent_debugfs_stop(struct seq_file *s, void *v) { struct mdt_device *mdt = s->private; struct coordinator *cdt = &mdt->mdt_coordinator; @@ -697,30 +701,30 @@ static void mdt_hsm_agent_proc_stop(struct seq_file *s, void *v) up_read(&cdt->cdt_agent_lock); } -/* hsm agent list proc functions */ -static const struct seq_operations mdt_hsm_agent_proc_ops = { - .start = mdt_hsm_agent_proc_start, - .next = mdt_hsm_agent_proc_next, - .show = mdt_hsm_agent_proc_show, - .stop = mdt_hsm_agent_proc_stop, +/* hsm agent list debugfs functions */ +static const struct seq_operations mdt_hsm_agent_debugfs_ops = { + .start = mdt_hsm_agent_debugfs_start, + .next = mdt_hsm_agent_debugfs_next, + .show = mdt_hsm_agent_debugfs_show, + .stop = mdt_hsm_agent_debugfs_stop, }; /** - * public function called at open of /proc file to get + * public function called at open of debugfs file to get * list of agents */ -static int lprocfs_open_hsm_agent(struct inode *inode, struct file *file) +static int ldebugfs_open_hsm_agent(struct inode *inode, struct file *file) { struct seq_file *s; int rc; ENTRY; - rc = seq_open(file, &mdt_hsm_agent_proc_ops); + rc = seq_open(file, &mdt_hsm_agent_debugfs_ops); if (rc) RETURN(rc); s = file->private_data; - s->private = PDE_DATA(inode); + s->private = inode->i_private; RETURN(rc); } @@ -728,8 +732,8 @@ static int lprocfs_open_hsm_agent(struct inode *inode, struct file *file) /* methods to access hsm agent list */ const struct file_operations mdt_hsm_agent_fops = { .owner = THIS_MODULE, - .open = lprocfs_open_hsm_agent, + .open = ldebugfs_open_hsm_agent, .read = seq_read, .llseek = seq_lseek, - .release = lprocfs_seq_release, + .release = seq_release, };