Lines Matching refs:lockfd
139 #define META_LOCK_FD(sp) ((sp)->lockfd)
151 int lockfd = META_LOCK_FD(sp);
155 if (lockfd >= 0)
157 assert(lockfd == MD_NO_LOCK);
160 if ((lockfd = open(lockname, O_WRONLY, 0)) < 0) {
162 lockfd = MD_NO_LOCK;
169 if ((lockfd = open(lockname, (O_WRONLY|O_CREAT),
174 if (fchmod(lockfd, 0644) != 0) {
184 META_LOCK_FD(sp) = lockfd;
191 if (lockfd >= 0)
192 (void) close(lockfd);
227 int lockfd = META_LOCK_FD(sp);
230 if (lockfd == MD_NO_LOCK)
233 assert(lockfd >= 0);
236 if (lockf(lockfd, F_ULOCK, 0) != 0) {
254 int lockfd;
264 if ((lockfd = META_LOCK_FD(sp)) == MD_NO_LOCK)
266 assert(lockfd >= 0);
271 if (lockf(lockfd, F_TLOCK, 0) != 0) {
280 if (lockf(lockfd, F_LOCK, 0) != 0) {
296 if (lockfd >= 0)
307 int lockfd;
317 if ((lockfd = META_LOCK_FD(sp)) == MD_NO_LOCK)
319 assert(lockfd >= 0);
324 if (lockf(lockfd, F_TLOCK, 0) != 0) {
343 if (lockfd >= 0)
357 int lockfd;
365 lockfd = META_LOCK_FD(sp);
367 if (lockfd == MD_NO_LOCK)
369 assert(lockfd >= 0);
372 if (lockf(lockfd, F_TEST, 0) != 0) {