aboutsummaryrefslogtreecommitdiffstats
path: root/fs/locks.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 20:15:20 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-10-26 20:15:20 -0400
commit31453a9764f7e2a72a6e2c502ace586e2663a68c (patch)
tree5d4db63de5b4b85d1ffdab4e95a75175a784a10a /fs/locks.c
parentf9ba5375a8aae4aeea6be15df77e24707a429812 (diff)
parent93ed0e2d07b25aff4db1d61bfbcd1e82074c0ad5 (diff)
Merge branch 'akpm-incoming-1'
* akpm-incoming-1: (176 commits) scripts/checkpatch.pl: add check for declaration of pci_device_id scripts/checkpatch.pl: add warnings for static char that could be static const char checkpatch: version 0.31 checkpatch: statement/block context analyser should look at sanitised lines checkpatch: handle EXPORT_SYMBOL for DEVICE_ATTR and similar checkpatch: clean up structure definition macro handline checkpatch: update copyright dates checkpatch: Add additional attribute #defines checkpatch: check for incorrect permissions checkpatch: ensure kconfig help checks only apply when we are adding help checkpatch: simplify and consolidate "missing space after" checks checkpatch: add check for space after struct, union, and enum checkpatch: returning errno typically should be negative checkpatch: handle casts better fixing false categorisation of : as binary checkpatch: ensure we do not collapse bracketed sections into constants checkpatch: suggest cleanpatch and cleanfile when appropriate checkpatch: types may sit on a line on their own checkpatch: fix regressions in "fix handling of leading spaces" div64_u64(): improve precision on 32bit platforms lib/parser: cleanup match_number() ...
Diffstat (limited to 'fs/locks.c')
-rw-r--r--fs/locks.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/fs/locks.c b/fs/locks.c
index 8b2b6ad56a09..4de3a2666810 100644
--- a/fs/locks.c
+++ b/fs/locks.c
@@ -2109,7 +2109,7 @@ EXPORT_SYMBOL_GPL(vfs_cancel_lock);
2109#include <linux/seq_file.h> 2109#include <linux/seq_file.h>
2110 2110
2111static void lock_get_status(struct seq_file *f, struct file_lock *fl, 2111static void lock_get_status(struct seq_file *f, struct file_lock *fl,
2112 int id, char *pfx) 2112 loff_t id, char *pfx)
2113{ 2113{
2114 struct inode *inode = NULL; 2114 struct inode *inode = NULL;
2115 unsigned int fl_pid; 2115 unsigned int fl_pid;
@@ -2122,7 +2122,7 @@ static void lock_get_status(struct seq_file *f, struct file_lock *fl,
2122 if (fl->fl_file != NULL) 2122 if (fl->fl_file != NULL)
2123 inode = fl->fl_file->f_path.dentry->d_inode; 2123 inode = fl->fl_file->f_path.dentry->d_inode;
2124 2124
2125 seq_printf(f, "%d:%s ", id, pfx); 2125 seq_printf(f, "%lld:%s ", id, pfx);
2126 if (IS_POSIX(fl)) { 2126 if (IS_POSIX(fl)) {
2127 seq_printf(f, "%6s %s ", 2127 seq_printf(f, "%6s %s ",
2128 (fl->fl_flags & FL_ACCESS) ? "ACCESS" : "POSIX ", 2128 (fl->fl_flags & FL_ACCESS) ? "ACCESS" : "POSIX ",
@@ -2185,24 +2185,27 @@ static int locks_show(struct seq_file *f, void *v)
2185 2185
2186 fl = list_entry(v, struct file_lock, fl_link); 2186 fl = list_entry(v, struct file_lock, fl_link);
2187 2187
2188 lock_get_status(f, fl, (long)f->private, ""); 2188 lock_get_status(f, fl, *((loff_t *)f->private), "");
2189 2189
2190 list_for_each_entry(bfl, &fl->fl_block, fl_block) 2190 list_for_each_entry(bfl, &fl->fl_block, fl_block)
2191 lock_get_status(f, bfl, (long)f->private, " ->"); 2191 lock_get_status(f, bfl, *((loff_t *)f->private), " ->");
2192 2192
2193 f->private++;
2194 return 0; 2193 return 0;
2195} 2194}
2196 2195
2197static void *locks_start(struct seq_file *f, loff_t *pos) 2196static void *locks_start(struct seq_file *f, loff_t *pos)
2198{ 2197{
2198 loff_t *p = f->private;
2199
2199 lock_flocks(); 2200 lock_flocks();
2200 f->private = (void *)1; 2201 *p = (*pos + 1);
2201 return seq_list_start(&file_lock_list, *pos); 2202 return seq_list_start(&file_lock_list, *pos);
2202} 2203}
2203 2204
2204static void *locks_next(struct seq_file *f, void *v, loff_t *pos) 2205static void *locks_next(struct seq_file *f, void *v, loff_t *pos)
2205{ 2206{
2207 loff_t *p = f->private;
2208 ++*p;
2206 return seq_list_next(v, &file_lock_list, pos); 2209 return seq_list_next(v, &file_lock_list, pos);
2207} 2210}
2208 2211
@@ -2220,14 +2223,14 @@ static const struct seq_operations locks_seq_operations = {
2220 2223
2221static int locks_open(struct inode *inode, struct file *filp) 2224static int locks_open(struct inode *inode, struct file *filp)
2222{ 2225{
2223 return seq_open(filp, &locks_seq_operations); 2226 return seq_open_private(filp, &locks_seq_operations, sizeof(loff_t));
2224} 2227}
2225 2228
2226static const struct file_operations proc_locks_operations = { 2229static const struct file_operations proc_locks_operations = {
2227 .open = locks_open, 2230 .open = locks_open,
2228 .read = seq_read, 2231 .read = seq_read,
2229 .llseek = seq_lseek, 2232 .llseek = seq_lseek,
2230 .release = seq_release, 2233 .release = seq_release_private,
2231}; 2234};
2232 2235
2233static int __init proc_locks_init(void) 2236static int __init proc_locks_init(void)