• Home
  • Raw
  • Download

Lines Matching refs:fl

116 static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl)  in v9fs_file_lock()  argument
121 p9_debug(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); in v9fs_file_lock()
124 if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) in v9fs_file_lock()
127 if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) { in v9fs_file_lock()
135 static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) in v9fs_file_do_lock() argument
147 if ((fl->fl_flags & FL_POSIX) != FL_POSIX) in v9fs_file_do_lock()
150 res = locks_lock_file_wait(filp, fl); in v9fs_file_do_lock()
157 switch (fl->fl_type) { in v9fs_file_do_lock()
168 flock.start = fl->fl_start; in v9fs_file_do_lock()
169 if (fl->fl_end == OFFSET_MAX) in v9fs_file_do_lock()
172 flock.length = fl->fl_end - fl->fl_start + 1; in v9fs_file_do_lock()
173 flock.proc_id = fl->fl_pid; in v9fs_file_do_lock()
228 if (res < 0 && fl->fl_type != F_UNLCK) { in v9fs_file_do_lock()
229 fl_type = fl->fl_type; in v9fs_file_do_lock()
230 fl->fl_type = F_UNLCK; in v9fs_file_do_lock()
232 locks_lock_file_wait(filp, fl); in v9fs_file_do_lock()
233 fl->fl_type = fl_type; in v9fs_file_do_lock()
241 static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) in v9fs_file_getlock() argument
250 posix_test_lock(filp, fl); in v9fs_file_getlock()
255 if (fl->fl_type != F_UNLCK) in v9fs_file_getlock()
261 glock.start = fl->fl_start; in v9fs_file_getlock()
262 if (fl->fl_end == OFFSET_MAX) in v9fs_file_getlock()
265 glock.length = fl->fl_end - fl->fl_start + 1; in v9fs_file_getlock()
266 glock.proc_id = fl->fl_pid; in v9fs_file_getlock()
275 fl->fl_type = F_RDLCK; in v9fs_file_getlock()
278 fl->fl_type = F_WRLCK; in v9fs_file_getlock()
281 fl->fl_type = F_UNLCK; in v9fs_file_getlock()
285 fl->fl_start = glock.start; in v9fs_file_getlock()
287 fl->fl_end = OFFSET_MAX; in v9fs_file_getlock()
289 fl->fl_end = glock.start + glock.length - 1; in v9fs_file_getlock()
290 fl->fl_pid = -glock.proc_id; in v9fs_file_getlock()
306 static int v9fs_file_lock_dotl(struct file *filp, int cmd, struct file_lock *fl) in v9fs_file_lock_dotl() argument
312 filp, cmd, fl, filp); in v9fs_file_lock_dotl()
315 if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) in v9fs_file_lock_dotl()
318 if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) { in v9fs_file_lock_dotl()
324 ret = v9fs_file_do_lock(filp, cmd, fl); in v9fs_file_lock_dotl()
326 ret = v9fs_file_getlock(filp, fl); in v9fs_file_lock_dotl()
342 struct file_lock *fl) in v9fs_file_flock_dotl() argument
348 filp, cmd, fl, filp); in v9fs_file_flock_dotl()
351 if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) in v9fs_file_flock_dotl()
354 if (!(fl->fl_flags & FL_FLOCK)) in v9fs_file_flock_dotl()
357 if ((IS_SETLK(cmd) || IS_SETLKW(cmd)) && fl->fl_type != F_UNLCK) { in v9fs_file_flock_dotl()
362 fl->fl_flags |= FL_POSIX; in v9fs_file_flock_dotl()
363 fl->fl_flags ^= FL_FLOCK; in v9fs_file_flock_dotl()
366 ret = v9fs_file_do_lock(filp, cmd, fl); in v9fs_file_flock_dotl()