It is possible that one field in the libmnt_fs struct requires
fetching multiple statmount fields using multiple STATMOUNT_* mask
items. This requires changes to the way the fs->stmnt_done mask is
used.
Signed-off-by: Karel Zak <kzak@redhat.com>
/* add default mask if on-demand enabled */
if (fs->stmnt
&& !fs->stmnt->disabled
- && fs->stmnt->mask
- && !(fs->stmnt_done & fs->stmnt->mask))
+ && fs->stmnt->mask)
mask |= fs->stmnt->mask;
+ /* call only for missing stuff */
+ if (mask && fs->stmnt_done) {
+ mask &= ~fs->stmnt_done; /* remove what is already done */
+ if (!mask)
+ return 0;
+ }
+
/* ignore repeated requests */
if (mask && fs->stmnt_done & mask)
return 0;
if (!(FS)->MEMBER \
&& (FS)->stmnt \
&& !(FS)->stmnt->disabled \
- && !((FS)->stmnt_done & (FLAGS))) \
+ && ((FLAGS) & ~((FS)->stmnt_done))) \
mnt_fs_fetch_statmount((FS), (FLAGS)); })
#endif