本文整理汇总了C++中au_sbi函数的典型用法代码示例。如果您正苦于以下问题:C++ au_sbi函数的具体用法?C++ au_sbi怎么用?C++ au_sbi使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了au_sbi函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: au_wkq_nowait
int au_wkq_nowait(au_wkq_func_t func, void *args, struct super_block *sb)
{
int err;
struct au_wkinfo *wkinfo;
atomic_inc(&au_sbi(sb)->si_nowait.nw_len);
/*
* wkq_func() must free this wkinfo.
* it highly depends upon the implementation of workqueue.
*/
err = 0;
wkinfo = kmalloc(sizeof(*wkinfo), GFP_NOFS);
if (wkinfo) {
wkinfo->sb = sb;
wkinfo->flags = !AuWkq_WAIT;
wkinfo->func = func;
wkinfo->args = args;
wkinfo->comp = NULL;
kobject_get(&au_sbi(sb)->si_kobj);
__module_get(THIS_MODULE);
au_wkq_run(wkinfo);
} else {
err = -ENOMEM;
atomic_dec(&au_sbi(sb)->si_nowait.nw_len);
}
return err;
}
示例2: au_xigen_inc
int au_xigen_inc(struct inode *inode)
{
int err;
loff_t pos;
ssize_t sz;
__u32 igen;
struct super_block *sb;
struct au_sbinfo *sbinfo;
LKTRTrace("i%lu\n", (unsigned long)inode->i_ino);
err = 0;
sb = inode->i_sb;
if (unlikely(!au_opt_test_xino(au_mntflags(sb))))
goto out;
pos = inode->i_ino;
pos *= sizeof(igen);
igen = inode->i_generation + 1;
sbinfo = au_sbi(sb);
sz = xino_fwrite(sbinfo->si_xwrite, sbinfo->si_xigen, &igen,
sizeof(igen), &pos);
if (sz == sizeof(igen))
goto out; /* success */
err = sz;
if (unlikely(sz >= 0)) {
err = -EIO;
AuIOErr("xigen error (%zd)\n", sz);
}
out:
AuTraceErr(err);
return err;
}
示例3: sysrq_sb
static void sysrq_sb(struct super_block *sb)
{
char *plevel;
struct au_sbinfo *sbinfo;
struct file *file;
plevel = au_plevel;
au_plevel = KERN_WARNING;
au_debug(1);
sbinfo = au_sbi(sb);
pr_warning("si=%lx\n", sysaufs_si_id(sbinfo));
pr_warning(AUFS_NAME ": superblock\n");
au_dpri_sb(sb);
pr_warning(AUFS_NAME ": root dentry\n");
au_dpri_dentry(sb->s_root);
pr_warning(AUFS_NAME ": root inode\n");
au_dpri_inode(sb->s_root->d_inode);
#if 0
struct inode *i;
pr_warning(AUFS_NAME ": isolated inode\n");
list_for_each_entry(i, &sb->s_inodes, i_sb_list)
if (list_empty(&i->i_dentry))
au_dpri_inode(i);
#endif
pr_warning(AUFS_NAME ": files\n");
list_for_each_entry(file, &sb->s_files, f_u.fu_list)
if (!special_file(file->f_dentry->d_inode->i_mode))
au_dpri_file(file);
au_plevel = plevel;
au_debug(0);
}
示例4: au_do_open_nondir
int au_do_open_nondir(struct file *file, int flags)
{
int err;
aufs_bindex_t bindex;
struct file *h_file;
struct dentry *dentry;
struct au_finfo *finfo;
FiMustWriteLock(file);
err = 0;
dentry = file->f_dentry;
finfo = au_fi(file);
memset(&finfo->fi_htop, 0, sizeof(finfo->fi_htop));
atomic_set(&finfo->fi_mmapped, 0);
bindex = au_dbstart(dentry);
h_file = au_h_open(dentry, bindex, flags, file, /*force_wr*/0);
if (IS_ERR(h_file))
err = PTR_ERR(h_file);
else {
au_set_fbstart(file, bindex);
au_set_h_fptr(file, bindex, h_file);
au_update_figen(file);
finfo->fi_file = file;
au_sphl_add(&finfo->fi_hlist, &au_sbi(dentry->d_sb)->si_files);
/* todo: necessary? */
/* file->f_ra = h_file->f_ra; */
}
return err;
}
示例5: au_wbr_create_mfs
static int au_wbr_create_mfs(struct dentry *dentry, int isdir __maybe_unused)
{
int err;
struct super_block *sb;
struct au_wbr_mfs *mfs;
err = au_wbr_create_exp(dentry);
if (err >= 0)
goto out;
sb = dentry->d_sb;
mfs = &au_sbi(sb)->si_wbr_mfs;
mutex_lock(&mfs->mfs_lock);
if (time_after(jiffies, mfs->mfs_jiffy + mfs->mfs_expire)
|| mfs->mfs_bindex < 0
|| au_br_rdonly(au_sbr(sb, mfs->mfs_bindex)))
au_mfs(dentry);
mutex_unlock(&mfs->mfs_lock);
err = mfs->mfs_bindex;
if (err >= 0)
err = au_wbr_nonopq(dentry, err);
out:
AuDbg("b%d\n", err);
return err;
}
示例6: au_fhsm_wrote
void au_fhsm_wrote(struct super_block *sb, aufs_bindex_t bindex, int force)
{
int err;
struct au_sbinfo *sbinfo;
struct au_fhsm *fhsm;
struct au_branch *br;
struct au_br_fhsm *bf;
AuDbg("b%d, force %d\n", bindex, force);
SiMustAnyLock(sb);
sbinfo = au_sbi(sb);
fhsm = &sbinfo->si_fhsm;
if (!au_ftest_si(sbinfo, FHSM)
|| fhsm->fhsm_bottom == bindex)
return;
br = au_sbr(sb, bindex);
bf = br->br_fhsm;
AuDebugOn(!bf);
mutex_lock(&bf->bf_lock);
if (force
|| au_fhsm_pid(fhsm)
|| au_fhsm_test_jiffy(sbinfo, br))
err = au_fhsm_stfs(sb, bindex, /*rstfs*/NULL, /*do_lock*/0,
/*do_notify*/1);
mutex_unlock(&bf->bf_lock);
}
示例7: au_wr_dir
/*
* decide the branch and the parent dir where we will create a new entry.
* returns new bindex or an error.
* copyup the parent dir if needed.
*/
int au_wr_dir(struct dentry *dentry, struct dentry *src_dentry,
struct au_wr_dir_args *args)
{
int err;
aufs_bindex_t bcpup, bstart, src_bstart;
const unsigned char add_entry = !!au_ftest_wrdir(args->flags,
ADD_ENTRY);
struct super_block *sb;
struct dentry *parent;
struct au_sbinfo *sbinfo;
sb = dentry->d_sb;
sbinfo = au_sbi(sb);
parent = dget_parent(dentry);
bstart = au_dbstart(dentry);
bcpup = bstart;
if (args->force_btgt < 0) {
if (src_dentry) {
src_bstart = au_dbstart(src_dentry);
if (src_bstart < bstart)
bcpup = src_bstart;
} else if (add_entry) {
err = AuWbrCreate(sbinfo, dentry,
au_ftest_wrdir(args->flags, ISDIR));
bcpup = err;
}
if (bcpup < 0 || au_test_ro(sb, bcpup, dentry->d_inode)) {
if (add_entry)
err = AuWbrCopyup(sbinfo, dentry);
else {
if (!IS_ROOT(dentry)) {
di_read_lock_parent(parent, !AuLock_IR);
err = AuWbrCopyup(sbinfo, dentry);
di_read_unlock(parent, !AuLock_IR);
} else
err = AuWbrCopyup(sbinfo, dentry);
}
bcpup = err;
if (unlikely(err < 0))
goto out;
}
} else {
bcpup = args->force_btgt;
AuDebugOn(au_test_ro(sb, bcpup, dentry->d_inode));
}
AuDbg("bstart %d, bcpup %d\n", bstart, bcpup);
err = bcpup;
if (bcpup == bstart)
goto out; /* success */
else if (bstart < bcpup)
au_update_dbrange(dentry, /*do_put_zero*/1);
/* copyup the new parent into the branch we process */
err = au_wr_dir_cpup(dentry, parent, add_entry, bcpup, bstart);
out:
dput(parent);
return err;
}
示例8: au_br_do_del
static void au_br_do_del(struct super_block *sb, aufs_bindex_t bindex,
struct au_branch *br)
{
aufs_bindex_t bend;
struct au_sbinfo *sbinfo;
struct dentry *root, *h_root;
struct inode *inode, *h_inode;
struct au_hinode *hinode;
SiMustWriteLock(sb);
root = sb->s_root;
inode = root->d_inode;
sbinfo = au_sbi(sb);
bend = sbinfo->si_bend;
h_root = au_h_dptr(root, bindex);
hinode = au_hi(inode, bindex);
h_inode = au_igrab(hinode->hi_inode);
au_hiput(hinode);
au_sbilist_lock();
au_br_do_del_brp(sbinfo, bindex, bend);
au_br_do_del_hdp(au_di(root), bindex, bend);
au_br_do_del_hip(au_ii(inode), bindex, bend);
au_sbilist_unlock();
dput(h_root);
iput(h_inode);
au_br_do_free(br);
}
示例9: AuTraceEnter
static char *au_build_path(struct dentry *h_parent, struct path *h_rootpath,
char *buf, int len, struct super_block *sb)
{
char *p;
int n;
AuTraceEnter();
p = d_path(h_rootpath->dentry, h_rootpath->mnt, buf, len);
if (IS_ERR(p))
goto out;
n = strlen(p);
p = d_path(h_parent, h_rootpath->mnt, buf, len);
if (IS_ERR(p))
goto out;
LKTRTrace("%s\n", p);
if (n != 1)
p += n;
LKTRTrace("%p, %s, %ld\n",
p, p, (long)(p - buf));
p = d_path(sb->s_root, au_sbi(sb)->si_mnt, buf, len - strlen(p));
if (IS_ERR(p))
goto out;
if (n != 1)
p[strlen(p)] = '/';
LKTRTrace("%s\n", p);
out:
AuTraceErrPtr(p);
return p;
}
示例10: au_ren_del_whtmp
/* cf. aufs_rmdir() */
static int au_ren_del_whtmp(struct au_ren_args *a)
{
int err;
struct inode *dir;
dir = a->dst_dir;
SiMustAnyLock(dir->i_sb);
if (!au_nhash_test_longer_wh(&a->whlist, a->btgt,
au_sbi(dir->i_sb)->si_dirwh)
|| au_test_fs_remote(a->h_dst->d_sb)) {
err = au_whtmp_rmdir(dir, a->btgt, a->h_dst, &a->whlist);
if (unlikely(err))
pr_warning("failed removing whtmp dir %.*s (%d), "
"ignored.\n", AuDLNPair(a->h_dst), err);
} else {
au_nhash_wh_free(&a->thargs->whlist);
a->thargs->whlist = a->whlist;
a->whlist.nh_num = 0;
au_whtmp_kick_rmdir(dir, a->btgt, a->h_dst, a->thargs);
dput(a->h_dst);
a->thargs = NULL;
}
return 0;
}
示例11: LKTRTrace
static /* noinline_for_stack */
struct dentry *decode_by_dir_ino(struct super_block *sb, ino_t ino,
ino_t dir_ino, struct au_nfsd_si_lock *nsi_lock)
{
struct dentry *dentry, *parent;
struct path path;
LKTRTrace("i%lu, diri%lu\n",
(unsigned long)ino, (unsigned long)dir_ino);
parent = sb->s_root;
if (dir_ino != AUFS_ROOT_INO) {
parent = decode_by_ino(sb, dir_ino, 0);
dentry = parent;
if (!parent)
goto out;
if (IS_ERR(parent))
goto out;
AuDebugOn(au_test_anon(parent));
} else
dget(parent);
path.dentry = parent;
path.mnt = au_sbi(sb)->si_mnt;
dentry = au_lkup_by_ino(&path, ino, nsi_lock);
dput(parent);
out:
AuTraceErrPtr(dentry);
return dentry;
}
示例12: au_wbr_create_mfs
static int au_wbr_create_mfs(struct dentry *dentry, unsigned int flags)
{
int err;
struct dentry *parent;
struct super_block *sb;
struct au_wbr_mfs *mfs;
err = au_wbr_create_exp(dentry);
if (err >= 0)
goto out;
sb = dentry->d_sb;
parent = NULL;
if (au_ftest_wbr(flags, PARENT))
parent = dget_parent(dentry);
mfs = &au_sbi(sb)->si_wbr_mfs;
mutex_lock(&mfs->mfs_lock);
if (time_after(jiffies, mfs->mfs_jiffy + mfs->mfs_expire)
|| mfs->mfs_bindex < 0
|| au_br_rdonly(au_sbr(sb, mfs->mfs_bindex)))
au_mfs(dentry, parent);
mutex_unlock(&mfs->mfs_lock);
err = mfs->mfs_bindex;
dput(parent);
if (err >= 0)
err = au_wbr_nonopq(dentry, err);
out:
AuDbg("b%d\n", err);
return err;
}
示例13: au_do_dir_ts
static void au_do_dir_ts(void *arg)
{
struct au_dir_ts_arg *a = arg;
struct au_dtime dt;
struct path h_path;
struct inode *dir, *h_dir;
struct super_block *sb;
struct au_branch *br;
struct au_hinode *hdir;
int err;
aufs_bindex_t btop, bindex;
sb = a->dentry->d_sb;
if (d_really_is_negative(a->dentry))
goto out;
/* no dir->i_mutex lock */
aufs_read_lock(a->dentry, AuLock_DW); /* noflush */
dir = d_inode(a->dentry);
btop = au_ibtop(dir);
bindex = au_br_index(sb, a->brid);
if (bindex < btop)
goto out_unlock;
br = au_sbr(sb, bindex);
h_path.dentry = au_h_dptr(a->dentry, bindex);
if (!h_path.dentry)
goto out_unlock;
h_path.mnt = au_br_mnt(br);
au_dtime_store(&dt, a->dentry, &h_path);
br = au_sbr(sb, btop);
if (!au_br_writable(br->br_perm))
goto out_unlock;
h_path.dentry = au_h_dptr(a->dentry, btop);
h_path.mnt = au_br_mnt(br);
err = vfsub_mnt_want_write(h_path.mnt);
if (err)
goto out_unlock;
hdir = au_hi(dir, btop);
au_hn_inode_lock_nested(hdir, AuLsc_I_PARENT);
h_dir = au_h_iptr(dir, btop);
if (h_dir->i_nlink
&& timespec_compare(&h_dir->i_mtime, &dt.dt_mtime) < 0) {
dt.dt_h_path = h_path;
au_dtime_revert(&dt);
}
au_hn_inode_unlock(hdir);
vfsub_mnt_drop_write(h_path.mnt);
au_cpup_attr_timesizes(dir);
out_unlock:
aufs_read_unlock(a->dentry, AuLock_DW);
out:
dput(a->dentry);
au_nwt_done(&au_sbi(sb)->si_nowait);
kfree(arg);
}
示例14: au_plink_maint_block
/*
* during a user process maintains the pseudo-links,
* prohibit adding a new plink and branch manipulation.
*/
void au_plink_maint_block(struct super_block *sb)
{
struct au_sbinfo *sbi = au_sbi(sb);
SiMustAnyLock(sb);
/* gave up wake_up_bit() */
wait_event(sbi->si_plink_wq, !sbi->si_plink_maint);
}
示例15: au_plink_block_maintain
/*
* during a user process maintains the pseudo-links,
* prohibit adding a new plink and branch manipulation.
*/
void au_plink_block_maintain(struct super_block *sb)
{
struct au_sbinfo *sbi = au_sbi(sb);
SiMustAnyLock(sb);
/* gave up wake_up_bit() */
wait_event(sbi->si_plink_wq, !au_ftest_si(sbi, MAINTAIN_PLINK));
}