struct lu_name *lname, struct lu_fid *pfid);
int linkea_entry_pack(struct link_ea_entry *lee, const struct lu_name *lname,
const struct lu_fid *pfid);
+bool linkea_will_overflow(struct linkea_data *ldata,
+ const struct lu_name *lname);
int linkea_add_buf(struct linkea_data *ldata, const struct lu_name *lname,
const struct lu_fid *pfid, bool err_on_overflow);
void linkea_del_buf(struct linkea_data *ldata, const struct lu_name *lname,
newdata = true;
nodata:
+ if (rc == -ENOENT &&
+ linkea_will_overflow(&ldata, cname)) {
+ CDEBUG(D_INODE, "No enough space to hold linkea entry '"
+ DFID": %.*s' at %u\n", PFID(pfid),
+ cname->ln_namelen, cname->ln_name,
+ ldata.ld_leh->leh_overflow_time);
+ log = true;
+ rc = 0;
+ goto stop;
+ }
+
if (bk->lb_param & LPF_DRYRUN) {
if (rc == -ENODATA)
ns->ln_flags |= LF_UPGRADE;
}
EXPORT_SYMBOL(linkea_entry_unpack);
+bool linkea_will_overflow(struct linkea_data *ldata,
+ const struct lu_name *lname)
+{
+ struct link_ea_header *leh = ldata->ld_leh;
+ int reclen = lname->ln_namelen + sizeof(struct link_ea_entry);
+
+ if (unlikely(leh->leh_len + reclen > MAX_LINKEA_SIZE))
+ return true;
+ return false;
+}
+EXPORT_SYMBOL(linkea_will_overflow);
+
/**
* Add a record to the end of link ea buf
**/