reiser4: rename psched to dispatch
PATCH 1/4 reiser4: rename psched to dispatch
. Rename confusing "psched" to "dispatch";
. Cleanups.
Signed-off-by Edward Shishkin <[email protected]>
--- fs/reiser4/plugin/file/cryptcompress.c | 27 ++---- fs/reiser4/plugin/file/cryptcompress.h | 8 - fs/reiser4/plugin/file/file.c | 6 - fs/reiser4/plugin/file/file.h | 20 ++-- fs/reiser4/plugin/file/file_conversion.c | 136 +++++++++++-------------------- fs/reiser4/plugin/plugin.h | 2 6 files changed, 83 insertions(+), 116 deletions(-)
fs/reiser4/plugin/file/cryptcompress.c +12 -15
@@ -2642,7 +2642,7 @@ void reset_cluster_params(struct cluster/* the heart of write_cryptcompress */ static loff_t do_write_cryptcompress (struct file *file,struct inode *inode,const char __user *buf,size_t to_write, -loff_t pos,struct psched_context *cont) +loff_t pos,struct dispatch_context *cont) {int i;hint_t *hint;
@@ -2683,10 +2683,8 @@ static loff_t do_write_cryptcompress(strif (next_window_stat (&win) ==HOLE_WINDOW ) {/* write hole in this iteration separated from the loop below */ - result =write_pschedule_hook (file, inode, - pos, - &clust, - cont); + result =write_dispatch_hook (file, inode, + pos, &clust, cont);if (result) goto out; result = prepare_logical_cluster(inode, pos, count, &clust,
@@ -2700,14 +2698,13 @@ static loff_t do_write_cryptcompress(strassert ("edward-750" ,reiser4_schedulable ()); - result =write_pschedule_hook (file, inode, - pos + to_write - count, - &clust, - cont); + result =write_dispatch_hook (file, inode, + pos + to_write - count, + &clust, cont);if (result) goto out; -if (cont->state ==PSCHED_ASSIGNED_NEW ) -/* done_lh was called in write_pschedule_hook */ +if (cont->state ==DISPATCH_ASSIGNED_NEW ) +/* done_lh was called in write_dispatch_hook */ goto out_no_longterm_lock; result = prepare_logical_cluster(inode, pos, count, &clust,
@@ -2787,7 +2784,7 @@ static loff_t do_write_cryptcompress(strput_cluster_handle (&clust);assert ("edward-195" ,ergo ((to_write == count), - (result <0 || cont->state ==PSCHED_ASSIGNED_NEW ))); + (result <0 || cont->state ==DISPATCH_ASSIGNED_NEW )));return (to_write - count) ? (to_write - count) : result; }
@@ -2800,7 +2797,7 @@ static loff_t do_write_cryptcompress(str*/ ssize_t write_cryptcompress (struct file *file,const char __user *buf,size_t count,loff_t *off, -struct psched_context *cont) +struct dispatch_context *cont) {ssize_t result;struct inode *inode;
@@ -2808,7 +2805,7 @@ ssize_t write_cryptcompress(struct fileloff_t pos = *off;struct cryptcompress_info *info; -assert ("edward-1449" , cont->state ==PSCHED_INVAL_STATE ); +assert ("edward-1449" , cont->state ==DISPATCH_INVAL_STATE ); inode = file->f_dentry->d_inode;assert ("edward-196" ,cryptcompress_inode_ok (inode));
@@ -3701,7 +3698,7 @@ int setattr_cryptcompress(struct dentry ctx =reiser4_init_context (dentry->d_inode->i_sb);if (IS_ERR (ctx))return PTR_ERR (ctx); - result =setattr_pschedule_hook (inode); + result =setattr_dispatch_hook (inode);if (result) {context_set_commit_async (ctx);reiser4_exit_context (ctx);
fs/reiser4/plugin/file/cryptcompress.h +4 -4
@@ -562,10 +562,10 @@ int bind_cryptcompress(struct inode *chivoid destroy_inode_cryptcompress (struct inode * inode);int grab_page_cluster (struct inode *inode,struct cluster_handle * clust,rw_op rw); -int write_pschedule_hook (struct file *file,struct inode * inode, -loff_t pos,struct cluster_handle * clust, -struct psched_context * cont); -int setattr_pschedule_hook (struct inode * inode); +int write_dispatch_hook (struct file *file,struct inode * inode, +loff_t pos,struct cluster_handle * clust, +struct dispatch_context * cont); +int setattr_dispatch_hook (struct inode * inode);struct reiser4_crypto_info *inode_crypto_info (struct inode * inode); void inherit_crypto_info_common(struct inode * parent, struct inode * object, int (*can_inherit)(struct inode * child,
fs/reiser4/plugin/file/file.c +4 -2
@@ -2059,8 +2059,10 @@ static void drop_access(struct unix_file* @cont: unused argument, as we don't perform plugin conversion when being * managed by unix_file plugin. */ -ssize_t write_unix_file (struct file *file,const char __user *buf, -size_t count,loff_t *pos,struct psched_context *cont) +ssize_t write_unix_file (struct file *file, +const char __user *buf, +size_t count,loff_t *pos, +struct dispatch_context *cont) {int result;reiser4_context *ctx;
fs/reiser4/plugin/file/file.h +10 -10
@@ -8,18 +8,18 @@#if !defined( __REISER4_FILE_H__ )#define __REISER4_FILE_H__ -/* possible states when scheduling a new file plugin */ +/* possible states in dispatching process */ typedef enum { -PSCHED_INVAL_STATE ,/* invalid state */ -PSCHED_SCHED_POINT ,/* scheduling point has been achieved */ -PSCHED_REMAINS_OLD ,/* made a decision to be managed by old plugin */ -PSCHED_ASSIGNED_NEW /* new plugin has been scheduled */ -}psched_state ; +DISPATCH_INVAL_STATE ,/* invalid state */ +DISPATCH_POINT ,/* dispatching point has been achieved */ +DISPATCH_REMAINS_OLD ,/* made a decision to manage by old plugin */ +DISPATCH_ASSIGNED_NEW /* a new plugin has been assigned */ +}dispatch_state ; -struct psched_context { +struct dispatch_context {int nr_pages;struct page **pages; -psched_state state; +dispatch_state state; };/**
@@ -82,7 +82,7 @@ int setattr_unix_file(struct dentry *, sssize_t read_unix_file (struct file *,char __user *buf,size_t read_amount,loff_t *off);ssize_t write_unix_file (struct file *,const char __user *buf,size_t write_amount, -loff_t * off,struct psched_context * cont); +loff_t * off,struct dispatch_context * cont);int ioctl_unix_file (struct inode *,struct file *,unsigned int cmd,unsigned long arg);int mmap_unix_file (struct file *,struct vm_area_struct *);
@@ -121,7 +121,7 @@ ssize_t read_cryptcompress(struct file * size_t count, loff_t *off);ssize_t write_cryptcompress (struct file *,const char __user *buf,size_t count,loff_t * off, -struct psched_context *cont); +struct dispatch_context *cont);int ioctl_cryptcompress (struct inode *,struct file *,unsigned int cmd,unsigned long arg);int mmap_cryptcompress (struct file *,struct vm_area_struct *);
fs/reiser4/plugin/file/file_conversion.c +52 -84
239 lines not on this page · raw message
fs/reiser4/plugin/plugin.h +1 -1
@@ -235,7 +235,7 @@ typedef struct file_plugin {* in @cont */ ssize_t (*write) (struct file *,const char __user *buf,size_t write_amount,loff_t * off, -struct psched_context * cont); +struct dispatch_context * cont);int (*ioctl) (struct inode *inode,struct file *filp,unsigned int cmd,unsigned long arg);int (*mmap) (struct file *,struct vm_area_struct *);