git diff --stat -p 690dd5e9e739cb0c66a792c5d7949f6e97113427..linux-next -- fs/exofs/ fs/exofs/Kbuild | 2 +- fs/exofs/exofs.h | 17 ----------------- fs/exofs/file.c | 4 ++++ fs/exofs/inode.c | 45 ++++++++++++++++++++++----------------------- fs/exofs/super.c | 9 +++++++++ 5 files changed, 36 insertions(+), 41 deletions(-) diff --git a/fs/exofs/Kbuild b/fs/exofs/Kbuild index 592f40d..8c5253e 100644 --- a/fs/exofs/Kbuild +++ b/fs/exofs/Kbuild @@ -22,7 +22,7 @@ ccflags-y += -DCONFIG_EXOFS_FS -DCONFIG_EXOFS_FS_MODULE # if we are built out-of-tree and the hosting kernel has OSD headers # then "ccflags-y +=" will not pick the out-off-tree headers. Only by doing # this it will work. This might break in future kernels -KBUILD_CPPFLAGS := -I$(OSD_INC) $(KBUILD_CPPFLAGS) +LINUXINCLUDE := -I$(OSD_INC) $(LINUXINCLUDE) endif diff --git a/fs/exofs/exofs.h b/fs/exofs/exofs.h index 76155d7..d54753d 100644 --- a/fs/exofs/exofs.h +++ b/fs/exofs/exofs.h @@ -54,15 +54,6 @@ #define _LLU(x) (unsigned long long)(x) /* - * struct to hold what we get from mount options - */ -struct exofs_mountopt { - const char *dev_name; - uint64_t pid; - int timeout; -}; - -/* * our extension to the in-memory superblock */ struct exofs_sb_info { @@ -134,14 +125,6 @@ static inline struct exofs_i_info *exofs_i(struct inode *inode) } /* - * ugly struct so that we can pass two arguments to update_inode's callback - */ -struct updatei_args { - struct exofs_sb_info *sbi; - struct exofs_fcb fcb; -}; - -/* * Maximum count of links to a file */ #define EXOFS_LINK_MAX 32000 diff --git a/fs/exofs/file.c b/fs/exofs/file.c index 4738c3f..2712f68 100644 --- a/fs/exofs/file.c +++ b/fs/exofs/file.c @@ -49,6 +49,10 @@ static int exofs_file_fsync(struct file *filp, struct dentry *dentry, struct address_space *mapping = filp->f_mapping; ret1 = filemap_write_and_wait(mapping); + /*Note: file_fsync below also calles sync_blockdev, which is a no-op + * for exofs, but other then that it does sync_inode and + * sync_superblock which is what we need here. + */ ret2 = file_fsync(filp, dentry, datasync); return ret1 ? ret1 : ret2; diff --git a/fs/exofs/inode.c b/fs/exofs/inode.c index 0f52e76..739629a 100644 --- a/fs/exofs/inode.c +++ b/fs/exofs/inode.c @@ -55,7 +55,7 @@ struct page_collect { long pg_first; }; -void _pcol_init(struct page_collect *pcol, unsigned expected_pages, +static void _pcol_init(struct page_collect *pcol, unsigned expected_pages, struct inode *inode) { struct exofs_sb_info *sbi = inode->i_sb->s_fs_info; @@ -75,7 +75,7 @@ void _pcol_init(struct page_collect *pcol, unsigned expected_pages, expected_pages); } -void _pcol_reset(struct page_collect *pcol) +static void _pcol_reset(struct page_collect *pcol) { pcol->expected_pages -= min(pcol->nr_pages, pcol->expected_pages); @@ -93,7 +93,7 @@ void _pcol_reset(struct page_collect *pcol) pcol->expected_pages = 128; } -int pcol_try_alloc(struct page_collect *pcol) +static int pcol_try_alloc(struct page_collect *pcol) { int pages = min_t(unsigned, pcol->expected_pages, BIO_MAX_PAGES); @@ -103,18 +103,19 @@ int pcol_try_alloc(struct page_collect *pcol) return 0; } - EXOFS_ERR("Failed to kcalloc expected_pages=%d\n", + EXOFS_ERR("Failed to kcalloc expected_pages=%u\n", pcol->expected_pages); return -ENOMEM; } -void pcol_free(struct page_collect *pcol) +static void pcol_free(struct page_collect *pcol) { bio_put(pcol->bio); pcol->bio = NULL; } -int pcol_add_page(struct page_collect *pcol, struct page *page, unsigned len) +static int pcol_add_page(struct page_collect *pcol, struct page *page, + unsigned len) { int added_len = bio_add_pc_page(pcol->req_q, pcol->bio, page, len, 0); if (unlikely(len != added_len)) @@ -173,9 +174,9 @@ static int __readpages_done(struct osd_request *or, struct page_collect *pcol, osd_end_request(or); - if (!ret) + if (likely(!ret)) good_bytes = pcol->length; - else if (ret && !resid) + else if (!resid) good_bytes = 0; else good_bytes = pcol->length - resid; @@ -227,7 +228,7 @@ static void readpages_done(struct osd_request *or, void *p) kfree(p); } -void _unlock_pcol_pages(struct page_collect *pcol, int ret, int rw) +static void _unlock_pcol_pages(struct page_collect *pcol, int ret, int rw) { struct bio_vec *bvec; int i; @@ -245,7 +246,7 @@ void _unlock_pcol_pages(struct page_collect *pcol, int ret, int rw) pcol_free(pcol); } -int read_exec(struct page_collect *pcol, bool is_sync) +static int read_exec(struct page_collect *pcol, bool is_sync) { struct exofs_i_info *oi = exofs_i(pcol->inode); struct osd_obj_id obj = {pcol->sbi->s_pid, @@ -452,7 +453,7 @@ static void writepages_done(struct osd_request *or, void *p) if (likely(!ret)) good_bytes = pcol->length; - else if (ret && !resid) + else if (!resid) good_bytes = 0; else good_bytes = pcol->length - resid; @@ -493,7 +494,7 @@ static void writepages_done(struct osd_request *or, void *p) EXOFS_DBGMSG("writepages_done END\n"); } -int write_exec(struct page_collect *pcol) +static int write_exec(struct page_collect *pcol) { struct exofs_i_info *oi = exofs_i(pcol->inode); struct osd_obj_id obj = {pcol->sbi->s_pid, @@ -631,7 +632,7 @@ fail: return ret; } -int exofs_writepages(struct address_space *mapping, +static int exofs_writepages(struct address_space *mapping, struct writeback_control *wbc) { struct page_collect pcol; @@ -1110,6 +1111,14 @@ struct inode *exofs_new_inode(struct inode *dir, int mode) } /* + * struct to pass two arguments to update_inode's callback + */ +struct updatei_args { + struct exofs_sb_info *sbi; + struct exofs_fcb fcb; +}; + +/* * Callback function from exofs_update_inode(). */ static void updatei_done(struct osd_request *or, void *p) @@ -1218,16 +1227,6 @@ int exofs_write_inode(struct inode *inode, int wait) return exofs_update_inode(inode, wait); } -int exofs_sync_inode(struct inode *inode) -{ - struct writeback_control wbc = { - .sync_mode = WB_SYNC_ALL, - .nr_to_write = 0, /* sys_fsync did this */ - }; - - return sync_inode(inode, &wbc); -} - /* * Callback function from exofs_delete_inode() - don't have much cleaning up to * do. diff --git a/fs/exofs/super.c b/fs/exofs/super.c index 9153db2..989952b 100644 --- a/fs/exofs/super.c +++ b/fs/exofs/super.c @@ -45,6 +45,15 @@ *****************************************************************************/ /* + * struct to hold what we get from mount options + */ +struct exofs_mountopt { + const char *dev_name; + uint64_t pid; + int timeout; +}; + +/* * exofs-specific mount-time options. */ enum { Opt_pid, Opt_to, Opt_mkfs, Opt_format, Opt_err };