patch-2.4.0-test9 linux/include/linux/fs.h

Next file: linux/include/linux/gameport.h
Previous file: linux/include/linux/fcntl.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test8/linux/include/linux/fs.h linux/include/linux/fs.h
@@ -54,6 +54,7 @@
 };
 extern struct files_stat_struct files_stat;
 extern int max_super_blocks, nr_super_blocks;
+extern int leases_enable, dir_notify_enable, lease_break_time;
 
 #define NR_FILE  8192	/* this can well be larger on a larger system */
 #define NR_RESERVED_FILES 10 /* reserved for root */
@@ -93,7 +94,7 @@
 				  * as nfs_rename() will be cleaned up
 				  */
 /*
- * These are the fs-independent mount-flags: up to 16 flags are supported
+ * These are the fs-independent mount-flags: up to 32 flags are supported
  */
 #define MS_RDONLY	 1	/* Mount read-only */
 #define MS_NOSUID	 2	/* Ignore suid and sgid bits */
@@ -104,6 +105,7 @@
 #define MS_MANDLOCK	64	/* Allow mandatory locks on an FS */
 #define MS_NOATIME	1024	/* Do not update access times. */
 #define MS_NODIRATIME	2048	/* Do not update directory access times */
+#define MS_BIND		4096
 
 /*
  * Flags that can be altered by MS_REMOUNT
@@ -409,6 +411,9 @@
 	struct pipe_inode_info	*i_pipe;
 	struct block_device	*i_bdev;
 
+	unsigned long		i_dnotify_mask; /* Directory notify events */
+	struct dnotify_struct	*i_dnotify; /* for directory notifications */
+
 	unsigned long		i_state;
 
 	unsigned int		i_flags;
@@ -498,6 +503,7 @@
 #define FL_BROKEN	4	/* broken flock() emulation */
 #define FL_ACCESS	8	/* for processes suspended by mandatory locking */
 #define FL_LOCKD	16	/* lock held by rpc.lockd */
+#define FL_LEASE	32	/* lease held on this file */
 
 /*
  * The POSIX file lock owner is determined by
@@ -512,6 +518,7 @@
 	struct file_lock *fl_next;	/* singly linked list for this inode  */
 	struct list_head fl_link;	/* doubly linked list of all locks */
 	struct list_head fl_block; /* circular list of blocked processes */
+	struct list_head fl_list;	/* block list member */
 	fl_owner_t fl_owner;
 	unsigned int fl_pid;
 	wait_queue_head_t fl_wait;
@@ -525,6 +532,8 @@
 	void (*fl_insert)(struct file_lock *);	/* lock insertion callback */
 	void (*fl_remove)(struct file_lock *);	/* lock removal callback */
 
+	struct fasync_struct *	fl_fasync; /* for lease break notifications */
+
 	union {
 		struct nfs_lock_info	nfs_fl;
 	} fl_u;
@@ -538,6 +547,7 @@
 #endif
 
 extern struct list_head file_lock_list;
+extern struct semaphore file_lock_sem;
 
 #include <linux/fcntl.h>
 
@@ -548,12 +558,18 @@
 extern int fcntl_setlk64(unsigned int, unsigned int, struct flock64 *);
 
 /* fs/locks.c */
+extern void locks_init_lock(struct file_lock *);
+extern void locks_copy_lock(struct file_lock *, struct file_lock *);
 extern void locks_remove_posix(struct file *, fl_owner_t);
 extern void locks_remove_flock(struct file *);
 extern struct file_lock *posix_test_lock(struct file *, struct file_lock *);
 extern int posix_lock_file(struct file *, struct file_lock *, unsigned int);
 extern void posix_block_lock(struct file_lock *, struct file_lock *);
 extern void posix_unblock_lock(struct file_lock *);
+extern int __get_lease(struct inode *inode, unsigned int flags);
+extern time_t lease_get_mtime(struct inode *);
+extern int lock_may_read(struct inode *, loff_t start, unsigned long count);
+extern int lock_may_write(struct inode *, loff_t start, unsigned long count);
 
 struct fasync_struct {
 	int	magic;
@@ -886,6 +902,12 @@
 	return 0;
 }
 
+extern inline int get_lease(struct inode *inode, unsigned int mode)
+{
+	if (inode->i_flock && (inode->i_flock->fl_flags & FL_LEASE))
+		return __get_lease(inode, mode);
+	return 0;
+}
 
 /* fs/open.c */
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)