/* open (but not create!) intent? */
if (nd->flags & LOOKUP_OPEN &&
!(nd->intent.open.flags & O_CREAT)) {
- err = ceph_lookup_open(dir, dentry, nd);
+ int mode = nd->intent.open.create_mode & ~current->fs->umask;
+ err = ceph_lookup_open(dir, dentry, nd, mode);
return ERR_PTR(err);
}
dout(5, "create in dir %p dentry %p name '%.*s'\n",
dir, dentry, dentry->d_name.len, dentry->d_name.name);
BUG_ON((nd->flags & LOOKUP_OPEN) == 0);
- err = ceph_lookup_open(dir, dentry, nd);
+ err = ceph_lookup_open(dir, dentry, nd, mode);
return err;
}
* path_lookup_create -> LOOKUP_OPEN|LOOKUP_CREATE
*/
int ceph_lookup_open(struct inode *dir, struct dentry *dentry,
- struct nameidata *nd)
+ struct nameidata *nd, int mode)
{
struct ceph_client *client = ceph_sb_to_client(dir->i_sb);
struct ceph_mds_client *mdsc = &client->mdsc;
struct ceph_mds_request *req;
int err;
int flags = nd->intent.open.flags;
- int mode = nd->intent.open.create_mode;
dout(5, "ceph_lookup_open dentry %p '%.*s' flags %d mode 0%o\n",
dentry, dentry->d_name.len, dentry->d_name.name, flags, mode);
extern const struct address_space_operations ceph_aops;
extern int ceph_open(struct inode *inode, struct file *file);
extern int ceph_lookup_open(struct inode *dir, struct dentry *dentry,
- struct nameidata *nd);
+ struct nameidata *nd, int mode);
extern int ceph_release(struct inode *inode, struct file *filp);
extern int ceph_inode_revalidate(struct inode *inode, int mask);