diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-07-16 10:28:01 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-08-28 23:20:25 +0200 |
commit | 82843893f464f258d31ea3a70977e8b82a72bbb5 (patch) | |
tree | 2f9302ca387e467d9cf6196d0dbf11c0987faab3 /libnetfs | |
parent | a2e7bbe6a98806d7749f6799abf42758c38c3f6b (diff) |
libnetfs: properly respond to file_get_translator requests
Properly respond to file_get_translator requests for nodes with a
passive translator record.
* libnetfs/file-get-translator.c (netfs_S_file_get_translator): Handle
passive translator records.
Diffstat (limited to 'libnetfs')
-rw-r--r-- | libnetfs/file-get-translator.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libnetfs/file-get-translator.c b/libnetfs/file-get-translator.c index 59e61020..3e183c14 100644 --- a/libnetfs/file-get-translator.c +++ b/libnetfs/file-get-translator.c @@ -109,6 +109,20 @@ netfs_S_file_get_translator (struct protid *user, *translen = len; err = 0; } + else if (np->nn_translated & S_IPTRANS) + { + char *string = NULL; + size_t len = 0; + err = netfs_get_translator (np, &string, &len); + if (!err) + { + if (len > *translen) + *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + memmove (*trans, string, len); + *translen = len; + free (string); + } + } else err = EINVAL; |