diff options
-rw-r--r-- | fs/f2fs/data.c | 14 | ||||
-rw-r--r-- | fs/f2fs/dir.c | 4 | ||||
-rw-r--r-- | fs/f2fs/f2fs.h | 2 | ||||
-rw-r--r-- | fs/f2fs/node.c | 8 | ||||
-rw-r--r-- | fs/f2fs/node.h | 8 |
5 files changed, 22 insertions, 14 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index e46b5c52d2ed..0879d2aa97e6 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c | |||
@@ -508,8 +508,8 @@ repeat: | |||
508 | * Caller ensures that this data page is never allocated. | 508 | * Caller ensures that this data page is never allocated. |
509 | * A new zero-filled data page is allocated in the page cache. | 509 | * A new zero-filled data page is allocated in the page cache. |
510 | * | 510 | * |
511 | * Also, caller should grab and release a mutex by calling mutex_lock_op() and | 511 | * Also, caller should grab and release a rwsem by calling f2fs_lock_op() and |
512 | * mutex_unlock_op(). | 512 | * f2fs_unlock_op(). |
513 | * Note that, npage is set only by make_empty_dir. | 513 | * Note that, npage is set only by make_empty_dir. |
514 | */ | 514 | */ |
515 | struct page *get_new_data_page(struct inode *inode, | 515 | struct page *get_new_data_page(struct inode *inode, |
@@ -595,10 +595,12 @@ static int __allocate_data_block(struct dnode_of_data *dn) | |||
595 | } | 595 | } |
596 | 596 | ||
597 | /* | 597 | /* |
598 | * This function should be used by the data read flow only where it | 598 | * get_data_block() now supported readahead/bmap/rw direct_IO with mapped bh. |
599 | * does not check the "create" flag that indicates block allocation. | 599 | * If original data blocks are allocated, then give them to blockdev. |
600 | * The reason for this special functionality is to exploit VFS readahead | 600 | * Otherwise, |
601 | * mechanism. | 601 | * a. preallocate requested block addresses |
602 | * b. do not use extent cache for better performance | ||
603 | * c. give the block addresses to blockdev | ||
602 | */ | 604 | */ |
603 | static int get_data_block(struct inode *inode, sector_t iblock, | 605 | static int get_data_block(struct inode *inode, sector_t iblock, |
604 | struct buffer_head *bh_result, int create) | 606 | struct buffer_head *bh_result, int create) |
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 0cc26ba07c3b..28206109a293 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c | |||
@@ -432,8 +432,8 @@ next: | |||
432 | } | 432 | } |
433 | 433 | ||
434 | /* | 434 | /* |
435 | * Caller should grab and release a mutex by calling mutex_lock_op() and | 435 | * Caller should grab and release a rwsem by calling f2fs_lock_op() and |
436 | * mutex_unlock_op(). | 436 | * f2fs_unlock_op(). |
437 | */ | 437 | */ |
438 | int __f2fs_add_link(struct inode *dir, const struct qstr *name, struct inode *inode) | 438 | int __f2fs_add_link(struct inode *dir, const struct qstr *name, struct inode *inode) |
439 | { | 439 | { |
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 42f28d4134c9..ba91186823dd 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h | |||
@@ -165,7 +165,7 @@ enum { | |||
165 | LOOKUP_NODE, /* look up a node without readahead */ | 165 | LOOKUP_NODE, /* look up a node without readahead */ |
166 | LOOKUP_NODE_RA, /* | 166 | LOOKUP_NODE_RA, /* |
167 | * look up a node with readahead called | 167 | * look up a node with readahead called |
168 | * by get_datablock_ro. | 168 | * by get_data_block. |
169 | */ | 169 | */ |
170 | }; | 170 | }; |
171 | 171 | ||
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 0af0a715e367..e8fe52d6073c 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c | |||
@@ -393,8 +393,8 @@ got: | |||
393 | 393 | ||
394 | /* | 394 | /* |
395 | * Caller should call f2fs_put_dnode(dn). | 395 | * Caller should call f2fs_put_dnode(dn). |
396 | * Also, it should grab and release a mutex by calling mutex_lock_op() and | 396 | * Also, it should grab and release a rwsem by calling f2fs_lock_op() and |
397 | * mutex_unlock_op() only if ro is not set RDONLY_NODE. | 397 | * f2fs_unlock_op() only if ro is not set RDONLY_NODE. |
398 | * In the case of RDONLY_NODE, we don't need to care about mutex. | 398 | * In the case of RDONLY_NODE, we don't need to care about mutex. |
399 | */ | 399 | */ |
400 | int get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode) | 400 | int get_dnode_of_data(struct dnode_of_data *dn, pgoff_t index, int mode) |
@@ -802,8 +802,8 @@ int truncate_xattr_node(struct inode *inode, struct page *page) | |||
802 | } | 802 | } |
803 | 803 | ||
804 | /* | 804 | /* |
805 | * Caller should grab and release a mutex by calling mutex_lock_op() and | 805 | * Caller should grab and release a rwsem by calling f2fs_lock_op() and |
806 | * mutex_unlock_op(). | 806 | * f2fs_unlock_op(). |
807 | */ | 807 | */ |
808 | void remove_inode_page(struct inode *inode) | 808 | void remove_inode_page(struct inode *inode) |
809 | { | 809 | { |
diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h index 3496bb3e15dc..c4c79885c993 100644 --- a/fs/f2fs/node.h +++ b/fs/f2fs/node.h | |||
@@ -224,7 +224,13 @@ static inline block_t next_blkaddr_of_node(struct page *node_page) | |||
224 | * | `- direct node (5 + N => 5 + 2N - 1) | 224 | * | `- direct node (5 + N => 5 + 2N - 1) |
225 | * `- double indirect node (5 + 2N) | 225 | * `- double indirect node (5 + 2N) |
226 | * `- indirect node (6 + 2N) | 226 | * `- indirect node (6 + 2N) |
227 | * `- direct node (x(N + 1)) | 227 | * `- direct node |
228 | * ...... | ||
229 | * `- indirect node ((6 + 2N) + x(N + 1)) | ||
230 | * `- direct node | ||
231 | * ...... | ||
232 | * `- indirect node ((6 + 2N) + (N - 1)(N + 1)) | ||
233 | * `- direct node | ||
228 | */ | 234 | */ |
229 | static inline bool IS_DNODE(struct page *node_page) | 235 | static inline bool IS_DNODE(struct page *node_page) |
230 | { | 236 | { |