}
/* open the highest priority file for a given upper file */
-static int open_highest_file(struct file *file, int willwrite)
+static int open_highest_file(struct file *file, bool willwrite)
{
int bindex, bstart, bend, err = 0;
struct file *lower_file;
/*
* Revalidate the struct file
* @file: file to revalidate
- * @willwrite: 1 if caller may cause changes to the file; 0 otherwise.
+ * @willwrite: true if caller may cause changes to the file; false otherwise.
*/
-int unionfs_file_revalidate(struct file *file, int willwrite)
+int unionfs_file_revalidate(struct file *file, bool willwrite)
{
struct super_block *sb;
struct dentry *dentry;
* This is important for open-but-unlinked files, as well as mmap
* support.
*/
- if ((err = unionfs_file_revalidate(file, 1)))
+ if ((err = unionfs_file_revalidate(file, true)))
goto out;
unionfs_check_file(file);
fileinfo = UNIONFS_F(file);
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, 1)))
+ if ((err = unionfs_file_revalidate(file, true)))
goto out;
/* check if asked for local commands */
unionfs_read_lock(dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, 1)))
+ if ((err = unionfs_file_revalidate(file, true)))
goto out;
unionfs_check_file(file);
* Revalidate a parent chain of dentries, then the actual node.
* Assumes that dentry is locked, but will lock all parents if/when needed.
*
- * If 'willwrite' is 1, and the lower inode times are not in sync, then
+ * If 'willwrite' is true, and the lower inode times are not in sync, then
* *don't* purge_inode_data, as it could deadlock if ->write calls us and we
* try to truncate a locked page. Besides, if unionfs is about to write
* data to a file, then there's the data unionfs is about to write is more
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, 0)))
+ if ((err = unionfs_file_revalidate(file, false)))
goto out;
inode = file->f_path.dentry->d_inode;
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, 0)))
+ if ((err = unionfs_file_revalidate(file, false)))
goto out;
rdstate = UNIONFS_F(file)->rdstate;
int err;
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, 0)))
+ if ((err = unionfs_file_revalidate(file, false)))
goto out;
unionfs_check_file(file);
struct file *file = iocb->ki_filp;
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, 0)))
+ if ((err = unionfs_file_revalidate(file, false)))
goto out;
unionfs_check_file(file);
int err = 0;
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, 1)))
+ if ((err = unionfs_file_revalidate(file, true)))
goto out;
unionfs_check_file(file);
static int unionfs_mmap(struct file *file, struct vm_area_struct *vma)
{
int err = 0;
- int willwrite;
+ bool willwrite;
struct file *lower_file;
unionfs_read_lock(file->f_path.dentry->d_sb);
int err = -EINVAL;
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, 1)))
+ if ((err = unionfs_file_revalidate(file, true)))
goto out;
unionfs_check_file(file);
int err = 0;
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, 1)))
+ if ((err = unionfs_file_revalidate(file, true)))
goto out;
unionfs_check_file(file);
int err;
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, 0)))
+ if ((err = unionfs_file_revalidate(file, false)))
goto out;
unionfs_check_file(file);
* is here, in ->prepare_write.
*/
unionfs_copy_attr_times(file->f_path.dentry->d_inode);
- err = unionfs_file_revalidate(file, 1);
+ err = unionfs_file_revalidate(file, true);
unionfs_check_file(file);
unionfs_read_unlock(file->f_path.dentry->d_sb);
BUG_ON(file == NULL);
unionfs_read_lock(file->f_path.dentry->d_sb);
- if ((err = unionfs_file_revalidate(file, 1)))
+ if ((err = unionfs_file_revalidate(file, true)))
goto out;
unionfs_check_file(file);
extern int unionfs_getlk(struct file *file, struct file_lock *fl);
/* Common file operations. */
-extern int unionfs_file_revalidate(struct file *file, int willwrite);
+extern int unionfs_file_revalidate(struct file *file, bool willwrite);
extern int unionfs_open(struct inode *inode, struct file *file);
extern int unionfs_file_release(struct inode *inode, struct file *file);
extern int unionfs_flush(struct file *file, fl_owner_t id);