Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242837
b: refs/heads/master
c: 3da127f
h: refs/heads/master
i:
  242835: b73a7a0
v: v3
  • Loading branch information
Lars Ellenberg authored and Philipp Reisner committed Mar 10, 2011
1 parent 210c103 commit 42b0bc9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 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: c507f46f26661d4d0dc95a1b1271df5855ab4602
refs/heads/master: 3da127fa887e5187ede702b835770634d705f8b2
13 changes: 11 additions & 2 deletions trunk/drivers/block/drbd/drbd_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "drbd_int.h"

static int drbd_proc_open(struct inode *inode, struct file *file);
static int drbd_proc_release(struct inode *inode, struct file *file);


struct proc_dir_entry *drbd_proc;
Expand All @@ -42,7 +43,7 @@ const struct file_operations drbd_proc_fops = {
.open = drbd_proc_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
.release = drbd_proc_release,
};

void seq_printf_with_thousands_grouping(struct seq_file *seq, long v)
Expand Down Expand Up @@ -304,7 +305,15 @@ static int drbd_seq_show(struct seq_file *seq, void *v)

static int drbd_proc_open(struct inode *inode, struct file *file)
{
return single_open(file, drbd_seq_show, PDE(inode)->data);
if (try_module_get(THIS_MODULE))
return single_open(file, drbd_seq_show, PDE(inode)->data);
return -ENODEV;
}

static int drbd_proc_release(struct inode *inode, struct file *file)
{
module_put(THIS_MODULE);
return single_release(inode, file);
}

/* PROC FS stuff end */

0 comments on commit 42b0bc9

Please sign in to comment.