Skip to content

Commit 4d47dfe

Browse files
committed
Merge branch 'dev' of github.com:fwsGonzo/IncludeOS into dev
2 parents ae4e7bd + 7669bb6 commit 4d47dfe

44 files changed

Lines changed: 191 additions & 145 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/fs/common.hpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@
2828

2929
namespace fs {
3030

31-
// Generic structure for directory entries
3231
struct Dirent;
33-
32+
struct File_system;
3433

3534
/**
3635
* @brief Type used as a building block to represent buffers
@@ -185,24 +184,23 @@ namespace fs {
185184
/** @var no_error: Always returns boolean false when used in expressions */
186185
extern error_t no_error;
187186

188-
/** Async function types **/
189-
using on_init_func = delegate<void(error_t)>;
187+
/** Async function types **/
188+
using on_init_func = delegate<void(error_t, File_system&)>;
190189
using on_ls_func = delegate<void(error_t, dirvec_t)>;
191190
using on_read_func = delegate<void(error_t, buffer_t, uint64_t)>;
192191
using on_stat_func = delegate<void(error_t, const Dirent&)>;
193192

194193

195-
struct List {
194+
struct List
195+
{
196196
error_t error;
197197
dirvec_t entries;
198198
auto begin() { return entries->begin(); }
199199
auto end() { return entries->end(); }
200200
auto cbegin() { return entries->cbegin(); }
201201
auto cend() { return entries->cend(); }
202-
203202
};
204203

204+
} //< fs
205205

206-
} //< namespace fs
207-
208-
#endif //< FS_ERROR_HPP
206+
#endif //< FS_COMMON_HPP

api/fs/disk.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace fs {
4242

4343
struct Partition;
4444
using on_parts_func = delegate<void(fs::error_t, std::vector<Partition>&)>;
45-
using on_init_func = delegate<void(fs::error_t)>;
45+
using on_init_func = delegate<void(fs::error_t, File_system&)>;
4646
using lba_t = uint32_t;
4747

4848
enum partition_t {

api/fs/filesystem.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ namespace fs {
2727
struct Dirent;
2828

2929
struct File_system {
30-
31-
/** Initialize this filesystem with LBA at @base_sector */
32-
virtual void init(uint64_t lba, uint64_t size, on_init_func on_init) = 0;
33-
3430
/** Get unique (per device type) device id for underlying device.*/
3531
virtual Device_id device_id() = 0;
3632

@@ -76,6 +72,9 @@ namespace fs {
7672
/** Returns the name of this filesystem */
7773
virtual std::string name() const = 0;
7874

75+
/** Initialize this filesystem with LBA at @base_sector */
76+
virtual void init(uint64_t lba, uint64_t size, on_init_func on_init) = 0;
77+
7978
/** Default destructor */
8079
virtual ~File_system() noexcept = default;
8180
}; //< class File_system

api/net/buffer_store.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,10 @@ namespace net
8282
std::vector<buffer_t> available_;
8383
int cpu;
8484
static bool smp_enabled_;
85+
#ifndef INCLUDEOS_SINGLE_THREADED
8586
// has strict alignment reqs, so put at end
8687
spinlock_t plock;
87-
88+
#endif
8889
BufferStore(BufferStore&) = delete;
8990
BufferStore(BufferStore&&) = delete;
9091
BufferStore& operator=(BufferStore&) = delete;

api/net/http/connection.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace http {
6767
inline TCP_conn release();
6868

6969
/**
70-
* @brief Wether the underlying TCP connection has been released or not
70+
* @brief Whether the underlying TCP connection has been released or not
7171
*
7272
* @return true if the underlying TCP connection is released
7373
*/

api/net/http/message.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class Message {
9999
*
100100
* @param[in] len The length of the content
101101
*
102-
* @return Outcome of wether the field got updated or not
102+
* @return Outcome of whether the field got updated or not
103103
*/
104104
inline bool set_content_length(size_t len);
105105

api/net/inet.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ namespace net {
100100
virtual void force_start_send_queues() = 0;
101101

102102
virtual void move_to_this_cpu() = 0;
103+
virtual int get_cpu_id() const noexcept = 0;
103104

104105
}; //< class Inet<LINKLAYER, IPV>
105106
} //< namespace net

api/net/inet4.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ namespace net {
194194

195195
void move_to_this_cpu() override;
196196

197+
int get_cpu_id() const noexcept override {
198+
return this->cpu_id;
199+
}
200+
197201
/** Return the stack on the given Nic */
198202
template <int N = 0>
199203
static auto&& stack()
@@ -248,6 +252,7 @@ namespace net {
248252

249253
std::shared_ptr<net::DHClient> dhcp_{};
250254

255+
int cpu_id;
251256
const uint16_t MTU_;
252257

253258
friend class Super_stack;

api/net/tcp/connection.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ class Connection : public std::enable_shared_from_this<Connection> {
642642
void writeq_reset();
643643

644644
/*
645-
Mark wether the Connection is in TCP write queue or not.
645+
Mark whether the Connection is in TCP write queue or not.
646646
*/
647647
void set_queued(bool queued)
648648
{ queued_ = queued; }
@@ -888,7 +888,7 @@ class Connection : public std::enable_shared_from_this<Connection> {
888888
void timewait_timeout()
889889
{ signal_close(); }
890890

891-
/** Wether to use Delayed ACK or not */
891+
/** Whether to use Delayed ACK or not */
892892
bool use_dack() const;
893893

894894
/**

api/net/tcp/rttm.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ struct RTTM {
6060
{}
6161

6262
/**
63-
* @brief Returns wether the RTTM is currently "measuring" (time is set)
63+
* @brief Returns whether the RTTM is currently "measuring" (time is set)
6464
*
6565
* @return True if the RTTM is active (measuring)
6666
*/

0 commit comments

Comments
 (0)