openflags
#define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 1, .c = 0, \
#define OPEN_FLAGS ((struct openflags) { .r = 1, .w = 1, .s = 0, .c = 0, \
static struct openflags global_openflags = OPEN_FLAGS;
struct openflags boot_openflags;
struct openflags openflags;
.openflags = OPEN_FLAGS, \
struct openflags flags = global_openflags;
static int open_ubd_file(char *file, struct openflags *openflags, int shared,
fd = os_open_file(file, *openflags, mode);
if (!openflags->w ||
openflags->w = 0;
fd = os_open_file(file, *openflags, mode);
err = os_lock_file(fd, openflags->w);
struct openflags flags,
struct openflags flags;
ubd_dev->openflags = ubd_dev->boot_openflags;
fd = open_ubd_file(ubd_dev->file, &ubd_dev->openflags, ubd_dev->shared,
ubd_dev->openflags, SECTOR_SIZE, PAGE_SIZE,
flags = ubd_dev->openflags;
set_disk_ro(disk, !ubd_dev->openflags.w);
static inline struct openflags of_sync(struct openflags flags)
static inline struct openflags of_create(struct openflags flags)
static inline struct openflags of_trunc(struct openflags flags)
static inline struct openflags of_append(struct openflags flags)
static inline struct openflags of_excl(struct openflags flags)
static inline struct openflags of_cloexec(struct openflags flags)
extern int os_open_file(const char *file, struct openflags flags, int mode);
extern int os_file_mode(const char *file, struct openflags *mode_out);
#define OPENFLAGS() ((struct openflags) { .r = 0, .w = 0, .s = 0, .c = 0, \
static inline struct openflags of_read(struct openflags flags)
static inline struct openflags of_write(struct openflags flags)
static inline struct openflags of_rdwr(struct openflags flags)
static inline struct openflags of_set_rw(struct openflags flags, int r, int w)
int os_file_mode(const char *file, struct openflags *mode_out)
int os_open_file(const char *file, struct openflags flags, int mode)
static int nfs_open_permission_mask(int openflags)
if (openflags & __FMODE_EXEC) {
if ((openflags & O_ACCMODE) != O_WRONLY)
if ((openflags & O_ACCMODE) != O_RDONLY)
int nfs_may_open(struct inode *inode, const struct cred *cred, int openflags)
return nfs_do_access(inode, cred, nfs_open_permission_mask(openflags));
unsigned openflags = filp->f_flags;
err = nfs_check_flags(openflags);
openflags &= ~(O_CREAT|O_EXCL);
flags_to_mode(openflags), filp);
if (openflags & O_TRUNC) {
inode = NFS_PROTO(dir)->open_context(dir, ctx, openflags, &attr, NULL);
fmode_t fmode, int openflags)
if (openflags & O_DIRECT) {
int openflags = opendata->o_arg.open_flags;
nfs4_map_atomic_open_share(server, fmode, openflags);
extern int nfs_may_open(struct inode *inode, const struct cred *cred, int openflags);
int openflags = O_WRONLY|O_CREAT|O_LARGEFILE;
openflags |= O_TRUNC;
wfile = filp_open(collected, openflags, mode);