aboutsummaryrefslogtreecommitdiffstats
path: root/fs/libfs.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2008-07-03 16:24:06 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-07-03 16:24:06 -0400
commite86322f611eef95aafaf726fd3965e5b211f1985 (patch)
tree28547e26df4fc6ae671dc8cc6912a53717e4db08 /fs/libfs.c
parentb001a1b6aa960949a24c2cdc28257dfcc9428d74 (diff)
parent8948896c9e098c6fd31a6a698a598a7cbd7fa40e (diff)
Merge branch 'for-bfields' of git://linux-nfs.org/~tomtucker/xprt-switch-2.6 into for-2.6.27
Diffstat (limited to 'fs/libfs.c')
-rw-r--r--fs/libfs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/libfs.c b/fs/libfs.c
index b004dfadd891..892d41cb3382 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -528,6 +528,23 @@ ssize_t simple_read_from_buffer(void __user *to, size_t count, loff_t *ppos,
528 return count; 528 return count;
529} 529}
530 530
531ssize_t memory_read_from_buffer(void *to, size_t count, loff_t *ppos,
532 const void *from, size_t available)
533{
534 loff_t pos = *ppos;
535
536 if (pos < 0)
537 return -EINVAL;
538 if (pos >= available)
539 return 0;
540 if (count > available - pos)
541 count = available - pos;
542 memcpy(to, from + pos, count);
543 *ppos = pos + count;
544
545 return count;
546}
547
531/* 548/*
532 * Transaction based IO. 549 * Transaction based IO.
533 * The file expects a single write which triggers the transaction, and then 550 * The file expects a single write which triggers the transaction, and then
@@ -800,6 +817,7 @@ EXPORT_SYMBOL(simple_statfs);
800EXPORT_SYMBOL(simple_sync_file); 817EXPORT_SYMBOL(simple_sync_file);
801EXPORT_SYMBOL(simple_unlink); 818EXPORT_SYMBOL(simple_unlink);
802EXPORT_SYMBOL(simple_read_from_buffer); 819EXPORT_SYMBOL(simple_read_from_buffer);
820EXPORT_SYMBOL(memory_read_from_buffer);
803EXPORT_SYMBOL(simple_transaction_get); 821EXPORT_SYMBOL(simple_transaction_get);
804EXPORT_SYMBOL(simple_transaction_read); 822EXPORT_SYMBOL(simple_transaction_read);
805EXPORT_SYMBOL(simple_transaction_release); 823EXPORT_SYMBOL(simple_transaction_release);