1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "nacl_io/fusefs/fuse_fs_factory.h" 6 7 #include "nacl_io/fusefs/fuse_fs.h" 8 9 namespace nacl_io { 10 FuseFsFactory(fuse_operations * fuse_ops)11FuseFsFactory::FuseFsFactory(fuse_operations* fuse_ops) : fuse_ops_(fuse_ops) { 12 } 13 CreateFilesystem(const FsInitArgs & args,ScopedFilesystem * out_fs)14Error FuseFsFactory::CreateFilesystem(const FsInitArgs& args, 15 ScopedFilesystem* out_fs) { 16 FsInitArgs args_copy(args); 17 args_copy.fuse_ops = fuse_ops_; 18 19 sdk_util::ScopedRef<FuseFs> fs(new FuseFs()); 20 Error error = fs->Init(args_copy); 21 if (error) 22 return error; 23 24 *out_fs = fs; 25 return 0; 26 } 27 28 } // namespace nacl_io 29