diff options
Diffstat (limited to 'fs/ubifs/misc.h')
-rw-r--r-- | fs/ubifs/misc.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/fs/ubifs/misc.h b/fs/ubifs/misc.h index 4c12a9215d7f..4fa81d867e41 100644 --- a/fs/ubifs/misc.h +++ b/fs/ubifs/misc.h | |||
@@ -310,4 +310,31 @@ static inline int ubifs_tnc_lookup(struct ubifs_info *c, | |||
310 | return ubifs_tnc_locate(c, key, node, NULL, NULL); | 310 | return ubifs_tnc_locate(c, key, node, NULL, NULL); |
311 | } | 311 | } |
312 | 312 | ||
313 | /** | ||
314 | * ubifs_get_lprops - get reference to LEB properties. | ||
315 | * @c: the UBIFS file-system description object | ||
316 | * | ||
317 | * This function locks lprops. Lprops have to be unlocked by | ||
318 | * 'ubifs_release_lprops()'. | ||
319 | */ | ||
320 | static inline void ubifs_get_lprops(struct ubifs_info *c) | ||
321 | { | ||
322 | mutex_lock(&c->lp_mutex); | ||
323 | } | ||
324 | |||
325 | /** | ||
326 | * ubifs_release_lprops - release lprops lock. | ||
327 | * @c: the UBIFS file-system description object | ||
328 | * | ||
329 | * This function has to be called after each 'ubifs_get_lprops()' call to | ||
330 | * unlock lprops. | ||
331 | */ | ||
332 | static inline void ubifs_release_lprops(struct ubifs_info *c) | ||
333 | { | ||
334 | ubifs_assert(mutex_is_locked(&c->lp_mutex)); | ||
335 | ubifs_assert(c->lst.empty_lebs >= 0 && | ||
336 | c->lst.empty_lebs <= c->main_lebs); | ||
337 | mutex_unlock(&c->lp_mutex); | ||
338 | } | ||
339 | |||
313 | #endif /* __UBIFS_MISC_H__ */ | 340 | #endif /* __UBIFS_MISC_H__ */ |