Skip to content

Commit 84695ff

Browse files
author
Al Viro
committed
Merge getxattr prototype change into work.lookups
The rest of work.xattr stuff isn't needed for this branch
2 parents bf16200 + ce23e64 commit 84695ff

107 files changed

Lines changed: 414 additions & 458 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/filesystems/porting‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,3 +525,9 @@ in your dentry operations instead.
525525
set_delayed_call() where it used to set *cookie.
526526
->put_link() is gone - just give the destructor to set_delayed_call()
527527
in ->get_link().
528+
--
529+
[mandatory]
530+
->getxattr() and xattr_handler.get() get dentry and inode passed separately.
531+
dentry might be yet to be attached to inode, so do _not_ use its ->d_inode
532+
in the instances. Rationale: !@#!@# security_d_instantiate() needs to be
533+
called before we attach dentry to inode.

‎drivers/staging/lustre/lustre/llite/llite_internal.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,8 +1042,8 @@ static inline __u64 ll_file_maxbytes(struct inode *inode)
10421042
/* llite/xattr.c */
10431043
int ll_setxattr(struct dentry *dentry, const char *name,
10441044
const void *value, size_t size, int flags);
1045-
ssize_t ll_getxattr(struct dentry *dentry, const char *name,
1046-
void *buffer, size_t size);
1045+
ssize_t ll_getxattr(struct dentry *dentry, struct inode *inode,
1046+
const char *name, void *buffer, size_t size);
10471047
ssize_t ll_listxattr(struct dentry *dentry, char *buffer, size_t size);
10481048
int ll_removexattr(struct dentry *dentry, const char *name);
10491049

‎drivers/staging/lustre/lustre/llite/xattr.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,11 +451,9 @@ int ll_getxattr_common(struct inode *inode, const char *name,
451451
return rc;
452452
}
453453

454-
ssize_t ll_getxattr(struct dentry *dentry, const char *name,
455-
void *buffer, size_t size)
454+
ssize_t ll_getxattr(struct dentry *dentry, struct inode *inode,
455+
const char *name, void *buffer, size_t size)
456456
{
457-
struct inode *inode = d_inode(dentry);
458-
459457
LASSERT(inode);
460458
LASSERT(name);
461459

‎fs/9p/acl.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static struct posix_acl *v9fs_get_cached_acl(struct inode *inode, int type)
9393
* instantiating the inode (v9fs_inode_from_fid)
9494
*/
9595
acl = get_cached_acl(inode, type);
96-
BUG_ON(acl == ACL_NOT_CACHED);
96+
BUG_ON(is_uncached_acl(acl));
9797
return acl;
9898
}
9999

@@ -213,8 +213,8 @@ int v9fs_acl_mode(struct inode *dir, umode_t *modep,
213213
}
214214

215215
static int v9fs_xattr_get_acl(const struct xattr_handler *handler,
216-
struct dentry *dentry, const char *name,
217-
void *buffer, size_t size)
216+
struct dentry *dentry, struct inode *inode,
217+
const char *name, void *buffer, size_t size)
218218
{
219219
struct v9fs_session_info *v9ses;
220220
struct posix_acl *acl;
@@ -227,7 +227,7 @@ static int v9fs_xattr_get_acl(const struct xattr_handler *handler,
227227
if ((v9ses->flags & V9FS_ACCESS_MASK) != V9FS_ACCESS_CLIENT)
228228
return v9fs_xattr_get(dentry, handler->name, buffer, size);
229229

230-
acl = v9fs_get_cached_acl(d_inode(dentry), handler->flags);
230+
acl = v9fs_get_cached_acl(inode, handler->flags);
231231
if (IS_ERR(acl))
232232
return PTR_ERR(acl);
233233
if (acl == NULL)

‎fs/9p/vfs_inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ v9fs_vfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
10711071
if (IS_ERR(st))
10721072
return PTR_ERR(st);
10731073

1074-
v9fs_stat2inode(st, d_inode(dentry), d_inode(dentry)->i_sb);
1074+
v9fs_stat2inode(st, d_inode(dentry), dentry->d_sb);
10751075
generic_fillattr(d_inode(dentry), stat);
10761076

10771077
p9stat_free(st);

‎fs/9p/xattr.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ ssize_t v9fs_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size)
138138
}
139139

140140
static int v9fs_xattr_handler_get(const struct xattr_handler *handler,
141-
struct dentry *dentry, const char *name,
142-
void *buffer, size_t size)
141+
struct dentry *dentry, struct inode *inode,
142+
const char *name, void *buffer, size_t size)
143143
{
144144
const char *full_name = xattr_full_name(handler, name);
145145

‎fs/bad_inode.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ static int bad_inode_setxattr(struct dentry *dentry, const char *name,
106106
return -EIO;
107107
}
108108

109-
static ssize_t bad_inode_getxattr(struct dentry *dentry, const char *name,
110-
void *buffer, size_t size)
109+
static ssize_t bad_inode_getxattr(struct dentry *dentry, struct inode *inode,
110+
const char *name, void *buffer, size_t size)
111111
{
112112
return -EIO;
113113
}

‎fs/btrfs/acl.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
6363
}
6464
kfree(value);
6565

66-
if (!IS_ERR(acl))
67-
set_cached_acl(inode, type, acl);
68-
6966
return acl;
7067
}
7168

‎fs/btrfs/tree-log.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4988,7 +4988,7 @@ static noinline int check_parent_dirs_for_sync(struct btrfs_trans_handle *trans,
49884988
goto out;
49894989

49904990
if (!S_ISDIR(inode->i_mode)) {
4991-
if (!parent || d_really_is_negative(parent) || sb != d_inode(parent)->i_sb)
4991+
if (!parent || d_really_is_negative(parent) || sb != parent->d_sb)
49924992
goto out;
49934993
inode = d_inode(parent);
49944994
}
@@ -5009,7 +5009,7 @@ static noinline int check_parent_dirs_for_sync(struct btrfs_trans_handle *trans,
50095009
break;
50105010
}
50115011

5012-
if (!parent || d_really_is_negative(parent) || sb != d_inode(parent)->i_sb)
5012+
if (!parent || d_really_is_negative(parent) || sb != parent->d_sb)
50135013
break;
50145014

50155015
if (IS_ROOT(parent))
@@ -5422,7 +5422,7 @@ static int btrfs_log_inode_parent(struct btrfs_trans_handle *trans,
54225422
}
54235423

54245424
while (1) {
5425-
if (!parent || d_really_is_negative(parent) || sb != d_inode(parent)->i_sb)
5425+
if (!parent || d_really_is_negative(parent) || sb != parent->d_sb)
54265426
break;
54275427

54285428
inode = d_inode(parent);

‎fs/btrfs/xattr.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,9 @@ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size)
369369
}
370370

371371
static int btrfs_xattr_handler_get(const struct xattr_handler *handler,
372-
struct dentry *dentry, const char *name,
373-
void *buffer, size_t size)
372+
struct dentry *unused, struct inode *inode,
373+
const char *name, void *buffer, size_t size)
374374
{
375-
struct inode *inode = d_inode(dentry);
376-
377375
name = xattr_full_name(handler, name);
378376
return __btrfs_getxattr(inode, name, buffer, size);
379377
}

0 commit comments

Comments
 (0)