Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217522
b: refs/heads/master
c: 99dc829
h: refs/heads/master
v: v3
  • Loading branch information
Jerome Marchand authored and Linus Torvalds committed Oct 26, 2010
1 parent 9126a1e commit e4adeda
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4199ca77cc44c418972e8f30a36be7d26d21a0d2
refs/heads/master: 99dc829256bb8cfcb1f58b7f118893fdbf608e60
19 changes: 11 additions & 8 deletions trunk/fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -2109,7 +2109,7 @@ EXPORT_SYMBOL_GPL(vfs_cancel_lock);
#include <linux/seq_file.h>

static void lock_get_status(struct seq_file *f, struct file_lock *fl,
int id, char *pfx)
loff_t id, char *pfx)
{
struct inode *inode = NULL;
unsigned int fl_pid;
Expand All @@ -2122,7 +2122,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
if (fl->fl_file != NULL)
inode = fl->fl_file->f_path.dentry->d_inode;

seq_printf(f, "%d:%s ", id, pfx);
seq_printf(f, "%lld:%s ", id, pfx);
if (IS_POSIX(fl)) {
seq_printf(f, "%6s %s ",
(fl->fl_flags & FL_ACCESS) ? "ACCESS" : "POSIX ",
Expand Down Expand Up @@ -2185,24 +2185,27 @@ static int locks_show(struct seq_file *f, void *v)

fl = list_entry(v, struct file_lock, fl_link);

lock_get_status(f, fl, (long)f->private, "");
lock_get_status(f, fl, *((loff_t *)f->private), "");

list_for_each_entry(bfl, &fl->fl_block, fl_block)
lock_get_status(f, bfl, (long)f->private, " ->");
lock_get_status(f, bfl, *((loff_t *)f->private), " ->");

f->private++;
return 0;
}

static void *locks_start(struct seq_file *f, loff_t *pos)
{
loff_t *p = f->private;

lock_flocks();
f->private = (void *)1;
*p = (*pos + 1);
return seq_list_start(&file_lock_list, *pos);
}

static void *locks_next(struct seq_file *f, void *v, loff_t *pos)
{
loff_t *p = f->private;
++*p;
return seq_list_next(v, &file_lock_list, pos);
}

Expand All @@ -2220,14 +2223,14 @@ static const struct seq_operations locks_seq_operations = {

static int locks_open(struct inode *inode, struct file *filp)
{
return seq_open(filp, &locks_seq_operations);
return seq_open_private(filp, &locks_seq_operations, sizeof(loff_t));
}

static const struct file_operations proc_locks_operations = {
.open = locks_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
.release = seq_release_private,
};

static int __init proc_locks_init(void)
Expand Down

0 comments on commit e4adeda

Please sign in to comment.