hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/fs/ocfs2/locks.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* -*- mode: c; c-basic-offset: 8; -*-
23 * vim: noexpandtab sw=8 ts=8 sts=0:
34 *
....@@ -6,21 +7,6 @@
67 * Userspace file locking support
78 *
89 * Copyright (C) 2007 Oracle. All rights reserved.
9
- *
10
- * This program is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU General Public
12
- * License as published by the Free Software Foundation; either
13
- * version 2 of the License, or (at your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful,
16
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
- * General Public License for more details.
19
- *
20
- * You should have received a copy of the GNU General Public
21
- * License along with this program; if not, write to the
22
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23
- * Boston, MA 021110-1307, USA.
2410 */
2511
2612 #include <linux/fs.h>
....@@ -52,6 +38,7 @@
5238 if (lockres->l_flags & OCFS2_LOCK_ATTACHED &&
5339 lockres->l_level > LKM_NLMODE) {
5440 int old_level = 0;
41
+ struct file_lock request;
5542
5643 if (lockres->l_level == LKM_EXMODE)
5744 old_level = 1;
....@@ -66,11 +53,10 @@
6653 * level.
6754 */
6855
69
- locks_lock_file_wait(file,
70
- &(struct file_lock) {
71
- .fl_type = F_UNLCK,
72
- .fl_flags = FL_FLOCK
73
- });
56
+ locks_init_lock(&request);
57
+ request.fl_type = F_UNLCK;
58
+ request.fl_flags = FL_FLOCK;
59
+ locks_lock_file_wait(file, &request);
7460
7561 ocfs2_file_unlock(file);
7662 }