Lines Matching full:ent
208 ocfs2_filecheck_erase_entries(struct ocfs2_filecheck_sysfs_entry *ent,
211 ocfs2_filecheck_adjust_max(struct ocfs2_filecheck_sysfs_entry *ent, in ocfs2_filecheck_adjust_max() argument
219 spin_lock(&ent->fs_fcheck->fc_lock); in ocfs2_filecheck_adjust_max()
220 if (len < (ent->fs_fcheck->fc_size - ent->fs_fcheck->fc_done)) { in ocfs2_filecheck_adjust_max()
224 len, ent->fs_fcheck->fc_size - ent->fs_fcheck->fc_done); in ocfs2_filecheck_adjust_max()
227 if (len < ent->fs_fcheck->fc_size) in ocfs2_filecheck_adjust_max()
228 BUG_ON(!ocfs2_filecheck_erase_entries(ent, in ocfs2_filecheck_adjust_max()
229 ent->fs_fcheck->fc_size - len)); in ocfs2_filecheck_adjust_max()
231 ent->fs_fcheck->fc_max = len; in ocfs2_filecheck_adjust_max()
234 spin_unlock(&ent->fs_fcheck->fc_lock); in ocfs2_filecheck_adjust_max()
306 struct ocfs2_filecheck_sysfs_entry *ent = container_of(kobj, in ocfs2_filecheck_attr_show() local
313 spin_lock(&ent->fs_fcheck->fc_lock); in ocfs2_filecheck_attr_show()
314 total = snprintf(buf, remain, "%u\n", ent->fs_fcheck->fc_max); in ocfs2_filecheck_attr_show()
315 spin_unlock(&ent->fs_fcheck->fc_lock); in ocfs2_filecheck_attr_show()
322 spin_lock(&ent->fs_fcheck->fc_lock); in ocfs2_filecheck_attr_show()
323 list_for_each_entry(p, &ent->fs_fcheck->fc_head, fe_list) { in ocfs2_filecheck_attr_show()
338 spin_unlock(&ent->fs_fcheck->fc_lock); in ocfs2_filecheck_attr_show()
345 ocfs2_filecheck_is_dup_entry(struct ocfs2_filecheck_sysfs_entry *ent, in ocfs2_filecheck_is_dup_entry() argument
350 list_for_each_entry(p, &ent->fs_fcheck->fc_head, fe_list) { in ocfs2_filecheck_is_dup_entry()
361 ocfs2_filecheck_erase_entry(struct ocfs2_filecheck_sysfs_entry *ent) in ocfs2_filecheck_erase_entry() argument
365 list_for_each_entry(p, &ent->fs_fcheck->fc_head, fe_list) { in ocfs2_filecheck_erase_entry()
369 ent->fs_fcheck->fc_size--; in ocfs2_filecheck_erase_entry()
370 ent->fs_fcheck->fc_done--; in ocfs2_filecheck_erase_entry()
379 ocfs2_filecheck_erase_entries(struct ocfs2_filecheck_sysfs_entry *ent, in ocfs2_filecheck_erase_entries() argument
386 if (ocfs2_filecheck_erase_entry(ent)) in ocfs2_filecheck_erase_entries()
396 ocfs2_filecheck_done_entry(struct ocfs2_filecheck_sysfs_entry *ent, in ocfs2_filecheck_done_entry() argument
399 spin_lock(&ent->fs_fcheck->fc_lock); in ocfs2_filecheck_done_entry()
401 ent->fs_fcheck->fc_done++; in ocfs2_filecheck_done_entry()
402 spin_unlock(&ent->fs_fcheck->fc_lock); in ocfs2_filecheck_done_entry()
428 ocfs2_filecheck_handle_entry(struct ocfs2_filecheck_sysfs_entry *ent, in ocfs2_filecheck_handle_entry() argument
431 struct ocfs2_super *osb = container_of(ent, struct ocfs2_super, in ocfs2_filecheck_handle_entry()
443 ocfs2_filecheck_done_entry(ent, entry); in ocfs2_filecheck_handle_entry()
453 struct ocfs2_filecheck_sysfs_entry *ent = container_of(kobj, in ocfs2_filecheck_attr_store() local
463 ret = ocfs2_filecheck_adjust_max(ent, args.fa_len); in ocfs2_filecheck_attr_store()
473 spin_lock(&ent->fs_fcheck->fc_lock); in ocfs2_filecheck_attr_store()
474 if (ocfs2_filecheck_is_dup_entry(ent, args.fa_ino)) { in ocfs2_filecheck_attr_store()
477 } else if ((ent->fs_fcheck->fc_size >= ent->fs_fcheck->fc_max) && in ocfs2_filecheck_attr_store()
478 (ent->fs_fcheck->fc_done == 0)) { in ocfs2_filecheck_attr_store()
482 ent->fs_fcheck->fc_max); in ocfs2_filecheck_attr_store()
486 if ((ent->fs_fcheck->fc_size >= ent->fs_fcheck->fc_max) && in ocfs2_filecheck_attr_store()
487 (ent->fs_fcheck->fc_done > 0)) { in ocfs2_filecheck_attr_store()
492 BUG_ON(!ocfs2_filecheck_erase_entry(ent)); in ocfs2_filecheck_attr_store()
499 list_add_tail(&entry->fe_list, &ent->fs_fcheck->fc_head); in ocfs2_filecheck_attr_store()
500 ent->fs_fcheck->fc_size++; in ocfs2_filecheck_attr_store()
502 spin_unlock(&ent->fs_fcheck->fc_lock); in ocfs2_filecheck_attr_store()
505 ocfs2_filecheck_handle_entry(ent, entry); in ocfs2_filecheck_attr_store()