EXPORT_SYMBOL(locks_remove_posix);
+/* The i_flctx must be valid when calling into here */
static void
locks_remove_flock(struct file *filp)
{
};
struct file_lock_context *flctx = file_inode(filp)->i_flctx;
- if (!flctx || list_empty(&flctx->flc_flock))
+ if (list_empty(&flctx->flc_flock))
return;
if (filp->f_op->flock)
fl.fl_ops->fl_release_private(&fl);
}
+/* The i_flctx must be valid when calling into here */
static void
locks_remove_lease(struct file *filp)
{
struct file_lock *fl, *tmp;
LIST_HEAD(dispose);
- if (!ctx || list_empty(&ctx->flc_lease))
+ if (list_empty(&ctx->flc_lease))
return;
spin_lock(&ctx->flc_lock);
*/
void locks_remove_file(struct file *filp)
{
+ if (!file_inode(filp)->i_flctx)
+ return;
+
/* remove any OFD locks */
locks_remove_posix(filp, filp);