---
name: "lock_may_write"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/lock_may_write"
---

# lock\_may\_write(9)

checks that the region is free of locks

## NAME

lock\_may\_write - checks that the region is free of locks

## SYNOPSIS

**int lock\_may\_write(struct inode \*** *inode***, loff\_t** *start***, unsigned long** *len***);**

## ARGUMENTS

*inode*

the inode that is being written

*start*

the first byte to write

*len*

the number of bytes to write

## DESCRIPTION

Emulates Windows locking requirements. Whole-file mandatory locks (share modes) can prohibit a write and byte-range POSIX locks can prohibit a write if they overlap.

N.B. this function is only ever called from knfsd and ownership of locks is never checked.

## COPYRIGHT
