本文整理汇总了C++中do_filp_open函数的典型用法代码示例。如果您正苦于以下问题:C++ do_filp_open函数的具体用法?C++ do_filp_open怎么用?C++ do_filp_open使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了do_filp_open函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: do_sys_open
long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
struct open_flags op;
int fd = build_open_flags(flags, mode, &op);
struct filename *tmp;
if (fd)
return fd;
tmp = getname(filename);
if (IS_ERR(tmp))
return PTR_ERR(tmp);
fd = get_unused_fd_flags(flags);
if (fd >= 0) {
struct file *f = do_filp_open(dfd, tmp, &op);
if (IS_ERR(f)) {
put_unused_fd(fd);
fd = PTR_ERR(f);
} else {
fsnotify_open(f);
fd_install(fd, f);
}
}
putname(tmp);
return fd;
}
开发者ID:wpwrak,项目名称:ben-wpan-linux,代码行数:27,代码来源:open.c
示例2: do_sys_open
long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
struct open_flags op;
int lookup = build_open_flags(flags, mode, &op);
char *tmp = getname(filename);
int fd = PTR_ERR(tmp);
if (!IS_ERR(tmp)) {
fd = get_unused_fd_flags(flags);
if (fd >= 0) {
struct file *f = do_filp_open(dfd, tmp, &op, lookup);
if (IS_ERR(f)) {
put_unused_fd(fd);
fd = PTR_ERR(f);
} else {
fsnotify_open(f);
fd_install(fd, f);
/* LGE_CHANGE_S
*
* do read/mmap profiling during booting
* in order to use the data as readahead args
*
* [email protected] 20120503
*/
sreadahead_prof( f, 0, 0);
/* LGE_CHANGE_E */
}
}
putname(tmp);
}
return fd;
}
开发者ID:adyjl,项目名称:DORIMANX_LG_STOCK_LP_KERNEL,代码行数:32,代码来源:open.c
示例3: do_sys_open
long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
struct open_flags op;
int lookup = build_open_flags(flags, mode, &op);
char *tmp = getname(filename);
int fd = PTR_ERR(tmp);
if (!IS_ERR(tmp)) {
fd = get_unused_fd_flags(flags);
if (fd >= 0) {
struct file *f = do_filp_open(dfd, tmp, &op, lookup);
if (IS_ERR(f)) {
put_unused_fd(fd);
fd = PTR_ERR(f);
} else {
fsnotify_open(f);
fd_install(fd, f);
/*
*/
sreadahead_prof( f, 0, 0);
/* */
}
}
putname(tmp);
}
return fd;
}
开发者ID:That-Kurt,项目名称:kk_mt6577,代码行数:32,代码来源:open.c
示例4: do_sys_open
long do_sys_open(int dfd, const char __user *filename, int flags, int mode)
{
struct open_flags op;
int lookup = build_open_flags(flags, mode, &op);
char *tmp = getname(filename);
int fd = PTR_ERR(tmp);
if (!IS_ERR(tmp)) {
fd = get_unused_fd_flags(flags);
if (fd >= 0) {
struct file *f = do_filp_open(dfd, tmp, &op, lookup);
if (IS_ERR(f)) {
put_unused_fd(fd);
fd = PTR_ERR(f);
} else {
fsnotify_open(f);
fd_install(fd, f);
//ASUS_BSP +++ Jimmy,Josh "remove fuse"
if(strcmp(f->f_vfsmnt->mnt_mountpoint->d_iname,"sdcard")==0){
chown_common(&(f->f_path),-1,1015);
}
//ASUS_BSP --- Jimmy,Josh "remove fuse"
}
}
putname(tmp);
}
return fd;
}
开发者ID:SmokyBob,项目名称:android_kernel_asus_padfone2,代码行数:28,代码来源:open.c
示例5: do_sys_open
long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
struct open_flags op;
int lookup = build_open_flags(flags, mode, &op);
char *tmp = getname(filename);
int fd = PTR_ERR(tmp);
#if IO_LOGGER_ENABLE
unsigned long long time1 = 0,timeoffset = 0;
bool add_trace_e = false;
#endif
if (!IS_ERR(tmp)) {
#if IO_LOGGER_ENABLE
if(unlikely(en_IOLogger())){
if(!memcmp(tmp,"/data",5)||!memcmp(tmp,"/system",7)){
add_trace_e = true;
time1 = sched_clock();
AddIOTrace(IO_LOGGER_MSG_VFS_OPEN_INTFS,do_sys_open,tmp);
}
}
#endif
fd = get_unused_fd_flags(flags);
if (fd >= 0) {
struct file *f = do_filp_open(dfd, tmp, &op, lookup);
if (IS_ERR(f)) {
put_unused_fd(fd);
fd = PTR_ERR(f);
} else {
fsnotify_open(f);
fd_install(fd, f);
}
}
#if IO_LOGGER_ENABLE
if(unlikely(en_IOLogger()) && add_trace_e){
timeoffset = sched_clock() - time1;
add_trace_e = false;
if(BEYOND_TRACE_LOG_TIME(timeoffset))
{
AddIOTrace(IO_LOGGER_MSG_VFS_OPEN_INTFS_END,do_sys_open,tmp,timeoffset);
if(BEYOND_DUMP_LOG_TIME(timeoffset))
DumpIOTrace(timeoffset);
}
}
#endif
putname(tmp);
}
return fd;
}
开发者ID:Lesozav25,项目名称:ZOPO-TSN,代码行数:50,代码来源:open.c
示例6: do_sys_open
long do_sys_open(int dfd, const char __user *filename, int flags, int mode)
{
char *tmp = getname(filename);
int fd = PTR_ERR(tmp);
if (!IS_ERR(tmp)) {
fd = get_unused_fd_flags(flags);
if (fd >= 0) {
struct file *f = do_filp_open(dfd, tmp, flags, mode, 0);
if (IS_ERR(f)) {
put_unused_fd(fd);
fd = PTR_ERR(f);
} else {
fsnotify_open(f->f_path.dentry);
fd_install(fd, f);
}
}
putname(tmp);
}
return fd;
}
开发者ID:mikeberkelaar,项目名称:grhardened,代码行数:21,代码来源:open.c
示例7: do_sys_open
long do_sys_open(int dfd, const char __user *filename, int flags, umode_t mode)
{
struct open_flags op;
int lookup = build_open_flags(flags, mode, &op);
char *tmp = getname(filename);
int fd = PTR_ERR(tmp);
if (!IS_ERR(tmp)) {
#if (IO_TEST_DEBUG)
if(!(flags & O_DIRECTORY)&& strstr(filename, "_quadrant_.tmp"))
{
if (flags&0x00000001)
{
io_w_test_count = (io_w_test_count + 1)%10;
flags = 0x00000042;
}
else
{
flags = 0x00000002;
}
}
#endif
fd = get_unused_fd_flags(flags);
if (fd >= 0) {
struct file *f = do_filp_open(dfd, tmp, &op, lookup);
if (IS_ERR(f)) {
put_unused_fd(fd);
fd = PTR_ERR(f);
} else {
fsnotify_open(f);
fd_install(fd, f);
}
}
putname(tmp);
}
return fd;
}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:37,代码来源:open.c
示例8: build_open_flags
/**
* filp_open - open file and return file pointer
*
* @filename: path to open
* @flags: open flags as per the open(2) second argument
* @mode: mode for the new file if O_CREAT is set, else ignored
*
* This is the helper to open a file from kernelspace if you really
* have to. But in generally you should not do this, so please move
* along, nothing to see here..
*/
struct file *filp_open(const char *filename, int flags, umode_t mode)
{
struct open_flags op;
int lookup = build_open_flags(flags, mode, &op);
return do_filp_open(AT_FDCWD, filename, &op, lookup);
}
开发者ID:boa19861105,项目名称:Blackout-Monarudo,代码行数:17,代码来源:open.c
示例9: build_open_flags
/**
* file_open_name - open file and return file pointer
*
* @name: struct filename containing path to open
* @flags: open flags as per the open(2) second argument
* @mode: mode for the new file if O_CREAT is set, else ignored
*
* This is the helper to open a file from kernelspace if you really
* have to. But in generally you should not do this, so please move
* along, nothing to see here..
*/
struct file *file_open_name(struct filename *name, int flags, umode_t mode)
{
struct open_flags op;
int err = build_open_flags(flags, mode, &op);
return err ? ERR_PTR(err) : do_filp_open(AT_FDCWD, name, &op);
}
开发者ID:wpwrak,项目名称:ben-wpan-linux,代码行数:17,代码来源:open.c
注:本文中的do_filp_open函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论