Skip to contentSkip to conversation

fs/libfs: use SEEK_CUR/SET

PATCH New Tomohiro Kusumi 1 participant 3 messages Feb 28, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 fs/libfs: use SEEK_CUR/SET

---
 fs/libfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/libfs.c +2 -2
index 28d6f35..cb03444 100644
@@ -143,9 +143,9 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence)
 {
 	struct dentry *dentry = file->f_path.dentry;
 	switch (whence) {
-		case 1:
+		case SEEK_CUR:
 			offset += file->f_pos;
-		case 0:
+		case SEEK_SET:
 			if (offset >= 0)
 				break;
 		default:
Signature · 1 line
2.9.3
#1 lore raw

PATCH 2/3 nfs: use SEEK_CUR/SET

---
 fs/nfs/dir.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/nfs/dir.c +2 -2
index fad8104..95712e1 100644
@@ -972,9 +972,9 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int whence)
 			filp, offset, whence);
 
 	switch (whence) {
-		case 1:
+		case SEEK_CUR:
 			offset += filp->f_pos;
-		case 0:
+		case SEEK_SET:
 			if (offset >= 0)
 				break;
 		default:
Signature · 1 line
2.9.3
#2 lore raw

PATCH 3/3 fs/mpage: fix a comment "get_blocks" to "get_block"

In reply to Tomohiro Kusumi

It's a get_block_t argument get_block being called here.

---
 fs/mpage.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/mpage.c +2 -2
index 28af984..67e9492 100644
@@ -173,7 +173,7 @@ do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages,
 	page_block = 0;
 
 	/*
-	 * Map blocks using the result from the previous get_blocks call first.
+	 * Map blocks using the result from the previous get_block call first.
 	 */
 	nblocks = map_bh->b_size >> blkbits;
 	if (buffer_mapped(map_bh) && block_in_file > *first_logical_block &&
@@ -197,7 +197,7 @@ do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages,
 	}
 
 	/*
-	 * Then do more get_blocks calls until we are done with this page.
+	 * Then do more get_block calls until we are done with this page.
 	 */
 	map_bh->b_page = page;
 	while (page_block < blocks_per_page) {
Signature · 1 line
2.9.3