Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75e1fcc0 authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Linus Torvalds
Browse files

[PATCH] vfs: add lock owner argument to flush operation



Pass the POSIX lock owner ID to the flush operation.

This is useful for filesystems which don't want to store any locking state
in inode->i_flock but want to handle locking/unlocking POSIX locks
internally.  FUSE is one such filesystem but I think it possible that some
network filesystems would need this also.

Also add a flag to indicate that a POSIX locking request was generated by
close(), so filesystems using the above feature won't send an extra locking
request in this case.

Signed-off-by: default avatarMiklos Szeredi <miklos@szeredi.hu>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ff7b86b8
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -532,7 +532,6 @@ static ctl_table pfm_sysctl_root[] = {
static struct ctl_table_header *pfm_sysctl_header;
static struct ctl_table_header *pfm_sysctl_header;


static int pfm_context_unload(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs);
static int pfm_context_unload(pfm_context_t *ctx, void *arg, int count, struct pt_regs *regs);
static int pfm_flush(struct file *filp);


#define pfm_get_cpu_var(v)		__ia64_per_cpu_var(v)
#define pfm_get_cpu_var(v)		__ia64_per_cpu_var(v)
#define pfm_get_cpu_data(a,b)		per_cpu(a, b)
#define pfm_get_cpu_data(a,b)		per_cpu(a, b)
@@ -1774,7 +1773,7 @@ pfm_syswide_cleanup_other_cpu(pfm_context_t *ctx)
 * When caller is self-monitoring, the context is unloaded.
 * When caller is self-monitoring, the context is unloaded.
 */
 */
static int
static int
pfm_flush(struct file *filp)
pfm_flush(struct file *filp, fl_owner_t id)
{
{
	pfm_context_t *ctx;
	pfm_context_t *ctx;
	struct task_struct *task;
	struct task_struct *task;
+1 −1
Original line number Original line Diff line number Diff line
@@ -82,7 +82,7 @@ static int evdev_fasync(int fd, struct file *file, int on)
	return retval < 0 ? retval : 0;
	return retval < 0 ? retval : 0;
}
}


static int evdev_flush(struct file * file)
static int evdev_flush(struct file * file, fl_owner_t id)
{
{
	struct evdev_list *list = file->private_data;
	struct evdev_list *list = file->private_data;
	if (!list->evdev->exist) return -ENODEV;
	if (!list->evdev->exist) return -ENODEV;
+1 −1
Original line number Original line Diff line number Diff line
@@ -4724,7 +4724,7 @@ static int os_scsi_tape_open(struct inode * inode, struct file * filp)




/* Flush the tape buffer before close */
/* Flush the tape buffer before close */
static int os_scsi_tape_flush(struct file * filp)
static int os_scsi_tape_flush(struct file * filp, fl_owner_t id)
{
{
	int		      result = 0, result2;
	int		      result = 0, result2;
	struct osst_tape    * STp    = filp->private_data;
	struct osst_tape    * STp    = filp->private_data;
+1 −1
Original line number Original line Diff line number Diff line
@@ -1193,7 +1193,7 @@ static int st_open(struct inode *inode, struct file *filp)




/* Flush the tape buffer before close */
/* Flush the tape buffer before close */
static int st_flush(struct file *filp)
static int st_flush(struct file *filp, fl_owner_t id)
{
{
	int result = 0, result2;
	int result = 0, result2;
	unsigned char cmd[MAX_COMMAND_SIZE];
	unsigned char cmd[MAX_COMMAND_SIZE];
+1 −1
Original line number Original line Diff line number Diff line
@@ -74,7 +74,7 @@ extern ssize_t cifs_user_write(struct file *file, const char __user *write_data,
			 size_t write_size, loff_t * poffset);
			 size_t write_size, loff_t * poffset);
extern int cifs_lock(struct file *, int, struct file_lock *);
extern int cifs_lock(struct file *, int, struct file_lock *);
extern int cifs_fsync(struct file *, struct dentry *, int);
extern int cifs_fsync(struct file *, struct dentry *, int);
extern int cifs_flush(struct file *);
extern int cifs_flush(struct file *, fl_owner_t id);
extern int cifs_file_mmap(struct file * , struct vm_area_struct *);
extern int cifs_file_mmap(struct file * , struct vm_area_struct *);
extern const struct file_operations cifs_dir_ops;
extern const struct file_operations cifs_dir_ops;
extern int cifs_dir_open(struct inode *inode, struct file *file);
extern int cifs_dir_open(struct inode *inode, struct file *file);
Loading