* linux-next: manual merge of the vfs tree with the file-locks tree
@ 2015-12-07 1:57 Stephen Rothwell
0 siblings, 0 replies; only message in thread
From: Stephen Rothwell @ 2015-12-07 1:57 UTC (permalink / raw)
To: Al Viro, Jeff Layton
Cc: linux-next, linux-kernel, Jeff Layton, Christoph Hellwig
Hi Al,
Today's linux-next merge of the vfs tree got a conflict in:
include/linux/fs.h
between commit:
9e8925b67a80 ("locks: Allow disabling mandatory locking at compile time")
from the file-locks tree and commit:
9e48b0c90a29 ("locks: new locks_mandatory_area calling convention")
from the vfs tree.
I fixed it up (see below) and can carry the fix as necessary (no action
is required).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc include/linux/fs.h
index cbf08d5c246e,59bf96d82d1d..000000000000
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@@ -2027,12 -2035,9 +2035,9 @@@ extern struct kobject *fs_kobj
#define MAX_RW_COUNT (INT_MAX & PAGE_CACHE_MASK)
- #define FLOCK_VERIFY_READ 1
- #define FLOCK_VERIFY_WRITE 2
-
-#ifdef CONFIG_FILE_LOCKING
+#ifdef CONFIG_MANDATORY_FILE_LOCKING
extern int locks_mandatory_locked(struct file *);
- extern int locks_mandatory_area(int, struct inode *, struct file *, loff_t, size_t);
+ extern int locks_mandatory_area(struct file *, loff_t, loff_t, unsigned char);
/*
* Candidates for mandatory locking have the setgid bit set
@@@ -2065,55 -2070,18 +2070,56 @@@ static inline int locks_verify_truncate
struct file *filp,
loff_t size)
{
- if (inode->i_flctx && mandatory_lock(inode))
- return locks_mandatory_area(
- FLOCK_VERIFY_WRITE, inode, filp,
- size < inode->i_size ? size : inode->i_size,
- (size < inode->i_size ? inode->i_size - size
- : size - inode->i_size)
- );
- return 0;
+ if (!inode->i_flctx || !mandatory_lock(inode))
+ return 0;
+
+ if (size < inode->i_size) {
+ return locks_mandatory_area(filp, size, inode->i_size - 1,
+ F_WRLCK);
+ } else {
+ return locks_mandatory_area(filp, inode->i_size, size - 1,
+ F_WRLCK);
+ }
}
+#else /* !CONFIG_MANDATORY_FILE_LOCKING */
+
+static inline int locks_mandatory_locked(struct file *file)
+{
+ return 0;
+}
+
- static inline int locks_mandatory_area(int rw, struct inode *inode,
- struct file *filp, loff_t offset,
- size_t count)
++static inline int locks_mandatory_area(struct file *filp, loff_t start,
++ loff_t end, unsigned char type)
+{
+ return 0;
+}
+
+static inline int __mandatory_lock(struct inode *inode)
+{
+ return 0;
+}
+
+static inline int mandatory_lock(struct inode *inode)
+{
+ return 0;
+}
+
+static inline int locks_verify_locked(struct file *file)
+{
+ return 0;
+}
+
+static inline int locks_verify_truncate(struct inode *inode, struct file *filp,
+ size_t size)
+{
+ return 0;
+}
+
+#endif /* CONFIG_MANDATORY_FILE_LOCKING */
+
+
+#ifdef CONFIG_FILE_LOCKING
static inline int break_lease(struct inode *inode, unsigned int mode)
{
/*
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-12-07 1:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-07 1:57 linux-next: manual merge of the vfs tree with the file-locks tree Stephen Rothwell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).