aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/fs.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-10-08 11:00:01 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-10-08 11:00:01 -0400
commitf334bcd94b7d3c0fbc34d518a86548f451ab5faf (patch)
tree357b0cbd488db581bc9bf710c3696579d21fac03 /include/linux/fs.h
parent73e8fb2d596d5903cde6dcced39c0b88b5770a56 (diff)
parent814184fd402557f3e5960db469157ccdf1fb69da (diff)
Merge remote-tracking branch 'ovl/misc' into work.misc
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r--include/linux/fs.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 2f6f059d739c..9347f4a2abed 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -224,6 +224,7 @@ typedef int (dio_iodone_t)(struct kiocb *iocb, loff_t offset,
224#define ATTR_KILL_PRIV (1 << 14) 224#define ATTR_KILL_PRIV (1 << 14)
225#define ATTR_OPEN (1 << 15) /* Truncating from open(O_TRUNC) */ 225#define ATTR_OPEN (1 << 15) /* Truncating from open(O_TRUNC) */
226#define ATTR_TIMES_SET (1 << 16) 226#define ATTR_TIMES_SET (1 << 16)
227#define ATTR_TOUCH (1 << 17)
227 228
228/* 229/*
229 * Whiteout is represented by a char device. The following constants define the 230 * Whiteout is represented by a char device. The following constants define the
@@ -1064,6 +1065,18 @@ struct file_lock_context {
1064 1065
1065extern void send_sigio(struct fown_struct *fown, int fd, int band); 1066extern void send_sigio(struct fown_struct *fown, int fd, int band);
1066 1067
1068/*
1069 * Return the inode to use for locking
1070 *
1071 * For overlayfs this should be the overlay inode, not the real inode returned
1072 * by file_inode(). For any other fs file_inode(filp) and locks_inode(filp) are
1073 * equal.
1074 */
1075static inline struct inode *locks_inode(const struct file *f)
1076{
1077 return f->f_path.dentry->d_inode;
1078}
1079
1067#ifdef CONFIG_FILE_LOCKING 1080#ifdef CONFIG_FILE_LOCKING
1068extern int fcntl_getlk(struct file *, unsigned int, struct flock __user *); 1081extern int fcntl_getlk(struct file *, unsigned int, struct flock __user *);
1069extern int fcntl_setlk(unsigned int, struct file *, unsigned int, 1082extern int fcntl_setlk(unsigned int, struct file *, unsigned int,
@@ -1251,7 +1264,7 @@ static inline struct dentry *file_dentry(const struct file *file)
1251 1264
1252static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl) 1265static inline int locks_lock_file_wait(struct file *filp, struct file_lock *fl)
1253{ 1266{
1254 return locks_lock_inode_wait(file_inode(filp), fl); 1267 return locks_lock_inode_wait(locks_inode(filp), fl);
1255} 1268}
1256 1269
1257struct fasync_struct { 1270struct fasync_struct {
@@ -2006,7 +2019,6 @@ enum file_time_flags {
2006 S_VERSION = 8, 2019 S_VERSION = 8,
2007}; 2020};
2008 2021
2009extern bool atime_needs_update(const struct path *, struct inode *);
2010extern void touch_atime(const struct path *); 2022extern void touch_atime(const struct path *);
2011static inline void file_accessed(struct file *file) 2023static inline void file_accessed(struct file *file)
2012{ 2024{
@@ -2155,7 +2167,7 @@ static inline int mandatory_lock(struct inode *ino)
2155 2167
2156static inline int locks_verify_locked(struct file *file) 2168static inline int locks_verify_locked(struct file *file)
2157{ 2169{
2158 if (mandatory_lock(file_inode(file))) 2170 if (mandatory_lock(locks_inode(file)))
2159 return locks_mandatory_locked(file); 2171 return locks_mandatory_locked(file);
2160 return 0; 2172 return 0;
2161} 2173}