Lines Matching defs:comrade
27 struct hmdfs_dentry_comrade *comrade = NULL;
31 comrade = list_first_entry_or_null(&dim->comrade_list,
33 if (comrade)
34 d = dget(comrade->lo_d);
42 struct hmdfs_dentry_comrade *comrade = NULL;
46 list_for_each_entry(comrade, &dim->comrade_list, list) {
47 if (comrade->dev_id == dev_id) {
48 d = dget(comrade->lo_d);
60 struct hmdfs_dentry_comrade *comrade = NULL;
66 list_for_each_entry(comrade, &cdi->comrade_list, list) {
67 li = d_inode(comrade->lo_d);
71 if (comrade == fst_comrade) {
169 struct hmdfs_dentry_comrade *comrade = NULL;
171 // 文件只有一个 comrade,考虑 {comrade, list + list lock}
172 comrade = kzalloc(sizeof(*comrade), GFP_KERNEL);
173 if (unlikely(!comrade))
176 comrade->lo_d = lo_d;
177 comrade->dev_id = dev_id;
179 return comrade;
183 struct hmdfs_dentry_comrade *comrade)
188 if (likely(c->dev_id != comrade->dev_id))
190 hmdfs_err("Redundant comrade of device %llu", c->dev_id);
191 dput(comrade->lo_d);
192 kfree(comrade);
197 if (comrade_is_local(comrade))
198 list_add(&comrade->list, onstack_comrades_head);
200 list_add_tail(&comrade->list, onstack_comrades_head);
226 struct hmdfs_dentry_comrade *comrade = NULL;
234 comrade = alloc_comrade(path.dentry, dev_id);
236 return comrade;
351 struct hmdfs_dentry_comrade *comrade = NULL;
356 comrade = ERR_PTR(err);
362 comrade = ERR_PTR(err);
366 comrade = alloc_comrade(path.dentry, devid);
373 return comrade;
398 struct hmdfs_dentry_comrade *comrade;
408 comrade = merge_lookup_comrade(ml_work->sbi, ml_work->name,
410 if (IS_ERR(comrade)) {
417 if (!is_valid_comrade(mdi, hmdfs_cm(comrade))) {
418 destroy_comrade(comrade);
421 link_comrade(&mdi->comrade_list, comrade);
557 struct hmdfs_dentry_comrade *comrade;
570 comrade = lookup_comrade(path_dev, buf, HMDFS_DEVID_LOCAL, flags);
571 if (IS_ERR(comrade)) {
572 ret = PTR_ERR(comrade);
575 link_comrade(&head, comrade);
582 comrade = lookup_comrade(path_dev, buf, peer->device_id, flags);
583 if (IS_ERR(comrade))
586 link_comrade(&head, comrade);
1131 struct hmdfs_dentry_comrade *comrade = NULL;
1139 list_for_each_entry(comrade, &(dim->comrade_list), list) {
1140 lo_d = comrade->lo_d;
1179 struct hmdfs_dentry_comrade *comrade = NULL;
1188 list_for_each_entry(comrade, &(dim->comrade_list), list) {
1189 lo_d = comrade->lo_d;
1244 struct hmdfs_dentry_comrade *comrade = NULL, *new_comrade = NULL;
1268 list_for_each_entry(comrade, &dim->comrade_list, list) {
1269 lo_d_old = comrade->lo_d;
1273 lo_d_new_dir = hmdfs_get_lo_d(d_new_dir, comrade->dev_id);
1319 new_comrade = alloc_comrade(lo_p_new.dentry, comrade->dev_id);