aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-10 05:01:45 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 08:33:31 -0400
commit47237687d73cbeae1dd7a133c3fc3d7239094568 (patch)
tree1d267d03246f0a16cbff3c8221ee69dd1521f835 /fs/cifs
parenta8277b9baa6268de386529a33061775bc716198b (diff)
->atomic_open() prototype change - pass int * instead of bool *
... and let finish_open() report having opened the file via that sucker. Next step: don't modify od->filp at all. [AV: FILE_CREATE was already used by cifs; Miklos' fix folded] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/cifsfs.h2
-rw-r--r--fs/cifs/dir.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index 3a572bf5947f..92a7c3d8a031 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -48,7 +48,7 @@ extern int cifs_create(struct inode *, struct dentry *, umode_t,
48 struct nameidata *); 48 struct nameidata *);
49extern struct file *cifs_atomic_open(struct inode *, struct dentry *, 49extern struct file *cifs_atomic_open(struct inode *, struct dentry *,
50 struct opendata *, unsigned, umode_t, 50 struct opendata *, unsigned, umode_t,
51 bool *); 51 int *);
52extern struct dentry *cifs_lookup(struct inode *, struct dentry *, 52extern struct dentry *cifs_lookup(struct inode *, struct dentry *,
53 struct nameidata *); 53 struct nameidata *);
54extern int cifs_unlink(struct inode *dir, struct dentry *dentry); 54extern int cifs_unlink(struct inode *dir, struct dentry *dentry);
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 7a3dcd15d681..6cdf23fd70ee 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -160,7 +160,7 @@ check_name(struct dentry *direntry)
160static int cifs_do_create(struct inode *inode, struct dentry *direntry, 160static int cifs_do_create(struct inode *inode, struct dentry *direntry,
161 int xid, struct tcon_link *tlink, unsigned oflags, 161 int xid, struct tcon_link *tlink, unsigned oflags,
162 umode_t mode, __u32 *oplock, __u16 *fileHandle, 162 umode_t mode, __u32 *oplock, __u16 *fileHandle,
163 bool *created) 163 int *created)
164{ 164{
165 int rc = -ENOENT; 165 int rc = -ENOENT;
166 int create_options = CREATE_NOT_DIR; 166 int create_options = CREATE_NOT_DIR;
@@ -311,7 +311,7 @@ static int cifs_do_create(struct inode *inode, struct dentry *direntry,
311 .device = 0, 311 .device = 0,
312 }; 312 };
313 313
314 *created = true; 314 *created |= FILE_CREATED;
315 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) { 315 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SET_UID) {
316 args.uid = (__u64) current_fsuid(); 316 args.uid = (__u64) current_fsuid();
317 if (inode->i_mode & S_ISGID) 317 if (inode->i_mode & S_ISGID)
@@ -379,7 +379,7 @@ out:
379struct file * 379struct file *
380cifs_atomic_open(struct inode *inode, struct dentry *direntry, 380cifs_atomic_open(struct inode *inode, struct dentry *direntry,
381 struct opendata *od, unsigned oflags, umode_t mode, 381 struct opendata *od, unsigned oflags, umode_t mode,
382 bool *created) 382 int *opened)
383{ 383{
384 int rc; 384 int rc;
385 int xid; 385 int xid;
@@ -426,14 +426,14 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
426 tcon = tlink_tcon(tlink); 426 tcon = tlink_tcon(tlink);
427 427
428 rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, 428 rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode,
429 &oplock, &fileHandle, created); 429 &oplock, &fileHandle, opened);
430 430
431 if (rc) { 431 if (rc) {
432 filp = ERR_PTR(rc); 432 filp = ERR_PTR(rc);
433 goto out; 433 goto out;
434 } 434 }
435 435
436 filp = finish_open(od, direntry, generic_file_open); 436 filp = finish_open(od, direntry, generic_file_open, opened);
437 if (IS_ERR(filp)) { 437 if (IS_ERR(filp)) {
438 CIFSSMBClose(xid, tcon, fileHandle); 438 CIFSSMBClose(xid, tcon, fileHandle);
439 goto out; 439 goto out;
@@ -469,7 +469,7 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
469 struct tcon_link *tlink; 469 struct tcon_link *tlink;
470 __u16 fileHandle; 470 __u16 fileHandle;
471 __u32 oplock; 471 __u32 oplock;
472 bool created = true; 472 int created = FILE_CREATED;
473 473
474 cFYI(1, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p", 474 cFYI(1, "cifs_create parent inode = 0x%p name is: %s and dentry = 0x%p",
475 inode, direntry->d_name.name, direntry); 475 inode, direntry->d_name.name, direntry);