本文整理匯總了C++中AuDbg函數的典型用法代碼示例。如果您正苦於以下問題:C++ AuDbg函數的具體用法?C++ AuDbg怎麽用?C++ AuDbg使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AuDbg函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: au_wr_dir_need_wh
/*
* decide if a new whiteout for @dentry is necessary or not.
* when it is necessary, prepare the parent dir for the upper branch whose
* branch index is @bcpup for creation. the actual creation of the whiteout will
* be done by caller.
* return value:
* 0: wh is unnecessary
* plus: wh is necessary
* minus: error
*/
int au_wr_dir_need_wh(struct dentry *dentry, int isdir, aufs_bindex_t *bcpup)
{
int need_wh, err;
aufs_bindex_t bstart;
struct super_block *sb;
sb = dentry->d_sb;
bstart = au_dbstart(dentry);
if (*bcpup < 0) {
*bcpup = bstart;
if (au_test_ro(sb, bstart, dentry->d_inode)) {
err = AuWbrCopyup(au_sbi(sb), dentry);
*bcpup = err;
if (unlikely(err < 0))
goto out;
}
} else
AuDebugOn(bstart < *bcpup
|| au_test_ro(sb, *bcpup, dentry->d_inode));
AuDbg("bcpup %d, bstart %d\n", *bcpup, bstart);
if (*bcpup != bstart) {
err = au_cpup_dirs(dentry, *bcpup);
if (unlikely(err))
goto out;
need_wh = 1;
} else {
aufs_bindex_t old_bend, new_bend, bdiropq = -1;
old_bend = au_dbend(dentry);
if (isdir) {
bdiropq = au_dbdiropq(dentry);
au_set_dbdiropq(dentry, -1);
}
need_wh = au_lkup_dentry(dentry, bstart + 1, /*type*/0,
/*nd*/NULL);
err = need_wh;
if (isdir)
au_set_dbdiropq(dentry, bdiropq);
if (unlikely(err < 0))
goto out;
new_bend = au_dbend(dentry);
if (!need_wh && old_bend != new_bend) {
au_set_h_dptr(dentry, new_bend, NULL);
au_set_dbend(dentry, old_bend);
}
}
AuDbg("need_wh %d\n", need_wh);
err = need_wh;
out:
return err;
}
示例2: aufs_inotify
static void aufs_inotify(struct inotify_watch *watch, u32 wd __maybe_unused,
u32 mask, u32 cookie __maybe_unused,
const char *h_child_name, struct inode *h_child_inode)
{
struct au_hnotify *hnotify;
struct qstr h_child_qstr = {
.name = h_child_name
};
/* if IN_UNMOUNT happens, there must be another bug */
AuDebugOn(mask & IN_UNMOUNT);
if (mask & (IN_IGNORED | IN_UNMOUNT)) {
put_inotify_watch(watch);
return;
}
#ifdef AuDbgHnotify
au_debug(1);
if (1 || !h_child_name || strcmp(h_child_name, AUFS_XINO_FNAME)) {
AuDbg("i%lu, wd %d, mask 0x%x %s, cookie 0x%x, hcname %s,"
" hi%lu\n",
watch->inode->i_ino, wd, mask, in_name(mask), cookie,
h_child_name ? h_child_name : "",
h_child_inode ? h_child_inode->i_ino : 0);
WARN_ON(1);
}
au_debug(0);
#endif
if (h_child_name)
h_child_qstr.len = strlen(h_child_name);
hnotify = container_of(watch, struct au_hnotify, hn_watch);
au_hnotify(watch->inode, hnotify, mask, &h_child_qstr, h_child_inode);
}
示例3: au_conv_oflags
static int au_conv_oflags(int flags)
{
int mask = 0;
#ifdef CONFIG_IMA
fmode_t fmode;
/* mask = MAY_OPEN; */
fmode = OPEN_FMODE(flags);
if (fmode & FMODE_READ)
mask |= MAY_READ;
if ((fmode & FMODE_WRITE)
|| (flags & O_TRUNC))
mask |= MAY_WRITE;
/*
* if (flags & O_APPEND)
* mask |= MAY_APPEND;
*/
if (flags & vfsub_fmode_to_uint(FMODE_EXEC))
mask |= MAY_EXEC;
AuDbg("flags 0x%x, mask 0x%x\n", flags, mask);
#endif
return mask;
}
示例4: 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;
}
示例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_dbg_verify_dinode
void __au_dbg_verify_dinode(struct dentry *dentry, const char *func, int line)
{
struct inode *h_inode, *inode = dentry->d_inode;
struct dentry *h_dentry;
aufs_bindex_t bindex, bend, bi;
if (!inode /* || au_di(dentry)->di_lsc == AuLsc_DI_TMP */)
return;
bend = au_dbend(dentry);
bi = au_ibend(inode);
if (bi < bend)
bend = bi;
bindex = au_dbstart(dentry);
bi = au_ibstart(inode);
if (bi > bindex)
bindex = bi;
for (; bindex <= bend; bindex++) {
h_dentry = au_h_dptr(dentry, bindex);
if (!h_dentry)
continue;
h_inode = au_h_iptr(inode, bindex);
if (unlikely(h_inode != h_dentry->d_inode)) {
au_debug_on();
AuDbg("b%d, %s:%d\n", bindex, func, line);
AuDbgDentry(dentry);
AuDbgInode(inode);
au_debug_off();
BUG();
}
}
}
示例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_mvd_args_parent
/* make sure the parent dir is fine */
static int au_mvd_args_parent(const unsigned char dmsg,
struct au_mvd_args *a)
{
int err;
aufs_bindex_t bindex;
err = 0;
if (unlikely(au_alive_dir(a->parent))) {
err = -ENOENT;
AU_MVD_PR(dmsg, "parent dir is dead\n");
goto out;
}
a->bopq = au_dbdiropq(a->parent);
bindex = au_wbr_nonopq(a->dentry, a->mvd_bdst);
AuDbg("b%d\n", bindex);
if (unlikely((bindex >= 0 && bindex < a->mvd_bdst)
|| (a->bopq != -1 && a->bopq < a->mvd_bdst))) {
err = -EINVAL;
a->mvd_errno = EAU_MVDOWN_OPAQUE;
AU_MVD_PR(dmsg, "ancestor is opaque b%d, b%d\n",
a->bopq, a->mvd_bdst);
}
out:
AuTraceErr(err);
return err;
}
示例9: lock_hdir_lkup_wh
/*
* initial procedure of adding a new entry.
* prepare writable branch and the parent dir, lock it,
* and lookup whiteout for the new entry.
*/
static struct dentry*
lock_hdir_lkup_wh(struct dentry *dentry, struct au_dtime *dt,
struct dentry *src_dentry, struct au_pin *pin,
struct au_wr_dir_args *wr_dir_args)
{
struct dentry *wh_dentry, *h_parent;
struct super_block *sb;
struct au_branch *br;
int err;
unsigned int udba;
aufs_bindex_t bcpup;
AuDbg("%.*s\n", AuDLNPair(dentry));
err = au_wr_dir(dentry, src_dentry, wr_dir_args);
bcpup = err;
wh_dentry = ERR_PTR(err);
if (unlikely(err < 0))
goto out;
sb = dentry->d_sb;
udba = au_opt_udba(sb);
err = au_pin(pin, dentry, bcpup, udba,
AuPin_DI_LOCKED | AuPin_MNT_WRITE);
wh_dentry = ERR_PTR(err);
if (unlikely(err))
goto out;
h_parent = au_pinned_h_parent(pin);
if (udba != AuOpt_UDBA_NONE
&& au_dbstart(dentry) == bcpup)
err = au_may_add(dentry, bcpup, h_parent,
au_ftest_wrdir(wr_dir_args->flags, ISDIR));
else if (unlikely(dentry->d_name.len > AUFS_MAX_NAMELEN))
err = -ENAMETOOLONG;
wh_dentry = ERR_PTR(err);
if (unlikely(err))
goto out_unpin;
br = au_sbr(sb, bcpup);
if (dt) {
struct path tmp = {
.dentry = h_parent,
.mnt = au_br_mnt(br)
};
au_dtime_store(dt, au_pinned_parent(pin), &tmp);
}
wh_dentry = NULL;
if (bcpup != au_dbwh(dentry))
goto out; /* success */
wh_dentry = au_wh_lkup(h_parent, &dentry->d_name, br);
out_unpin:
if (IS_ERR(wh_dentry))
au_unpin(pin);
out:
return wh_dentry;
}
示例10: au_opts_parse_mod
static int noinline_for_stack
au_opts_parse_mod(struct au_opt_mod *mod, substring_t args[])
{
int err;
struct path path;
char *p;
err = -EINVAL;
mod->path = args[0].from;
p = strchr(mod->path, '=');
if (unlikely(!p)) {
pr_err("no permssion %s\n", args[0].from);
goto out;
}
*p++ = 0;
err = vfsub_kern_path(mod->path, lkup_dirflags, &path);
if (unlikely(err)) {
pr_err("lookup failed %s (%d)\n", mod->path, err);
goto out;
}
mod->perm = br_perm_val(p);
AuDbg("mod path %s, perm 0x%x, %s\n", mod->path, mod->perm, p);
mod->h_root = dget(path.dentry);
path_put(&path);
out:
return err;
}
示例11: sysaufs_si_br
/*
* the lifetime of branch is independent from the entry under sysfs.
* sysfs handles the lifetime of the entry, and never call ->show() after it is
* unlinked.
*/
static int sysaufs_si_br(struct seq_file *seq, struct super_block *sb,
aufs_bindex_t bindex)
{
int err;
struct path path;
struct dentry *root;
struct au_branch *br;
char *perm;
AuDbg("b%d\n", bindex);
err = 0;
root = sb->s_root;
di_read_lock_parent(root, !AuLock_IR);
br = au_sbr(sb, bindex);
path.mnt = br->br_mnt;
path.dentry = au_h_dptr(root, bindex);
au_seq_path(seq, &path);
di_read_unlock(root, !AuLock_IR);
perm = au_optstr_br_perm(br->br_perm);
if (perm) {
err = seq_printf(seq, "=%s\n", perm);
kfree(perm);
if (err == -1)
err = -E2BIG;
} else
err = -ENOMEM;
return err;
}
示例12: au_do_h_d_reval
static int au_do_h_d_reval(struct dentry *h_dentry, unsigned int flags,
struct dentry *dentry, aufs_bindex_t bindex)
{
int err, valid;
err = 0;
if (!(h_dentry->d_flags & DCACHE_OP_REVALIDATE))
goto out;
AuDbg("b%d\n", bindex);
/*
* gave up supporting LOOKUP_CREATE/OPEN for lower fs,
* due to whiteout and branch permission.
*/
flags &= ~(/*LOOKUP_PARENT |*/ LOOKUP_OPEN | LOOKUP_CREATE
| LOOKUP_FOLLOW | LOOKUP_EXCL);
/* it may return tri-state */
valid = h_dentry->d_op->d_revalidate(h_dentry, flags);
if (unlikely(valid < 0))
err = valid;
else if (!valid)
err = -EINVAL;
out:
AuTraceErr(err);
return err;
}
示例13: 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);
}
示例14: au_rdu_verify
static int au_rdu_verify(struct aufs_rdu *rdu)
{
AuDbg("rdu{%llu, %p, %u | %u | %llu, %u, %u | "
"%llu, b%d, 0x%x, g%u}\n",
rdu->sz, rdu->ent.e, rdu->verify[AufsCtlRduV_SZ],
rdu->blk,
rdu->rent, rdu->shwh, rdu->full,
rdu->cookie.h_pos, rdu->cookie.bindex, rdu->cookie.flags,
rdu->cookie.generation);
if (rdu->verify[AufsCtlRduV_SZ] == sizeof(*rdu))
return 0;
AuDbg("%u:%u\n",
rdu->verify[AufsCtlRduV_SZ], (unsigned int)sizeof(*rdu));
return -EINVAL;
}
示例15: au_hfsn_handle_event
static int au_hfsn_handle_event(struct fsnotify_group *group,
struct fsnotify_mark *inode_mark,
struct fsnotify_mark *vfsmount_mark,
struct fsnotify_event *event)
{
int err;
struct au_hnotify *hnotify;
struct inode *h_dir, *h_inode;
__u32 mask;
struct qstr h_child_qstr = {
.name = event->file_name,
.len = event->name_len
};
AuDebugOn(event->data_type != FSNOTIFY_EVENT_INODE);
err = 0;
/* if FS_UNMOUNT happens, there must be another bug */
mask = event->mask;
AuDebugOn(mask & FS_UNMOUNT);
if (mask & (FS_IN_IGNORED | FS_UNMOUNT))
goto out;
h_dir = event->to_tell;
h_inode = event->inode;
#ifdef AuDbgHnotify
au_debug(1);
if (1 || h_child_qstr.len != sizeof(AUFS_XINO_FNAME) - 1
|| strncmp(h_child_qstr.name, AUFS_XINO_FNAME, h_child_qstr.len)) {
AuDbg("i%lu, mask 0x%x %s, hcname %.*s, hi%lu\n",
h_dir->i_ino, mask, au_hfsn_name(mask),
AuLNPair(&h_child_qstr), h_inode ? h_inode->i_ino : 0);
/* WARN_ON(1); */
}
au_debug(0);
#endif
AuDebugOn(!inode_mark);
hnotify = container_of(inode_mark, struct au_hnotify, hn_mark);
err = au_hnotify(h_dir, hnotify, mask, &h_child_qstr, h_inode);
out:
return err;
}
/* isn't it waste to ask every registered 'group'? */
/* copied from linux/fs/notify/inotify/inotify_fsnotiry.c */
/* it should be exported to modules */
static bool au_hfsn_should_send_event(struct fsnotify_group *group,
struct inode *h_inode,
struct fsnotify_mark *inode_mark,
struct fsnotify_mark *vfsmount_mark,
__u32 mask, void *data, int data_type)
{
mask = (mask & ~FS_EVENT_ON_CHILD);
return inode_mark->mask & mask;
}