Whamcloud - gitweb
09a4f5abc06348eb64fe874e3e5e6bd26c178cea
[fs/lustre-release.git] / lustre / llite / namei.c
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  *
4  * This code is issued under the GNU General Public License.
5  * See the file COPYING in this distribution
6  *
7  * Copyright (C) 1992, 1993, 1994, 1995
8  * Remy Card (card@masi.ibp.fr)
9  * Laboratoire MASI - Institut Blaise Pascal
10  * Universite Pierre et Marie Curie (Paris VI)
11  *
12  *  from
13  *
14  *  linux/fs/ext2/namei.c
15  *
16  *  Copyright (C) 1991, 1992  Linus Torvalds
17  *
18  *  Big-endian to little-endian byte-swapping/bitmaps by
19  *        David S. Miller (davem@caip.rutgers.edu), 1995
20  *  Directory entry file type support and forward compatibility hooks
21  *      for B-tree directories by Theodore Ts'o (tytso@mit.edu), 1998
22  *
23  *  Changes for use in OBDFS
24  *  Copyright (c) 1999, Seagate Technology Inc.
25  *  Copyright (C) 2001, Cluster File Systems, Inc.
26  *                       Rewritten based on recent ext2 page cache use.
27  *
28  */
29
30 #include <linux/fs.h>
31 #include <linux/locks.h>
32 #include <linux/quotaops.h>
33
34 #define DEBUG_SUBSYSTEM S_LLITE
35
36 #include <linux/obd_support.h>
37 #include <linux/lustre_lite.h>
38 #include <linux/lustre_dlm.h>
39 extern struct address_space_operations ll_aops;
40
41 /* from super.c */
42 extern void ll_change_inode(struct inode *inode);
43 extern int ll_setattr(struct dentry *de, struct iattr *attr);
44
45 /* from dir.c */
46 extern int ll_add_link (struct dentry *dentry, struct inode *inode);
47 obd_id ll_inode_by_name(struct inode * dir, struct dentry *dentry, int *typ);
48 int ext2_make_empty(struct inode *inode, struct inode *parent);
49 struct ext2_dir_entry_2 * ext2_find_entry (struct inode * dir,
50                    struct dentry *dentry, struct page ** res_page);
51 int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page );
52 int ext2_empty_dir (struct inode * inode);
53 struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p);
54 void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,
55                    struct page *page, struct inode *inode);
56
57 /*
58  * Couple of helper functions - make the code slightly cleaner.
59  */
60 static inline void ext2_inc_count(struct inode *inode)
61 {
62         inode->i_nlink++;
63 }
64
65 /* postpone the disk update until the inode really goes away */
66 static inline void ext2_dec_count(struct inode *inode)
67 {
68         inode->i_nlink--;
69 }
70
71 static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode)
72 {
73         int err;
74         err = ll_add_link(dentry, inode);
75         if (!err) {
76                 d_instantiate(dentry, inode);
77                 return 0;
78         }
79         ext2_dec_count(inode);
80         iput(inode);
81         return err;
82 }
83
84 /* methods */
85 static int ll_find_inode(struct inode *inode, unsigned long ino, void *opaque)
86 {
87         struct mds_body *body = (struct mds_body *)opaque;
88
89         if (inode->i_generation != body->generation)
90                 return 0;
91
92         return 1;
93 }
94
95 extern struct dentry_operations ll_d_ops;
96
97 int ll_lock(struct inode *dir, struct dentry *dentry,
98             struct lookup_intent *it, struct lustre_handle *lockh)
99 {
100         struct ll_sb_info *sbi = ll_i2sbi(dir);
101         int err, lock_mode;
102
103         if ((it->it_op & (IT_CREAT | IT_MKDIR | IT_SYMLINK | IT_SETATTR |
104                           IT_MKNOD)))
105                 lock_mode = LCK_PW;
106         else if (it->it_op & (IT_READDIR | IT_GETATTR | IT_OPEN | IT_UNLINK |
107                               IT_RMDIR | IT_RENAME | IT_RENAME2 | IT_READLINK))
108                 lock_mode = LCK_PR;
109         else if (it->it_op & IT_LOOKUP)
110                 lock_mode = LCK_CR;
111         else {
112                 LBUG();
113                 RETURN(-EINVAL);
114         }
115
116 #warning FIXME: add symlink tgt to intent and as a parameter here
117         err = mdc_enqueue(&sbi->ll_mdc_conn, LDLM_MDSINTENT, it, lock_mode, dir,
118                           dentry, lockh, 0, NULL, 0, dir, sizeof(*dir));
119
120         RETURN(err);
121 }
122
123 int ll_unlock(__u32 mode, struct lustre_handle *lockh)
124 {
125         ENTRY;
126
127         ldlm_lock_decref(lockh, mode);
128
129         RETURN(0);
130 }
131
132 static struct dentry *ll_lookup2(struct inode * dir, struct dentry *dentry,
133                                  struct lookup_intent *it)
134 {
135         struct ptlrpc_request *request = NULL;
136         struct inode * inode = NULL;
137         struct ll_sb_info *sbi = ll_i2sbi(dir);
138         struct ll_inode_md md;
139         struct lustre_handle lockh;
140         int err, offset;
141         struct lookup_intent lookup_it = { IT_LOOKUP };
142         obd_id ino = 0;
143
144         ENTRY;
145
146         if (it == NULL) {
147                 it = &lookup_it;
148                 dentry->d_it = it;
149         }
150
151         CDEBUG(D_INFO, "name: %*s, intent op: %d\n", dentry->d_name.len,
152                dentry->d_name.name, it->it_op);
153
154         if (dentry->d_name.len > EXT2_NAME_LEN)
155                 RETURN(ERR_PTR(-ENAMETOOLONG));
156
157         if (it->it_op == IT_RENAME2) {
158                 /* Set below to be the old dentry from the IT_RENAME intent */
159                 inode = ((struct dentry *)(it->it_data))->d_inode;
160                 LASSERT(inode);
161         }
162
163         err = ll_lock(dir, dentry, it, &lockh);
164         if (err < 0)
165                 RETURN(ERR_PTR(err));
166         memcpy(it->it_lock_handle, &lockh, sizeof(lockh));
167
168         request = (struct ptlrpc_request *)it->it_data;
169         if (it->it_disposition) {
170                 offset = 1;
171                 if (it->it_op & (IT_CREAT | IT_MKDIR | IT_SYMLINK | IT_MKNOD)) {
172                         /* For create ops, we want the lookup to be negative */
173                         if (!it->it_status)
174                                 GOTO(negative, NULL);
175                 } else if (it->it_op & (IT_GETATTR | IT_UNLINK |
176                                         IT_RMDIR | IT_SETATTR | IT_LOOKUP)) {
177                         /* For remove/check, we want the lookup to succeed */
178                         it->it_data = NULL;
179                         if (it->it_status)
180                                 GOTO(neg_req, NULL);
181                 } else if (it->it_op & IT_RENAME) {
182                         if (it->it_status) {
183                                 it->it_data = NULL;
184                                 GOTO(neg_req, NULL);
185                         }
186                         LASSERT(dentry->d_inode);
187                         it->it_data = dentry;
188                 } else if (it->it_op == IT_OPEN) {
189                         it->it_data = NULL;
190                         if (it->it_status && it->it_status != -EEXIST)
191                                 GOTO(neg_req, NULL);
192                 } else if (it->it_op == IT_RENAME2) {
193                         /* FIXME: make old_de negative, and drop
194                          *        new_de->d_inode if needed.
195                          */
196                         it->it_data = NULL;
197                         GOTO(out_req, NULL);
198                 }
199         } else {
200                 struct ll_inode_info *lli = ll_i2info(dir);
201                 int type;
202
203                 memcpy(&lli->lli_intent_lock_handle, &lockh, sizeof(lockh));
204                 offset = 0;
205
206                 ino = ll_inode_by_name(dir, dentry, &type);
207 #warning FIXME: handle negative inode case (see old ll_lookup)
208
209                 err = mdc_getattr(&sbi->ll_mdc_conn, ino, type,
210                                   OBD_MD_FLNOTOBD|OBD_MD_FLEASIZE, 0, &request);
211                 if (err) {
212                         CERROR("failure %d inode %Ld\n", err, (long long)ino);
213                         ptlrpc_free_req(request);
214 #warning FIXME: must release lock here
215                         RETURN(ERR_PTR(-abs(err)));
216                 }
217         }
218
219         md.body = lustre_msg_buf(request->rq_repmsg, offset);
220         if (S_ISREG(md.body->mode)) {
221                 if (request->rq_repmsg->bufcount < offset + 1)
222                         LBUG();
223                 md.md = lustre_msg_buf(request->rq_repmsg, offset + 1);
224         } else
225                 md.md = NULL;
226
227         /* No rpc's happen during iget4, -ENOMEM's are possible */
228         inode = iget4(dir->i_sb, ino, ll_find_inode, &md);
229
230  out_req:
231         LASSERT(!IS_ERR(inode));
232         if (!inode) {
233                 ptlrpc_free_req(request);
234                 ll_intent_release(dentry);
235                 RETURN(ERR_PTR(-ENOMEM));
236         }
237         EXIT;
238  neg_req:
239         ptlrpc_free_req(request);
240  negative:
241         dentry->d_op = &ll_d_ops;
242         d_add(dentry, inode);
243         if (it->it_op == IT_LOOKUP)
244                 ll_intent_release(dentry);
245
246         return NULL;
247 }
248
249 static struct inode *ll_create_node(struct inode *dir, const char *name,
250                                     int namelen, const char *tgt, int tgtlen,
251                                     int mode, __u64 extra,
252                                     struct lookup_intent *it,
253                                     struct lov_stripe_md *smd)
254 {
255         struct inode *inode;
256         struct ptlrpc_request *request = NULL;
257         struct mds_body *body;
258         int rc;
259         time_t time = CURRENT_TIME;
260         struct ll_sb_info *sbi = ll_i2sbi(dir);
261         int gid = current->fsgid;
262         struct ll_inode_md md;
263
264         ENTRY;
265
266         if (dir->i_mode & S_ISGID) {
267                 gid = dir->i_gid;
268                 if (S_ISDIR(mode))
269                         mode |= S_ISGID;
270         }
271
272         if (!it || !it->it_disposition) {
273                 rc = mdc_create(&sbi->ll_mdc_conn, dir, name, namelen, tgt,
274                                  tgtlen, mode, current->fsuid,
275                                  gid, time, extra, smd, &request);
276                 if (rc) {
277                         inode = ERR_PTR(rc);
278                         GOTO(out, rc);
279                 }
280                 body = lustre_msg_buf(request->rq_repmsg, 0);
281                 md.md = smd;
282         } else {
283                 request = it->it_data;
284                 body = lustre_msg_buf(request->rq_repmsg, 1);
285                 md.md = NULL;
286         }
287
288         body->valid = OBD_MD_FLNOTOBD;
289
290         body->nlink = 1;
291         body->atime = body->ctime = body->mtime = time;
292         body->uid = current->fsuid;
293         body->gid = gid;
294         body->mode = mode;
295
296         md.body = body;
297
298         inode = iget4(dir->i_sb, body->ino, ll_find_inode, &md);
299         if (IS_ERR(inode)) {
300                 rc = PTR_ERR(inode);
301                 CERROR("new_inode -fatal: rc %d\n", rc);
302                 LBUG();
303                 GOTO(out, rc);
304         }
305
306         if (!list_empty(&inode->i_dentry)) {
307                 CERROR("new_inode -fatal: inode %d, ct %d lnk %d\n",
308                        body->ino, atomic_read(&inode->i_count),
309                        inode->i_nlink);
310                 iput(inode);
311                 LBUG();
312                 inode = ERR_PTR(-EIO);
313                 GOTO(out, -EIO);
314         }
315
316         EXIT;
317  out:
318         ptlrpc_free_req(request);
319         return inode;
320 }
321
322 static int ll_mdc_unlink(struct inode *dir, struct inode *child, __u32 mode,
323                          const char *name, int len)
324 {
325         struct ptlrpc_request *request = NULL;
326         struct ll_sb_info *sbi = ll_i2sbi(dir);
327         int err;
328
329         ENTRY;
330
331         err = mdc_unlink(&sbi->ll_mdc_conn, dir, child, mode, name, len,
332                          &request);
333         ptlrpc_free_req(request);
334
335         RETURN(err);
336 }
337
338 int ll_mdc_link(struct dentry *src, struct inode *dir,
339                 const char *name, int len)
340 {
341         struct ptlrpc_request *request = NULL;
342         int err;
343         struct ll_sb_info *sbi = ll_i2sbi(dir);
344
345         ENTRY;
346
347         err = mdc_link(&sbi->ll_mdc_conn, src, dir, name,
348                        len, &request);
349         ptlrpc_free_req(request);
350
351         RETURN(err);
352 }
353
354 int ll_mdc_rename(struct inode *src, struct inode *tgt,
355                   struct dentry *old, struct dentry *new)
356 {
357         struct ptlrpc_request *request = NULL;
358         struct ll_sb_info *sbi = ll_i2sbi(src);
359         int err;
360
361         ENTRY;
362
363         err = mdc_rename(&sbi->ll_mdc_conn, src, tgt,
364                          old->d_name.name, old->d_name.len,
365                          new->d_name.name, new->d_name.len, &request);
366         ptlrpc_free_req(request);
367
368         RETURN(err);
369 }
370
371 /*
372  * By the time this is called, we already have created
373  * the directory cache entry for the new file, but it
374  * is so far negative - it has no inode.
375  *
376  * If the create succeeds, we fill in the inode information
377  * with d_instantiate().
378  */
379
380 static int ll_create(struct inode * dir, struct dentry * dentry, int mode)
381 {
382         int err, rc = 0;
383         struct obdo oa;
384         struct inode *inode;
385         struct lov_stripe_md *smd;
386         struct ll_inode_info *ii = NULL;
387         ENTRY;
388
389         if (dentry->d_it->it_disposition == 0) {
390                 memset(&oa, 0, sizeof(oa));
391                 oa.o_valid = OBD_MD_FLMODE;
392                 oa.o_mode = S_IFREG | 0600;
393                 rc = obd_create(ll_i2obdconn(dir), &oa, &smd);
394                 CDEBUG(D_DENTRY, "name %s mode %o o_id %lld: rc = %d\n",
395                        dentry->d_name.name, mode, (long long)oa.o_id, rc);
396                 if (rc)
397                         RETURN(rc);
398         }
399
400         inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len,
401                                NULL, 0, mode, 0, dentry->d_it, smd);
402
403         if (IS_ERR(inode)) {
404                 rc = PTR_ERR(inode);
405                 CERROR("error creating MDS object for id %Ld: rc = %d\n",
406                        (unsigned long long)oa.o_id, rc);
407 #warning FIXME: 'ii' needs to be set before this goto
408                 GOTO(out_destroy, rc);
409         }
410
411         if (dentry->d_it->it_disposition) {
412                 ii = ll_i2info(inode);
413                 memcpy(&ii->lli_intent_lock_handle,
414                        dentry->d_it->it_lock_handle,
415                        sizeof(struct lustre_handle));
416                 d_instantiate(dentry, inode);
417         } else {
418                 /* no directory data updates when intents rule */
419                 rc = ext2_add_nondir(dentry, inode);
420         }
421
422         RETURN(rc);
423
424 out_destroy:
425         oa.o_easize = ii->lli_smd->lmd_easize;
426         err = obd_destroy(ll_i2obdconn(dir), &oa, ii->lli_smd);
427         if (err)
428                 CERROR("error destroying object %Ld in error path: err = %d\n",
429                        (unsigned long long)oa.o_id, err);
430         return rc;
431 }
432
433 static int ll_mknod(struct inode *dir, struct dentry *dentry, int mode,
434                     int rdev)
435 {
436         struct inode *inode;
437         int err = 0;
438
439         inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len,
440                                NULL, 0, mode, rdev, dentry->d_it, NULL);
441
442         if (IS_ERR(inode))
443                 RETURN(PTR_ERR(inode));
444
445         /* no directory data updates when intents rule */
446         if (dentry->d_it->it_disposition == 0)
447                 err = ext2_add_nondir(dentry, inode);
448         else
449                 d_instantiate(dentry, inode);
450
451         return err;
452 }
453
454 static int ll_symlink(struct inode *dir, struct dentry *dentry,
455                       const char *symname)
456 {
457         unsigned l = strlen(symname);
458         struct inode *inode;
459         struct ll_inode_info *oinfo;
460
461         inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len,
462                                symname, l, S_IFLNK | S_IRWXUGO, 0,
463                                dentry->d_it, NULL);
464         if (IS_ERR(inode))
465                 RETURN(PTR_ERR(inode));
466
467         oinfo = ll_i2info(inode);
468
469         if (dentry->d_it->it_disposition) {
470 #warning FIXME: still needs intent support
471                 d_instantiate(dentry, inode);
472                 return 0;
473         }
474
475         OBD_ALLOC(oinfo->lli_symlink_name, l + 1);
476         if (!oinfo->lli_symlink_name)
477                 RETURN(-ENOMEM);
478
479         memcpy(oinfo->lli_symlink_name, symname, l + 1);
480         inode->i_size = l;
481
482         return ext2_add_nondir(dentry, inode);
483 }
484
485 static int ll_link(struct dentry *old_dentry, struct inode * dir,
486                    struct dentry *dentry)
487 {
488         int err;
489         struct inode *inode = old_dentry->d_inode;
490
491 #warning FIXME: still needs intent support
492         if (S_ISDIR(inode->i_mode))
493                 return -EPERM;
494
495         if (inode->i_nlink >= EXT2_LINK_MAX)
496                 return -EMLINK;
497
498         err = ll_mdc_link(old_dentry, dir,
499                           dentry->d_name.name, dentry->d_name.len);
500         if (err)
501                 RETURN(err);
502
503         inode->i_ctime = CURRENT_TIME;
504         ext2_inc_count(inode);
505         atomic_inc(&inode->i_count);
506
507         return ext2_add_nondir(dentry, inode);
508 }
509
510 static int ll_mkdir(struct inode * dir, struct dentry * dentry, int mode)
511 {
512         struct inode * inode;
513         int err = -EMLINK;
514         ENTRY;
515
516         if (dir->i_nlink >= EXT2_LINK_MAX)
517                 goto out;
518
519         ext2_inc_count(dir);
520
521         inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len,
522                                NULL, 0, S_IFDIR | mode, 0, dentry->d_it, NULL);
523         err = PTR_ERR(inode);
524         if (IS_ERR(inode))
525                 goto out_dir;
526
527         ext2_inc_count(inode);
528
529         err = ext2_make_empty(inode, dir);
530         if (err)
531                 goto out_fail;
532
533         /* no directory data updates when intents rule */
534         if (dentry->d_it->it_disposition == 0) {
535                 err = ll_add_link(dentry, inode);
536                 if (err)
537                         goto out_fail;
538         }
539
540         d_instantiate(dentry, inode);
541 out:
542         EXIT;
543         return err;
544
545 out_fail:
546         ext2_dec_count(inode);
547         ext2_dec_count(inode);
548         iput(inode);
549         EXIT;
550 out_dir:
551         ext2_dec_count(dir);
552         EXIT;
553         goto out;
554 }
555
556 static int ll_common_unlink(struct inode *dir, struct dentry *dentry,
557                             __u32 mode)
558 {
559         struct inode * inode = dentry->d_inode;
560         struct ext2_dir_entry_2 * de;
561         struct page * page;
562         int err = -ENOENT;
563
564         if (dentry->d_it && dentry->d_it->it_disposition) {
565                 err = dentry->d_it->it_status;
566                 if (!err)
567                         inode->i_nlink = 0;
568                 GOTO(out, err);
569         }
570
571         de = ext2_find_entry(dir, dentry, &page);
572         if (!de)
573                 goto out;
574
575         err = ll_mdc_unlink(dir, dentry->d_inode, mode,
576                             dentry->d_name.name, dentry->d_name.len);
577         if (err)
578                 goto out;
579
580         err = ext2_delete_entry(de, page);
581         if (err)
582                 goto out;
583
584         inode->i_ctime = dir->i_ctime;
585         ext2_dec_count(inode);
586 out:
587         return err;
588 }
589
590 static int ll_unlink(struct inode *dir, struct dentry *dentry)
591 {
592         return ll_common_unlink(dir, dentry, S_IFREG);
593 }
594
595 static int ll_rmdir(struct inode *dir, struct dentry *dentry)
596 {
597         struct inode * inode = dentry->d_inode;
598         int err = 0;
599         ENTRY;
600
601         if (!dentry->d_it || dentry->d_it->it_disposition == 0) {
602                 if (!ext2_empty_dir(inode))
603                         LBUG();
604
605                 err = ll_common_unlink(dir, dentry, S_IFDIR);
606         } else
607                 err = dentry->d_it->it_status;
608         if (err)
609                 RETURN(err);
610         inode->i_size = 0;
611         ext2_dec_count(inode);
612         ext2_dec_count(dir);
613         RETURN(err);
614 }
615
616 static int ll_rename(struct inode * old_dir, struct dentry * old_dentry,
617                      struct inode * new_dir, struct dentry * new_dentry)
618 {
619         struct inode * old_inode = old_dentry->d_inode;
620         struct inode * new_inode = new_dentry->d_inode;
621         struct page * dir_page = NULL;
622         struct ext2_dir_entry_2 * dir_de = NULL;
623         struct page * old_page;
624         struct ext2_dir_entry_2 * old_de;
625         int err = -ENOENT;
626
627         if (new_dentry->d_it && new_dentry->d_it->it_disposition)
628                 GOTO(out, err = new_dentry->d_it->it_status);
629
630         err = ll_mdc_rename(old_dir, new_dir, old_dentry, new_dentry);
631         if (err)
632                 goto out;
633
634         old_de = ext2_find_entry (old_dir, old_dentry, &old_page);
635         if (!old_de)
636                 goto out;
637
638         if (S_ISDIR(old_inode->i_mode)) {
639                 err = -EIO;
640                 dir_de = ext2_dotdot(old_inode, &dir_page);
641                 if (!dir_de)
642                         goto out_old;
643         }
644
645         if (new_inode) {
646                 struct page *new_page;
647                 struct ext2_dir_entry_2 *new_de;
648
649                 err = -ENOTEMPTY;
650                 if (dir_de && !ext2_empty_dir (new_inode))
651                         goto out_dir;
652
653                 err = -ENOENT;
654                 new_de = ext2_find_entry (new_dir, new_dentry, &new_page);
655                 if (!new_de)
656                         goto out_dir;
657                 ext2_inc_count(old_inode);
658                 ext2_set_link(new_dir, new_de, new_page, old_inode);
659                 new_inode->i_ctime = CURRENT_TIME;
660                 if (dir_de)
661                         new_inode->i_nlink--;
662                 ext2_dec_count(new_inode);
663         } else {
664                 if (dir_de) {
665                         err = -EMLINK;
666                         if (new_dir->i_nlink >= EXT2_LINK_MAX)
667                                 goto out_dir;
668                 }
669                 ext2_inc_count(old_inode);
670                 err = ll_add_link(new_dentry, old_inode);
671                 if (err) {
672                         ext2_dec_count(old_inode);
673                         goto out_dir;
674                 }
675                 if (dir_de)
676                         ext2_inc_count(new_dir);
677         }
678
679         ext2_delete_entry (old_de, old_page);
680         ext2_dec_count(old_inode);
681
682         if (dir_de) {
683                 ext2_set_link(old_inode, dir_de, dir_page, new_dir);
684                 ext2_dec_count(old_dir);
685         }
686         return 0;
687
688 out_dir:
689         if (dir_de) {
690                 kunmap(dir_page);
691                 page_cache_release(dir_page);
692         }
693 out_old:
694         kunmap(old_page);
695         page_cache_release(old_page);
696 out:
697         return err;
698 }
699
700 struct inode_operations ll_dir_inode_operations = {
701         create:         ll_create,
702         lookup2:        ll_lookup2,
703         link:           ll_link,
704         unlink:         ll_unlink,
705         symlink:        ll_symlink,
706         mkdir:          ll_mkdir,
707         rmdir:          ll_rmdir,
708         mknod:          ll_mknod,
709         rename:         ll_rename,
710         setattr:        ll_setattr
711 };