}
/* unionfs_open helper function: open a directory */
-static inline int __open_dir(struct inode *inode, struct file *file)
+static int __open_dir(struct inode *inode, struct file *file)
{
struct dentry *hidden_dentry;
struct file *hidden_file;
}
/* unionfs_open helper function: open a file */
-static inline int __open_file(struct inode *inode, struct file *file)
+static int __open_file(struct inode *inode, struct file *file)
{
struct dentry *hidden_dentry;
struct file *hidden_file;
}
/* pass the ioctl to the lower fs */
-static inline long do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
+static long do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct file *hidden_file;
int err;
#include "union.h"
+static int copyup_named_dentry(struct inode *dir, struct dentry *dentry,
+ int bstart, int new_bindex, const char *name,
+ int namelen, struct file **copyup_file,
+ loff_t len);
+static struct dentry *create_parents_named(struct inode *dir,
+ struct dentry *dentry,
+ const char *name, int bindex);
+
#ifdef CONFIG_UNION_FS_XATTR
/* copyup all extended attrs for a given dentry */
static int copyup_xattrs(struct dentry *old_hidden_dentry,
* if the object being copied up is a regular file, the file is only created,
* the contents have to be copied up separately
*/
-static inline int __copyup_ndentry(struct dentry *old_hidden_dentry,
- struct dentry *new_hidden_dentry,
- struct dentry *new_hidden_parent_dentry,
- char *symbuf)
+static int __copyup_ndentry(struct dentry *old_hidden_dentry,
+ struct dentry *new_hidden_dentry,
+ struct dentry *new_hidden_parent_dentry,
+ char *symbuf)
{
int err = 0;
umode_t old_mode = old_hidden_dentry->d_inode->i_mode;
return err;
}
-static inline int __copyup_reg_data(struct dentry *dentry,
- struct dentry *new_hidden_dentry,
- int new_bindex,
- struct dentry *old_hidden_dentry,
- int old_bindex,
- struct file **copyup_file,
- loff_t len)
+static int __copyup_reg_data(struct dentry *dentry,
+ struct dentry *new_hidden_dentry, int new_bindex,
+ struct dentry *old_hidden_dentry, int old_bindex,
+ struct file **copyup_file, loff_t len)
{
struct super_block *sb = dentry->d_sb;
struct file *input_file;
/* dput the lower references for old and new dentry & clear a lower dentry
* pointer
*/
-static inline void __clear(struct dentry *dentry,
- struct dentry *old_hidden_dentry,
- int old_bstart, int old_bend,
- struct dentry *new_hidden_dentry,
- int new_bindex)
+static void __clear(struct dentry *dentry, struct dentry *old_hidden_dentry,
+ int old_bstart, int old_bend,
+ struct dentry *new_hidden_dentry, int new_bindex)
{
/* get rid of the hidden dentry and all its traces */
unionfs_set_lower_dentry_idx(dentry, new_bindex, NULL);
}
/* copy up a dentry to a file of specified name */
-int copyup_named_dentry(struct inode *dir, struct dentry *dentry,
- int bstart, int new_bindex, const char *name,
- int namelen, struct file **copyup_file, loff_t len)
+static int copyup_named_dentry(struct inode *dir, struct dentry *dentry,
+ int bstart, int new_bindex, const char *name,
+ int namelen, struct file **copyup_file,
+ loff_t len)
{
struct dentry *new_hidden_dentry;
struct dentry *old_hidden_dentry = NULL;
return create_parents_named(dir, dentry, dentry->d_name.name, bindex);
}
-static inline void __cleanup_dentry(struct dentry * dentry, int bindex,
- int old_bstart, int old_bend)
+static void __cleanup_dentry(struct dentry * dentry, int bindex,
+ int old_bstart, int old_bend)
{
int loop_start;
int loop_end;
}
/* set lower inode ptr and update bstart & bend if necessary */
-static inline void __set_inode(struct dentry * upper, struct dentry * lower,
- int bindex)
+static void __set_inode(struct dentry * upper, struct dentry * lower,
+ int bindex)
{
unionfs_set_lower_inode_idx(upper->d_inode, bindex,
igrab(lower->d_inode));
}
/* set lower dentry ptr and update bstart & bend if necessary */
-static inline void __set_dentry(struct dentry * upper, struct dentry * lower,
- int bindex)
+static void __set_dentry(struct dentry * upper, struct dentry * lower,
+ int bindex)
{
unionfs_set_lower_dentry_idx(upper, bindex, lower);
if (likely(dbstart(upper) > bindex))
/* This function replicates the directory structure upto given dentry
* in the bindex branch.
*/
-struct dentry *create_parents_named(struct inode *dir, struct dentry *dentry,
- const char *name, int bindex)
+static struct dentry *create_parents_named(struct inode *dir,
+ struct dentry *dentry,
+ const char *name, int bindex)
{
int err;
struct dentry *child_dentry;
#include "union.h"
-/* declarations added for "sparse" */
-extern int unionfs_d_revalidate_wrap(struct dentry *dentry,
- struct nameidata *nd);
-extern void unionfs_d_release(struct dentry *dentry);
-extern void unionfs_d_iput(struct dentry *dentry, struct inode *inode);
-
/*
* returns 1 if valid, 0 otherwise.
*/
return valid;
}
-int unionfs_d_revalidate_wrap(struct dentry *dentry, struct nameidata *nd)
+static int unionfs_d_revalidate_wrap(struct dentry *dentry,
+ struct nameidata *nd)
{
int err;
return err;
}
-void unionfs_d_release(struct dentry *dentry)
+static void unionfs_d_release(struct dentry *dentry)
{
int bindex, bstart, bend;
#include "union.h"
-/* declarations for sparse */
-extern ssize_t unionfs_read(struct file *, char __user *, size_t, loff_t *);
-extern ssize_t unionfs_write(struct file *, const char __user *, size_t,
- loff_t *);
-
/*******************
* File Operations *
*******************/
return err;
}
-ssize_t unionfs_read(struct file * file, char __user * buf, size_t count,
- loff_t * ppos)
+static ssize_t unionfs_read(struct file * file, char __user * buf,
+ size_t count, loff_t * ppos)
{
struct file *hidden_file;
loff_t pos = *ppos;
return err;
}
-ssize_t __unionfs_write(struct file * file, const char __user * buf,
- size_t count, loff_t * ppos)
+static ssize_t __unionfs_write(struct file * file, const char __user * buf,
+ size_t count, loff_t * ppos)
{
int err = -EINVAL;
struct file *hidden_file = NULL;
return err;
}
-ssize_t unionfs_write(struct file * file, const char __user * buf, size_t count,
- loff_t * ppos)
+static ssize_t unionfs_write(struct file * file, const char __user * buf,
+ size_t count, loff_t * ppos)
{
int err = 0;
#include "union.h"
-/* declarations added for "sparse" */
-extern struct dentry *unionfs_lookup(struct inode *, struct dentry *,
- struct nameidata *);
-extern int unionfs_readlink(struct dentry *dentry, char __user * buf,
- int bufsiz);
-extern void unionfs_put_link(struct dentry *dentry, struct nameidata *nd,
- void *cookie);
-
static int unionfs_create(struct inode *parent, struct dentry *dentry,
int mode, struct nameidata *nd)
{
return err;
}
-struct dentry *unionfs_lookup(struct inode *parent, struct dentry *dentry,
- struct nameidata *nd)
+static struct dentry *unionfs_lookup(struct inode *parent,
+ struct dentry *dentry,
+ struct nameidata *nd)
{
struct nameidata lowernd; /* TODO: be gentler to the stack */
return err;
}
-int unionfs_readlink(struct dentry *dentry, char __user * buf, int bufsiz)
+static int unionfs_readlink(struct dentry *dentry, char __user * buf,
+ int bufsiz)
{
int err;
struct dentry *hidden_dentry;
return ERR_PTR(err);
}
-void unionfs_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie)
+static void unionfs_put_link(struct dentry *dentry, struct nameidata *nd,
+ void *cookie)
{
kfree(nd_get_link(nd));
}
* 2) it exists
* 3) is a directory
*/
-int check_branch(struct nameidata *nd)
+static int check_branch(struct nameidata *nd)
{
if (!strcmp(nd->dentry->d_sb->s_type->name, "unionfs"))
return -EINVAL;
}
/* checks if two hidden_dentries have overlapping branches */
-int is_branch_overlap(struct dentry *dent1, struct dentry *dent2)
+static int is_branch_overlap(struct dentry *dent1, struct dentry *dent2)
{
struct dentry *dent = NULL;
return cursor;
}
-inline struct filldir_node *alloc_filldir_node(const char *name, int namelen,
+static struct filldir_node *alloc_filldir_node(const char *name, int namelen,
unsigned int hash, int bindex)
{
return kmem_cache_alloc(unionfs_filldir_cachep, GFP_KERNEL);
* whiteouts).
*/
-struct workqueue_struct *sioq;
+static struct workqueue_struct *sioq;
int __init init_sioq(void)
{
};
};
-extern struct workqueue_struct *sioq;
extern int __init init_sioq(void);
extern __exit void stop_sioq(void);
extern void run_sioq(work_func_t func, struct sioq_args *args);
/* replicates the directory structure upto given dentry in given branch */
extern struct dentry *create_parents(struct inode *dir, struct dentry *dentry,
int bindex);
-struct dentry *create_parents_named(struct inode *dir, struct dentry *dentry,
- const char *name, int bindex);
-
-/* check if two branches overlap */
-extern int is_branch_overlap(struct dentry *dent1, struct dentry *dent2);
/* partial lookup */
extern int unionfs_partial_lookup(struct dentry *dentry);
/* copies a dentry from dbstart to newbindex branch */
extern int copyup_dentry(struct inode *dir, struct dentry *dentry, int bstart,
int new_bindex, struct file **copyup_file, loff_t len);
-extern int copyup_named_dentry(struct inode *dir, struct dentry *dentry,
- int bstart, int new_bindex, const char *name,
- int namelen, struct file **copyup_file,
- loff_t len);
extern int remove_whiteouts(struct dentry *dentry, struct dentry *hidden_dentry,
int bindex);
int unionfs_ioctl_queryfile(struct file *file, unsigned int cmd,
unsigned long arg);
-/* Verify that a branch is valid. */
-int check_branch(struct nameidata *nd);
-
#ifdef CONFIG_UNION_FS_XATTR
/* Extended attribute functions. */
extern void *unionfs_xattr_alloc(size_t size, size_t limit);
}
struct dentry *unionfs_lookup_backend(struct dentry *dentry, struct nameidata *nd, int lookupmode);
-int is_stale_inode(struct inode *inode);
#define IS_SET(sb, check_flag) ((check_flag) & MOUNT_FLAG(sb))