• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/usr.sbin/rpc.lockd/

Lines Matching refs:fl

156 enum partialfilelock_status lock_partialfilelock(struct file_lock *fl);
158 void send_granted(struct file_lock *fl, int opcode);
170 void deallocate_file_lock(struct file_lock *fl);
171 void fill_file_lock(struct file_lock *fl, const fhandle_t *fh,
189 void dump_filelock(const struct file_lock *fl);
190 struct file_lock * get_lock_matching_unlock(const struct file_lock *fl);
191 enum nfslock_status test_nfslock(const struct file_lock *fl,
193 enum nfslock_status lock_nfslock(struct file_lock *fl);
194 enum nfslock_status delete_nfslock(struct file_lock *fl);
195 enum nfslock_status unlock_nfslock(const struct file_lock *fl,
198 enum hwlock_status lock_hwlock(struct file_lock *fl);
202 int duplicate_block(struct file_lock *fl);
203 void add_blockingfilelock(struct file_lock *fl);
204 enum hwlock_status unlock_hwlock(const struct file_lock *fl);
205 enum hwlock_status test_hwlock(const struct file_lock *fl,
207 void remove_blockingfilelock(struct file_lock *fl);
211 const struct file_lock *fl);
214 const struct file_lock *fl, struct file_lock **conflicting_fl);
215 enum nlm_stats do_test(struct file_lock *fl,
217 enum nlm_stats do_unlock(struct file_lock *fl);
218 enum nlm_stats do_lock(struct file_lock *fl);
319 dump_filelock(const struct file_lock *fl)
330 if (fl != NULL) {
331 debuglog("Dumping file lock structure @ %p\n", fl);
334 dump_static_object((unsigned char *)&fl->filehandle,
335 sizeof(fl->filehandle), hbuff, sizeof(hbuff),
342 fl->client.exclusive, fl->client.svid,
343 fl->client.l_offset, fl->client.l_len);
347 dump_netobj(&fl->client.oh);
350 dump_netobj(&fl->client_cookie);
353 " client_name: %s\n", fl->nsm_status, fl->status,
354 fl->flags, fl->client.svid, fl->client_name);
445 fill_file_lock(struct file_lock *fl, const fhandle_t *fh,
450 bcopy(fh, &fl->filehandle, sizeof(fhandle_t));
452 fl->client.exclusive = exclusive;
453 fl->client.svid = svid;
454 fl->client.l_offset = offset;
455 fl->client.l_len = len;
457 fl->nsm_status = state;
458 fl->status = status;
459 fl->flags = flags;
460 fl->blocking = blocking;
467 deallocate_file_lock(struct file_lock *fl)
469 free(fl->addr);
470 free(fl->client.oh.n_bytes);
471 free(fl->client_cookie.n_bytes);
472 free(fl);
726 get_lock_matching_unlock(const struct file_lock *fl)
731 debuglog("********Dump of fl*****************\n");
732 dump_filelock(fl);
747 if (bcmp(&fl->filehandle, &ifl->filehandle, sizeof(fhandle_t)))
754 if (!regions_overlap(fl->client.l_offset, fl->client.l_len,
760 fl->client.l_offset,fl->client.l_len,
764 if (!same_filelock_identity(fl,ifl))
790 test_nfslock(const struct file_lock *fl, struct file_lock **conflicting_fl)
805 dump_filelock(fl);
827 if (bcmp(&fl->filehandle, &ifl->filehandle, sizeof(fhandle_t)))
833 if (!regions_overlap(fl->client.l_offset, fl->client.l_len,
839 fl->client.l_offset,fl->client.l_len,
843 if (!(fl->client.exclusive || ifl->client.exclusive))
847 fl->client.exclusive,
850 if (same_filelock_identity(fl,ifl)) {
858 dump_filelock(fl);
878 * Argument fl gets modified as its list housekeeping entries get modified
891 lock_nfslock(struct file_lock *fl)
900 retval = test_nfslock(fl,&dummy_fl);
904 dump_filelock(fl);
905 LIST_INSERT_HEAD(&nfslocklist_head, fl, nfslocklist);
925 delete_nfslock(struct file_lock *fl)
928 LIST_REMOVE(fl, nfslocklist);
980 unlock_nfslock(fl, released_lock, left_lock, right_lock)
981 const struct file_lock *fl;
999 mfl = get_lock_matching_unlock(fl);
1004 spstatus = split_nfslock(mfl, fl, left_lock, right_lock);
1006 debuglog("Split returned %d %p %p %p %p\n",spstatus,mfl,fl,*left_lock,*right_lock);
1009 dump_filelock(fl);
1055 lock_hwlock(struct file_lock *fl)
1062 if (bcmp(&fl->filehandle, &imf->filehandle,
1063 sizeof(fl->filehandle)) == 0) {
1087 nmf->fd = fhopen(&fl->filehandle, O_RDWR);
1090 fl->client_name, strerror(errno));
1103 bcopy(&fl->filehandle, &nmf->filehandle, sizeof(fl->filehandle));
1105 nmf->exclusive = fl->client.exclusive;
1114 fl->client_name, strerror(errno));
1133 debuglog("flock succeeded (from %16s)\n", fl->client_name);
1138 unlock_hwlock(const struct file_lock *fl)
1147 if (bcmp(&fl->filehandle, &imf->filehandle,
1148 sizeof(fl->filehandle)) == 0) {
1179 test_hwlock(fl, conflicting_fl)
1180 const struct file_lock *fl __unused;
1200 duplicate_block(struct file_lock *fl)
1213 if (!bcmp(&fl->filehandle, &ifl->filehandle,
1215 fl->client.exclusive == ifl->client.exclusive &&
1216 fl->client.l_offset == ifl->client.l_offset &&
1217 fl->client.l_len == ifl->client.l_len &&
1218 same_filelock_identity(fl, ifl)) {
1230 add_blockingfilelock(struct file_lock *fl)
1241 if (duplicate_block(fl)) {
1251 fl->blocking = 0;
1252 LIST_INSERT_HEAD(&blockedlocklist_head, fl, nfslocklist);
1258 remove_blockingfilelock(struct file_lock *fl)
1263 LIST_REMOVE(fl, nfslocklist);
1346 * Argument fl gets modified as its list housekeeping entries get modified
1364 lock_partialfilelock(struct file_lock *fl)
1379 lnlstatus = lock_nfslock(fl);
1388 hwstatus = lock_hwlock(fl);
1404 monitor_lock_host(fl->client_name);
1423 delete_nfslock(fl);
1439 * By the time fl reaches here, it is completely free again on
1446 if (fl->blocking == 1) {
1451 add_blockingfilelock(fl);
1452 dump_filelock(fl);
1456 dump_filelock(fl);
1461 dump_filelock(fl);
1480 unlock_partialfilelock(const struct file_lock *fl)
1520 unlstatus = unlock_nfslock(fl, &releasedfl, &lfl, &rfl);
1549 unlhwstatus = unlock_hwlock(fl);
1584 dump_filelock(fl);
1589 if (fl == releasedfl) {
1614 * This statement wipes out the incoming file lock (fl)
1671 test_partialfilelock(const struct file_lock *fl,
1681 teststatus = test_nfslock(fl, conflicting_fl);
1689 dump_filelock(fl);
1695 dump_filelock(fl);
1716 do_test(struct file_lock *fl, struct file_lock **conflicting_fl)
1723 pfsret = test_partialfilelock(fl,conflicting_fl);
1728 dump_filelock(fl);
1730 retval = (fl->flags & LOCK_V4) ? nlm4_granted : nlm_granted;
1734 dump_filelock(fl);
1738 retval = (fl->flags & LOCK_V4) ? nlm4_granted : nlm_granted;
1743 dump_filelock(fl);
1745 retval = (fl->flags & LOCK_V4) ? nlm4_denied : nlm_denied;
1750 dump_filelock(fl);
1752 retval = (fl->flags & LOCK_V4) ? nlm4_denied_nolocks : nlm_denied_nolocks;
1756 dump_filelock(fl);
1758 retval = (fl->flags & LOCK_V4) ? nlm4_failed : nlm_denied;
1775 do_lock(struct file_lock *fl)
1782 pfsret = lock_partialfilelock(fl);
1787 dump_filelock(fl);
1788 retval = (fl->flags & LOCK_V4) ? nlm4_granted : nlm_granted;
1792 dump_filelock(fl);
1793 retval = (fl->flags & LOCK_V4) ? nlm4_granted : nlm_granted;
1798 dump_filelock(fl);
1799 retval = (fl->flags & LOCK_V4) ? nlm4_denied : nlm_denied;
1804 dump_filelock(fl);
1805 retval = (fl->flags & LOCK_V4) ? nlm4_blocked : nlm_blocked;
1810 dump_filelock(fl);
1811 retval = (fl->flags & LOCK_V4) ? nlm4_denied_nolocks : nlm_denied_nolocks;
1815 dump_filelock(fl);
1816 retval = (fl->flags & LOCK_V4) ? nlm4_failed : nlm_denied;
1826 do_unlock(struct file_lock *fl)
1832 pfsret = unlock_partialfilelock(fl);
1837 dump_filelock(fl);
1838 retval = (fl->flags & LOCK_V4) ? nlm4_granted : nlm_granted;
1843 dump_filelock(fl);
1844 retval = (fl->flags & LOCK_V4) ? nlm4_denied : nlm_denied;
1849 retval = (fl->flags & LOCK_V4) ? nlm4_granted : nlm_granted;
1854 dump_filelock(fl);
1855 retval = (fl->flags & LOCK_V4) ? nlm4_denied_nolocks : nlm_denied_nolocks;
1859 dump_filelock(fl);
1860 retval = (fl->flags & LOCK_V4) ? nlm4_failed : nlm_denied;
1999 struct file_lock fl;
2006 bzero(&fl,sizeof(struct file_lock));
2007 bcopy(lock->fh.n_bytes, &fl.filehandle, sizeof(fhandle_t));
2009 copy_nlm4_lock_to_nlm4_holder(lock, 0, &fl.client);
2011 err = do_unlock(&fl);
2191 send_granted(fl, opcode)
2192 struct file_lock *fl;
2204 cli = get_client(fl->addr,
2205 (fl->flags & LOCK_V4) ? NLM_VERS4 : NLM_VERS);
2208 fl->client_name);
2217 timeo.tv_usec = (fl->flags & LOCK_ASYNC) ? 0 : 500000; /* 0.5s */
2219 if (fl->flags & LOCK_V4) {
2221 res.cookie = fl->client_cookie;
2222 res.exclusive = fl->client.exclusive;
2223 res.alock.caller_name = fl->client_name;
2225 res.alock.fh.n_bytes = (char*)&fl->filehandle;
2226 res.alock.oh = fl->client.oh;
2227 res.alock.svid = fl->client.svid;
2228 res.alock.l_offset = fl->client.l_offset;
2229 res.alock.l_len = fl->client.l_len;
2231 (fl->flags & LOCK_ASYNC) ? " (async)":"");
2232 if (fl->flags & LOCK_ASYNC) {
2244 res.cookie = fl->client_cookie;
2245 res.exclusive = fl->client.exclusive;
2246 res.alock.caller_name = fl->client_name;
2248 res.alock.fh.n_bytes = (char*)&fl->filehandle;
2249 res.alock.oh = fl->client.oh;
2250 res.alock.svid = fl->client.svid;
2251 res.alock.l_offset = fl->client.l_offset;
2252 res.alock.l_len = fl->client.l_len;
2254 (fl->flags & LOCK_ASYNC) ? " (async)":"");
2255 if (fl->flags & LOCK_ASYNC) {