Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 343328
b: refs/heads/master
c: 44e33e8
h: refs/heads/master
v: v3
  • Loading branch information
Greg Thelen authored and Linus Torvalds committed Dec 13, 2012
1 parent a0149e8 commit 8453743
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 28 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: 6715ddf94576ff39f5d1cda8d4c568d3b79e82ec
refs/heads/master: 44e33e8f95171b93968c3ac3cf8516998b1db65d
5 changes: 0 additions & 5 deletions trunk/include/linux/res_counter.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,9 @@ ssize_t res_counter_read(struct res_counter *counter, int member,
const char __user *buf, size_t nbytes, loff_t *pos,
int (*read_strategy)(unsigned long long val, char *s));

typedef int (*write_strategy_fn)(const char *buf, unsigned long long *val);

int res_counter_memparse_write_strategy(const char *buf,
unsigned long long *res);

int res_counter_write(struct res_counter *counter, int member,
const char *buffer, write_strategy_fn write_strategy);

/*
* the field descriptors. one for each member of res_counter
*/
Expand Down
22 changes: 0 additions & 22 deletions trunk/kernel/res_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,25 +192,3 @@ int res_counter_memparse_write_strategy(const char *buf,
*res = PAGE_ALIGN(*res);
return 0;
}

int res_counter_write(struct res_counter *counter, int member,
const char *buf, write_strategy_fn write_strategy)
{
char *end;
unsigned long flags;
unsigned long long tmp, *val;

if (write_strategy) {
if (write_strategy(buf, &tmp))
return -EINVAL;
} else {
tmp = simple_strtoull(buf, &end, 10);
if (*end != '\0')
return -EINVAL;
}
spin_lock_irqsave(&counter->lock, flags);
val = res_counter_member(counter, member);
*val = tmp;
spin_unlock_irqrestore(&counter->lock, flags);
return 0;
}

0 comments on commit 8453743

Please sign in to comment.